diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2015-02-24 12:38:42 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2015-03-19 12:26:47 -0400 |
commit | f6b355dda471879a69ddfa83d2db673b61da6c07 (patch) | |
tree | 8dae7426887979a26fca5ba34d468922857c79bc | |
parent | 47f2467fffc4e1a070b141bc9d1319dc2c0acea5 (diff) |
radeon/cik: add support for short HPD irqs
This adds support to process short HPD irqs on CIK gpus.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/radeon/cik.c | 99 |
1 files changed, 87 insertions, 12 deletions
diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c index e1db25e48688..28faea9996f9 100644 --- a/drivers/gpu/drm/radeon/cik.c +++ b/drivers/gpu/drm/radeon/cik.c | |||
@@ -7427,12 +7427,12 @@ int cik_irq_set(struct radeon_device *rdev) | |||
7427 | (CNTX_BUSY_INT_ENABLE | CNTX_EMPTY_INT_ENABLE); | 7427 | (CNTX_BUSY_INT_ENABLE | CNTX_EMPTY_INT_ENABLE); |
7428 | cp_int_cntl |= PRIV_INSTR_INT_ENABLE | PRIV_REG_INT_ENABLE; | 7428 | cp_int_cntl |= PRIV_INSTR_INT_ENABLE | PRIV_REG_INT_ENABLE; |
7429 | 7429 | ||
7430 | hpd1 = RREG32(DC_HPD1_INT_CONTROL) & ~DC_HPDx_INT_EN; | 7430 | hpd1 = RREG32(DC_HPD1_INT_CONTROL) & ~(DC_HPDx_INT_EN | DC_HPDx_RX_INT_EN); |
7431 | hpd2 = RREG32(DC_HPD2_INT_CONTROL) & ~DC_HPDx_INT_EN; | 7431 | hpd2 = RREG32(DC_HPD2_INT_CONTROL) & ~(DC_HPDx_INT_EN | DC_HPDx_RX_INT_EN); |
7432 | hpd3 = RREG32(DC_HPD3_INT_CONTROL) & ~DC_HPDx_INT_EN; | 7432 | hpd3 = RREG32(DC_HPD3_INT_CONTROL) & ~(DC_HPDx_INT_EN | DC_HPDx_RX_INT_EN); |
7433 | hpd4 = RREG32(DC_HPD4_INT_CONTROL) & ~DC_HPDx_INT_EN; | 7433 | hpd4 = RREG32(DC_HPD4_INT_CONTROL) & ~(DC_HPDx_INT_EN | DC_HPDx_RX_INT_EN); |
7434 | hpd5 = RREG32(DC_HPD5_INT_CONTROL) & ~DC_HPDx_INT_EN; | 7434 | hpd5 = RREG32(DC_HPD5_INT_CONTROL) & ~(DC_HPDx_INT_EN | DC_HPDx_RX_INT_EN); |
7435 | hpd6 = RREG32(DC_HPD6_INT_CONTROL) & ~DC_HPDx_INT_EN; | 7435 | hpd6 = RREG32(DC_HPD6_INT_CONTROL) & ~(DC_HPDx_INT_EN | DC_HPDx_RX_INT_EN); |
7436 | 7436 | ||
7437 | dma_cntl = RREG32(SDMA0_CNTL + SDMA0_REGISTER_OFFSET) & ~TRAP_ENABLE; | 7437 | dma_cntl = RREG32(SDMA0_CNTL + SDMA0_REGISTER_OFFSET) & ~TRAP_ENABLE; |
7438 | dma_cntl1 = RREG32(SDMA0_CNTL + SDMA1_REGISTER_OFFSET) & ~TRAP_ENABLE; | 7438 | dma_cntl1 = RREG32(SDMA0_CNTL + SDMA1_REGISTER_OFFSET) & ~TRAP_ENABLE; |
@@ -7519,27 +7519,27 @@ int cik_irq_set(struct radeon_device *rdev) | |||
7519 | } | 7519 | } |
7520 | if (rdev->irq.hpd[0]) { | 7520 | if (rdev->irq.hpd[0]) { |
7521 | DRM_DEBUG("cik_irq_set: hpd 1\n"); | 7521 | DRM_DEBUG("cik_irq_set: hpd 1\n"); |
7522 | hpd1 |= DC_HPDx_INT_EN; | 7522 | hpd1 |= DC_HPDx_INT_EN | DC_HPDx_RX_INT_EN; |
7523 | } | 7523 | } |
7524 | if (rdev->irq.hpd[1]) { | 7524 | if (rdev->irq.hpd[1]) { |
7525 | DRM_DEBUG("cik_irq_set: hpd 2\n"); | 7525 | DRM_DEBUG("cik_irq_set: hpd 2\n"); |
7526 | hpd2 |= DC_HPDx_INT_EN; | 7526 | hpd2 |= DC_HPDx_INT_EN | DC_HPDx_RX_INT_EN; |
7527 | } | 7527 | } |
7528 | if (rdev->irq.hpd[2]) { | 7528 | if (rdev->irq.hpd[2]) { |
7529 | DRM_DEBUG("cik_irq_set: hpd 3\n"); | 7529 | DRM_DEBUG("cik_irq_set: hpd 3\n"); |
7530 | hpd3 |= DC_HPDx_INT_EN; | 7530 | hpd3 |= DC_HPDx_INT_EN | DC_HPDx_RX_INT_EN; |
7531 | } | 7531 | } |
7532 | if (rdev->irq.hpd[3]) { | 7532 | if (rdev->irq.hpd[3]) { |
7533 | DRM_DEBUG("cik_irq_set: hpd 4\n"); | 7533 | DRM_DEBUG("cik_irq_set: hpd 4\n"); |
7534 | hpd4 |= DC_HPDx_INT_EN; | 7534 | hpd4 |= DC_HPDx_INT_EN | DC_HPDx_RX_INT_EN; |
7535 | } | 7535 | } |
7536 | if (rdev->irq.hpd[4]) { | 7536 | if (rdev->irq.hpd[4]) { |
7537 | DRM_DEBUG("cik_irq_set: hpd 5\n"); | 7537 | DRM_DEBUG("cik_irq_set: hpd 5\n"); |
7538 | hpd5 |= DC_HPDx_INT_EN; | 7538 | hpd5 |= DC_HPDx_INT_EN | DC_HPDx_RX_INT_EN; |
7539 | } | 7539 | } |
7540 | if (rdev->irq.hpd[5]) { | 7540 | if (rdev->irq.hpd[5]) { |
7541 | DRM_DEBUG("cik_irq_set: hpd 6\n"); | 7541 | DRM_DEBUG("cik_irq_set: hpd 6\n"); |
7542 | hpd6 |= DC_HPDx_INT_EN; | 7542 | hpd6 |= DC_HPDx_INT_EN | DC_HPDx_RX_INT_EN; |
7543 | } | 7543 | } |
7544 | 7544 | ||
7545 | WREG32(CP_INT_CNTL_RING0, cp_int_cntl); | 7545 | WREG32(CP_INT_CNTL_RING0, cp_int_cntl); |
@@ -7711,6 +7711,36 @@ static inline void cik_irq_ack(struct radeon_device *rdev) | |||
7711 | tmp |= DC_HPDx_INT_ACK; | 7711 | tmp |= DC_HPDx_INT_ACK; |
7712 | WREG32(DC_HPD6_INT_CONTROL, tmp); | 7712 | WREG32(DC_HPD6_INT_CONTROL, tmp); |
7713 | } | 7713 | } |
7714 | if (rdev->irq.stat_regs.cik.disp_int & DC_HPD1_RX_INTERRUPT) { | ||
7715 | tmp = RREG32(DC_HPD1_INT_CONTROL); | ||
7716 | tmp |= DC_HPDx_RX_INT_ACK; | ||
7717 | WREG32(DC_HPD1_INT_CONTROL, tmp); | ||
7718 | } | ||
7719 | if (rdev->irq.stat_regs.cik.disp_int_cont & DC_HPD2_RX_INTERRUPT) { | ||
7720 | tmp = RREG32(DC_HPD2_INT_CONTROL); | ||
7721 | tmp |= DC_HPDx_RX_INT_ACK; | ||
7722 | WREG32(DC_HPD2_INT_CONTROL, tmp); | ||
7723 | } | ||
7724 | if (rdev->irq.stat_regs.cik.disp_int_cont2 & DC_HPD3_RX_INTERRUPT) { | ||
7725 | tmp = RREG32(DC_HPD3_INT_CONTROL); | ||
7726 | tmp |= DC_HPDx_RX_INT_ACK; | ||
7727 | WREG32(DC_HPD3_INT_CONTROL, tmp); | ||
7728 | } | ||
7729 | if (rdev->irq.stat_regs.cik.disp_int_cont3 & DC_HPD4_RX_INTERRUPT) { | ||
7730 | tmp = RREG32(DC_HPD4_INT_CONTROL); | ||
7731 | tmp |= DC_HPDx_RX_INT_ACK; | ||
7732 | WREG32(DC_HPD4_INT_CONTROL, tmp); | ||
7733 | } | ||
7734 | if (rdev->irq.stat_regs.cik.disp_int_cont4 & DC_HPD5_RX_INTERRUPT) { | ||
7735 | tmp = RREG32(DC_HPD5_INT_CONTROL); | ||
7736 | tmp |= DC_HPDx_RX_INT_ACK; | ||
7737 | WREG32(DC_HPD5_INT_CONTROL, tmp); | ||
7738 | } | ||
7739 | if (rdev->irq.stat_regs.cik.disp_int_cont5 & DC_HPD6_RX_INTERRUPT) { | ||
7740 | tmp = RREG32(DC_HPD5_INT_CONTROL); | ||
7741 | tmp |= DC_HPDx_RX_INT_ACK; | ||
7742 | WREG32(DC_HPD6_INT_CONTROL, tmp); | ||
7743 | } | ||
7714 | } | 7744 | } |
7715 | 7745 | ||
7716 | /** | 7746 | /** |
@@ -7836,6 +7866,7 @@ int cik_irq_process(struct radeon_device *rdev) | |||
7836 | u8 me_id, pipe_id, queue_id; | 7866 | u8 me_id, pipe_id, queue_id; |
7837 | u32 ring_index; | 7867 | u32 ring_index; |
7838 | bool queue_hotplug = false; | 7868 | bool queue_hotplug = false; |
7869 | bool queue_dp = false; | ||
7839 | bool queue_reset = false; | 7870 | bool queue_reset = false; |
7840 | u32 addr, status, mc_client; | 7871 | u32 addr, status, mc_client; |
7841 | bool queue_thermal = false; | 7872 | bool queue_thermal = false; |
@@ -8081,6 +8112,48 @@ restart_ih: | |||
8081 | DRM_DEBUG("IH: HPD6\n"); | 8112 | DRM_DEBUG("IH: HPD6\n"); |
8082 | } | 8113 | } |
8083 | break; | 8114 | break; |
8115 | case 6: | ||
8116 | if (rdev->irq.stat_regs.cik.disp_int & DC_HPD1_RX_INTERRUPT) { | ||
8117 | rdev->irq.stat_regs.cik.disp_int &= ~DC_HPD1_RX_INTERRUPT; | ||
8118 | queue_dp = true; | ||
8119 | DRM_DEBUG("IH: HPD_RX 1\n"); | ||
8120 | } | ||
8121 | break; | ||
8122 | case 7: | ||
8123 | if (rdev->irq.stat_regs.cik.disp_int_cont & DC_HPD2_RX_INTERRUPT) { | ||
8124 | rdev->irq.stat_regs.cik.disp_int_cont &= ~DC_HPD2_RX_INTERRUPT; | ||
8125 | queue_dp = true; | ||
8126 | DRM_DEBUG("IH: HPD_RX 2\n"); | ||
8127 | } | ||
8128 | break; | ||
8129 | case 8: | ||
8130 | if (rdev->irq.stat_regs.cik.disp_int_cont2 & DC_HPD3_RX_INTERRUPT) { | ||
8131 | rdev->irq.stat_regs.cik.disp_int_cont2 &= ~DC_HPD3_RX_INTERRUPT; | ||
8132 | queue_dp = true; | ||
8133 | DRM_DEBUG("IH: HPD_RX 3\n"); | ||
8134 | } | ||
8135 | break; | ||
8136 | case 9: | ||
8137 | if (rdev->irq.stat_regs.cik.disp_int_cont3 & DC_HPD4_RX_INTERRUPT) { | ||
8138 | rdev->irq.stat_regs.cik.disp_int_cont3 &= ~DC_HPD4_RX_INTERRUPT; | ||
8139 | queue_dp = true; | ||
8140 | DRM_DEBUG("IH: HPD_RX 4\n"); | ||
8141 | } | ||
8142 | break; | ||
8143 | case 10: | ||
8144 | if (rdev->irq.stat_regs.cik.disp_int_cont4 & DC_HPD5_RX_INTERRUPT) { | ||
8145 | rdev->irq.stat_regs.cik.disp_int_cont4 &= ~DC_HPD5_RX_INTERRUPT; | ||
8146 | queue_dp = true; | ||
8147 | DRM_DEBUG("IH: HPD_RX 5\n"); | ||
8148 | } | ||
8149 | break; | ||
8150 | case 11: | ||
8151 | if (rdev->irq.stat_regs.cik.disp_int_cont5 & DC_HPD6_RX_INTERRUPT) { | ||
8152 | rdev->irq.stat_regs.cik.disp_int_cont5 &= ~DC_HPD6_RX_INTERRUPT; | ||
8153 | queue_dp = true; | ||
8154 | DRM_DEBUG("IH: HPD_RX 6\n"); | ||
8155 | } | ||
8156 | break; | ||
8084 | default: | 8157 | default: |
8085 | DRM_DEBUG("Unhandled interrupt: %d %d\n", src_id, src_data); | 8158 | DRM_DEBUG("Unhandled interrupt: %d %d\n", src_id, src_data); |
8086 | break; | 8159 | break; |
@@ -8289,6 +8362,8 @@ restart_ih: | |||
8289 | rptr &= rdev->ih.ptr_mask; | 8362 | rptr &= rdev->ih.ptr_mask; |
8290 | WREG32(IH_RB_RPTR, rptr); | 8363 | WREG32(IH_RB_RPTR, rptr); |
8291 | } | 8364 | } |
8365 | if (queue_dp) | ||
8366 | schedule_work(&rdev->dp_work); | ||
8292 | if (queue_hotplug) | 8367 | if (queue_hotplug) |
8293 | schedule_work(&rdev->hotplug_work); | 8368 | schedule_work(&rdev->hotplug_work); |
8294 | if (queue_reset) { | 8369 | if (queue_reset) { |