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_v9_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_v9_0.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 59 |
1 files changed, 43 insertions, 16 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c index 375620afd328..e9dd2c183a58 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | |||
@@ -3982,26 +3982,53 @@ static void gfx_v9_0_set_compute_eop_interrupt_state(struct amdgpu_device *adev, | |||
3982 | int me, int pipe, | 3982 | int me, int pipe, |
3983 | enum amdgpu_interrupt_state state) | 3983 | enum amdgpu_interrupt_state state) |
3984 | { | 3984 | { |
3985 | /* Me 0 is reserved for graphics */ | 3985 | u32 mec_int_cntl, mec_int_cntl_reg; |
3986 | if (me < 1 || me > adev->gfx.mec.num_mec) { | ||
3987 | DRM_ERROR("Ignoring request to enable interrupts for invalid me:%d\n", me); | ||
3988 | return; | ||
3989 | } | ||
3990 | 3986 | ||
3991 | if (pipe >= adev->gfx.mec.num_pipe_per_mec) { | 3987 | /* |
3992 | DRM_ERROR("Ignoring request to enable interrupts for invalid " | 3988 | * amdgpu controls only the first MEC. That's why this function only |
3993 | "me:%d pipe:%d\n", pipe, me); | 3989 | * handles the setting of interrupts for this specific MEC. All other |
3990 | * pipes' interrupts are set by amdkfd. | ||
3991 | */ | ||
3992 | |||
3993 | if (me == 1) { | ||
3994 | switch (pipe) { | ||
3995 | case 0: | ||
3996 | mec_int_cntl_reg = SOC15_REG_OFFSET(GC, 0, mmCP_ME1_PIPE0_INT_CNTL); | ||
3997 | break; | ||
3998 | case 1: | ||
3999 | mec_int_cntl_reg = SOC15_REG_OFFSET(GC, 0, mmCP_ME1_PIPE1_INT_CNTL); | ||
4000 | break; | ||
4001 | case 2: | ||
4002 | mec_int_cntl_reg = SOC15_REG_OFFSET(GC, 0, mmCP_ME1_PIPE2_INT_CNTL); | ||
4003 | break; | ||
4004 | case 3: | ||
4005 | mec_int_cntl_reg = SOC15_REG_OFFSET(GC, 0, mmCP_ME1_PIPE3_INT_CNTL); | ||
4006 | break; | ||
4007 | default: | ||
4008 | DRM_DEBUG("invalid pipe %d\n", pipe); | ||
4009 | return; | ||
4010 | } | ||
4011 | } else { | ||
4012 | DRM_DEBUG("invalid me %d\n", me); | ||
3994 | return; | 4013 | return; |
3995 | } | 4014 | } |
3996 | 4015 | ||
3997 | mutex_lock(&adev->srbm_mutex); | 4016 | switch (state) { |
3998 | soc15_grbm_select(adev, me, pipe, 0, 0); | 4017 | case AMDGPU_IRQ_STATE_DISABLE: |
3999 | 4018 | mec_int_cntl = RREG32(mec_int_cntl_reg); | |
4000 | WREG32_FIELD(CPC_INT_CNTL, TIME_STAMP_INT_ENABLE, | 4019 | mec_int_cntl = REG_SET_FIELD(mec_int_cntl, CP_ME1_PIPE0_INT_CNTL, |
4001 | state == AMDGPU_IRQ_STATE_DISABLE ? 0 : 1); | 4020 | TIME_STAMP_INT_ENABLE, 0); |
4002 | 4021 | WREG32(mec_int_cntl_reg, mec_int_cntl); | |
4003 | soc15_grbm_select(adev, 0, 0, 0, 0); | 4022 | break; |
4004 | mutex_unlock(&adev->srbm_mutex); | 4023 | case AMDGPU_IRQ_STATE_ENABLE: |
4024 | mec_int_cntl = RREG32(mec_int_cntl_reg); | ||
4025 | mec_int_cntl = REG_SET_FIELD(mec_int_cntl, CP_ME1_PIPE0_INT_CNTL, | ||
4026 | TIME_STAMP_INT_ENABLE, 1); | ||
4027 | WREG32(mec_int_cntl_reg, mec_int_cntl); | ||
4028 | break; | ||
4029 | default: | ||
4030 | break; | ||
4031 | } | ||
4005 | } | 4032 | } |
4006 | 4033 | ||
4007 | static int gfx_v9_0_set_priv_reg_fault_state(struct amdgpu_device *adev, | 4034 | static int gfx_v9_0_set_priv_reg_fault_state(struct amdgpu_device *adev, |