diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2017-06-09 08:22:31 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-06-09 11:30:42 -0400 |
commit | d0c55cdf4fc02483a4851f86e3f010a061d8c9cc (patch) | |
tree | 309fc1b51e44f87aca4399ce977cbc18e8da8368 /drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | |
parent | f06fed92dcf27d83ad546c9a510165d1bd54fc3f (diff) |
drm/amdgpu/gfx: fix MEC interrupt enablement for pipes != 0
The interrupt registers are not indexed.
Fixes: 763a47b8e (drm/amdgpu: teach amdgpu how to enable interrupts for any pipe v3)
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 57 |
1 files changed, 41 insertions, 16 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c index 6e541af0e899..1a75ab1d1823 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | |||
@@ -6610,26 +6610,51 @@ static void gfx_v8_0_set_compute_eop_interrupt_state(struct amdgpu_device *adev, | |||
6610 | int me, int pipe, | 6610 | int me, int pipe, |
6611 | enum amdgpu_interrupt_state state) | 6611 | enum amdgpu_interrupt_state state) |
6612 | { | 6612 | { |
6613 | /* Me 0 is reserved for graphics */ | 6613 | u32 mec_int_cntl, mec_int_cntl_reg; |
6614 | if (me < 1 || me > adev->gfx.mec.num_mec) { | ||
6615 | DRM_ERROR("Ignoring request to enable interrupts for invalid me:%d\n", me); | ||
6616 | return; | ||
6617 | } | ||
6618 | 6614 | ||
6619 | if (pipe >= adev->gfx.mec.num_pipe_per_mec) { | 6615 | /* |
6620 | DRM_ERROR("Ignoring request to enable interrupts for invalid " | 6616 | * amdgpu controls only the first MEC. That's why this function only |
6621 | "me:%d pipe:%d\n", pipe, me); | 6617 | * handles the setting of interrupts for this specific MEC. All other |
6618 | * pipes' interrupts are set by amdkfd. | ||
6619 | */ | ||
6620 | |||
6621 | if (me == 1) { | ||
6622 | switch (pipe) { | ||
6623 | case 0: | ||
6624 | mec_int_cntl_reg = mmCP_ME1_PIPE0_INT_CNTL; | ||
6625 | break; | ||
6626 | case 1: | ||
6627 | mec_int_cntl_reg = mmCP_ME1_PIPE1_INT_CNTL; | ||
6628 | break; | ||
6629 | case 2: | ||
6630 | mec_int_cntl_reg = mmCP_ME1_PIPE2_INT_CNTL; | ||
6631 | break; | ||
6632 | case 3: | ||
6633 | mec_int_cntl_reg = mmCP_ME1_PIPE3_INT_CNTL; | ||
6634 | break; | ||
6635 | default: | ||
6636 | DRM_DEBUG("invalid pipe %d\n", pipe); | ||
6637 | return; | ||
6638 | } | ||
6639 | } else { | ||
6640 | DRM_DEBUG("invalid me %d\n", me); | ||
6622 | return; | 6641 | return; |
6623 | } | 6642 | } |
6624 | 6643 | ||
6625 | mutex_lock(&adev->srbm_mutex); | 6644 | switch (state) { |
6626 | vi_srbm_select(adev, me, pipe, 0, 0); | 6645 | case AMDGPU_IRQ_STATE_DISABLE: |
6627 | 6646 | mec_int_cntl = RREG32(mec_int_cntl_reg); | |
6628 | WREG32_FIELD(CPC_INT_CNTL, TIME_STAMP_INT_ENABLE, | 6647 | mec_int_cntl &= ~CP_INT_CNTL_RING0__TIME_STAMP_INT_ENABLE_MASK; |
6629 | state == AMDGPU_IRQ_STATE_DISABLE ? 0 : 1); | 6648 | WREG32(mec_int_cntl_reg, mec_int_cntl); |
6630 | 6649 | break; | |
6631 | vi_srbm_select(adev, 0, 0, 0, 0); | 6650 | case AMDGPU_IRQ_STATE_ENABLE: |
6632 | mutex_unlock(&adev->srbm_mutex); | 6651 | mec_int_cntl = RREG32(mec_int_cntl_reg); |
6652 | mec_int_cntl |= CP_INT_CNTL_RING0__TIME_STAMP_INT_ENABLE_MASK; | ||
6653 | WREG32(mec_int_cntl_reg, mec_int_cntl); | ||
6654 | break; | ||
6655 | default: | ||
6656 | break; | ||
6657 | } | ||
6633 | } | 6658 | } |
6634 | 6659 | ||
6635 | static int gfx_v8_0_set_priv_reg_fault_state(struct amdgpu_device *adev, | 6660 | static int gfx_v8_0_set_priv_reg_fault_state(struct amdgpu_device *adev, |