diff options
author | Christian Koenig <deathsimple@vodafone.de> | 2010-04-09 21:13:16 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-04-23 00:12:17 -0400 |
commit | f2594933df9719bd2b0aaaa8ea9b2b850d6e1c42 (patch) | |
tree | 25948717c6531226188c3e051fa11edc09426bfb /drivers/gpu/drm/radeon/r600.c | |
parent | 58bd086313ea0eda037f65b9bda2b3decb959a31 (diff) |
drm/radeon/kms: HDMI irq support
Implements irq support for HDMI audio output. Now the polling timer
is only enabled if irq support isn't available.
Signed-off-by: Christian König <deathsimple@vodafone.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/r600.c')
-rw-r--r-- | drivers/gpu/drm/radeon/r600.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index c325cb121059..2ec423c3f3f8 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c | |||
@@ -2527,6 +2527,7 @@ int r600_irq_set(struct radeon_device *rdev) | |||
2527 | u32 cp_int_cntl = CNTX_BUSY_INT_ENABLE | CNTX_EMPTY_INT_ENABLE; | 2527 | u32 cp_int_cntl = CNTX_BUSY_INT_ENABLE | CNTX_EMPTY_INT_ENABLE; |
2528 | u32 mode_int = 0; | 2528 | u32 mode_int = 0; |
2529 | u32 hpd1, hpd2, hpd3, hpd4 = 0, hpd5 = 0, hpd6 = 0; | 2529 | u32 hpd1, hpd2, hpd3, hpd4 = 0, hpd5 = 0, hpd6 = 0; |
2530 | u32 hdmi1, hdmi2; | ||
2530 | 2531 | ||
2531 | if (!rdev->irq.installed) { | 2532 | if (!rdev->irq.installed) { |
2532 | WARN(1, "Can't enable IRQ/MSI because no handler is installed.\n"); | 2533 | WARN(1, "Can't enable IRQ/MSI because no handler is installed.\n"); |
@@ -2540,7 +2541,9 @@ int r600_irq_set(struct radeon_device *rdev) | |||
2540 | return 0; | 2541 | return 0; |
2541 | } | 2542 | } |
2542 | 2543 | ||
2544 | hdmi1 = RREG32(R600_HDMI_BLOCK1 + R600_HDMI_CNTL) & ~R600_HDMI_INT_EN; | ||
2543 | if (ASIC_IS_DCE3(rdev)) { | 2545 | if (ASIC_IS_DCE3(rdev)) { |
2546 | hdmi2 = RREG32(R600_HDMI_BLOCK3 + R600_HDMI_CNTL) & ~R600_HDMI_INT_EN; | ||
2544 | hpd1 = RREG32(DC_HPD1_INT_CONTROL) & ~DC_HPDx_INT_EN; | 2547 | hpd1 = RREG32(DC_HPD1_INT_CONTROL) & ~DC_HPDx_INT_EN; |
2545 | hpd2 = RREG32(DC_HPD2_INT_CONTROL) & ~DC_HPDx_INT_EN; | 2548 | hpd2 = RREG32(DC_HPD2_INT_CONTROL) & ~DC_HPDx_INT_EN; |
2546 | hpd3 = RREG32(DC_HPD3_INT_CONTROL) & ~DC_HPDx_INT_EN; | 2549 | hpd3 = RREG32(DC_HPD3_INT_CONTROL) & ~DC_HPDx_INT_EN; |
@@ -2550,6 +2553,7 @@ int r600_irq_set(struct radeon_device *rdev) | |||
2550 | hpd6 = RREG32(DC_HPD6_INT_CONTROL) & ~DC_HPDx_INT_EN; | 2553 | hpd6 = RREG32(DC_HPD6_INT_CONTROL) & ~DC_HPDx_INT_EN; |
2551 | } | 2554 | } |
2552 | } else { | 2555 | } else { |
2556 | hdmi2 = RREG32(R600_HDMI_BLOCK2 + R600_HDMI_CNTL) & ~R600_HDMI_INT_EN; | ||
2553 | hpd1 = RREG32(DC_HOT_PLUG_DETECT1_INT_CONTROL) & ~DC_HPDx_INT_EN; | 2557 | hpd1 = RREG32(DC_HOT_PLUG_DETECT1_INT_CONTROL) & ~DC_HPDx_INT_EN; |
2554 | hpd2 = RREG32(DC_HOT_PLUG_DETECT2_INT_CONTROL) & ~DC_HPDx_INT_EN; | 2558 | hpd2 = RREG32(DC_HOT_PLUG_DETECT2_INT_CONTROL) & ~DC_HPDx_INT_EN; |
2555 | hpd3 = RREG32(DC_HOT_PLUG_DETECT3_INT_CONTROL) & ~DC_HPDx_INT_EN; | 2559 | hpd3 = RREG32(DC_HOT_PLUG_DETECT3_INT_CONTROL) & ~DC_HPDx_INT_EN; |
@@ -2591,10 +2595,20 @@ int r600_irq_set(struct radeon_device *rdev) | |||
2591 | DRM_DEBUG("r600_irq_set: hpd 6\n"); | 2595 | DRM_DEBUG("r600_irq_set: hpd 6\n"); |
2592 | hpd6 |= DC_HPDx_INT_EN; | 2596 | hpd6 |= DC_HPDx_INT_EN; |
2593 | } | 2597 | } |
2598 | if (rdev->irq.hdmi[0]) { | ||
2599 | DRM_DEBUG("r600_irq_set: hdmi 1\n"); | ||
2600 | hdmi1 |= R600_HDMI_INT_EN; | ||
2601 | } | ||
2602 | if (rdev->irq.hdmi[1]) { | ||
2603 | DRM_DEBUG("r600_irq_set: hdmi 2\n"); | ||
2604 | hdmi2 |= R600_HDMI_INT_EN; | ||
2605 | } | ||
2594 | 2606 | ||
2595 | WREG32(CP_INT_CNTL, cp_int_cntl); | 2607 | WREG32(CP_INT_CNTL, cp_int_cntl); |
2596 | WREG32(DxMODE_INT_MASK, mode_int); | 2608 | WREG32(DxMODE_INT_MASK, mode_int); |
2609 | WREG32(R600_HDMI_BLOCK1 + R600_HDMI_CNTL, hdmi1); | ||
2597 | if (ASIC_IS_DCE3(rdev)) { | 2610 | if (ASIC_IS_DCE3(rdev)) { |
2611 | WREG32(R600_HDMI_BLOCK3 + R600_HDMI_CNTL, hdmi2); | ||
2598 | WREG32(DC_HPD1_INT_CONTROL, hpd1); | 2612 | WREG32(DC_HPD1_INT_CONTROL, hpd1); |
2599 | WREG32(DC_HPD2_INT_CONTROL, hpd2); | 2613 | WREG32(DC_HPD2_INT_CONTROL, hpd2); |
2600 | WREG32(DC_HPD3_INT_CONTROL, hpd3); | 2614 | WREG32(DC_HPD3_INT_CONTROL, hpd3); |
@@ -2604,6 +2618,7 @@ int r600_irq_set(struct radeon_device *rdev) | |||
2604 | WREG32(DC_HPD6_INT_CONTROL, hpd6); | 2618 | WREG32(DC_HPD6_INT_CONTROL, hpd6); |
2605 | } | 2619 | } |
2606 | } else { | 2620 | } else { |
2621 | WREG32(R600_HDMI_BLOCK2 + R600_HDMI_CNTL, hdmi2); | ||
2607 | WREG32(DC_HOT_PLUG_DETECT1_INT_CONTROL, hpd1); | 2622 | WREG32(DC_HOT_PLUG_DETECT1_INT_CONTROL, hpd1); |
2608 | WREG32(DC_HOT_PLUG_DETECT2_INT_CONTROL, hpd2); | 2623 | WREG32(DC_HOT_PLUG_DETECT2_INT_CONTROL, hpd2); |
2609 | WREG32(DC_HOT_PLUG_DETECT3_INT_CONTROL, hpd3); | 2624 | WREG32(DC_HOT_PLUG_DETECT3_INT_CONTROL, hpd3); |
@@ -2687,6 +2702,18 @@ static inline void r600_irq_ack(struct radeon_device *rdev, | |||
2687 | WREG32(DC_HPD6_INT_CONTROL, tmp); | 2702 | WREG32(DC_HPD6_INT_CONTROL, tmp); |
2688 | } | 2703 | } |
2689 | } | 2704 | } |
2705 | if (RREG32(R600_HDMI_BLOCK1 + R600_HDMI_STATUS) & R600_HDMI_INT_PENDING) { | ||
2706 | WREG32_P(R600_HDMI_BLOCK1 + R600_HDMI_CNTL, R600_HDMI_INT_ACK, ~R600_HDMI_INT_ACK); | ||
2707 | } | ||
2708 | if (ASIC_IS_DCE3(rdev)) { | ||
2709 | if (RREG32(R600_HDMI_BLOCK3 + R600_HDMI_STATUS) & R600_HDMI_INT_PENDING) { | ||
2710 | WREG32_P(R600_HDMI_BLOCK3 + R600_HDMI_CNTL, R600_HDMI_INT_ACK, ~R600_HDMI_INT_ACK); | ||
2711 | } | ||
2712 | } else { | ||
2713 | if (RREG32(R600_HDMI_BLOCK2 + R600_HDMI_STATUS) & R600_HDMI_INT_PENDING) { | ||
2714 | WREG32_P(R600_HDMI_BLOCK2 + R600_HDMI_CNTL, R600_HDMI_INT_ACK, ~R600_HDMI_INT_ACK); | ||
2715 | } | ||
2716 | } | ||
2690 | } | 2717 | } |
2691 | 2718 | ||
2692 | void r600_irq_disable(struct radeon_device *rdev) | 2719 | void r600_irq_disable(struct radeon_device *rdev) |
@@ -2740,6 +2767,8 @@ static inline u32 r600_get_ih_wptr(struct radeon_device *rdev) | |||
2740 | * 19 1 FP Hot plug detection B | 2767 | * 19 1 FP Hot plug detection B |
2741 | * 19 2 DAC A auto-detection | 2768 | * 19 2 DAC A auto-detection |
2742 | * 19 3 DAC B auto-detection | 2769 | * 19 3 DAC B auto-detection |
2770 | * 21 4 HDMI block A | ||
2771 | * 21 5 HDMI block B | ||
2743 | * 176 - CP_INT RB | 2772 | * 176 - CP_INT RB |
2744 | * 177 - CP_INT IB1 | 2773 | * 177 - CP_INT IB1 |
2745 | * 178 - CP_INT IB2 | 2774 | * 178 - CP_INT IB2 |
@@ -2879,6 +2908,10 @@ restart_ih: | |||
2879 | break; | 2908 | break; |
2880 | } | 2909 | } |
2881 | break; | 2910 | break; |
2911 | case 21: /* HDMI */ | ||
2912 | DRM_DEBUG("IH: HDMI: 0x%x\n", src_data); | ||
2913 | r600_audio_schedule_polling(rdev); | ||
2914 | break; | ||
2882 | case 176: /* CP_INT in ring buffer */ | 2915 | case 176: /* CP_INT in ring buffer */ |
2883 | case 177: /* CP_INT in IB1 */ | 2916 | case 177: /* CP_INT in IB1 */ |
2884 | case 178: /* CP_INT in IB2 */ | 2917 | case 178: /* CP_INT in IB2 */ |