Skip to content

Commit 2b00b32

Browse files
alexdeuchergregkh
authored andcommitted
drm/amdgpu/mes12: optimize MES pipe FW version fetching
commit 34779e1 upstream. Don't fetch it again if we already have it. It seems the registers don't reliably have the value at resume in some cases. Fixes: 785f0f9 ("drm/amdgpu: Add mes v12_0 ip block support (v4)") Reviewed-by: Shaoyun.liu <[email protected]> Signed-off-by: Alex Deucher <[email protected]> (cherry picked from commit 9e7b08d) Cc: [email protected] # 6.12.x Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 42f7b5d commit 2b00b32

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

drivers/gpu/drm/amd/amdgpu/mes_v12_0.c

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1225,17 +1225,20 @@ static int mes_v12_0_queue_init(struct amdgpu_device *adev,
12251225
mes_v12_0_queue_init_register(ring);
12261226
}
12271227

1228-
/* get MES scheduler/KIQ versions */
1229-
mutex_lock(&adev->srbm_mutex);
1230-
soc21_grbm_select(adev, 3, pipe, 0, 0);
1228+
if (((pipe == AMDGPU_MES_SCHED_PIPE) && !adev->mes.sched_version) ||
1229+
((pipe == AMDGPU_MES_KIQ_PIPE) && !adev->mes.kiq_version)) {
1230+
/* get MES scheduler/KIQ versions */
1231+
mutex_lock(&adev->srbm_mutex);
1232+
soc21_grbm_select(adev, 3, pipe, 0, 0);
12311233

1232-
if (pipe == AMDGPU_MES_SCHED_PIPE)
1233-
adev->mes.sched_version = RREG32_SOC15(GC, 0, regCP_MES_GP3_LO);
1234-
else if (pipe == AMDGPU_MES_KIQ_PIPE && adev->enable_mes_kiq)
1235-
adev->mes.kiq_version = RREG32_SOC15(GC, 0, regCP_MES_GP3_LO);
1234+
if (pipe == AMDGPU_MES_SCHED_PIPE)
1235+
adev->mes.sched_version = RREG32_SOC15(GC, 0, regCP_MES_GP3_LO);
1236+
else if (pipe == AMDGPU_MES_KIQ_PIPE && adev->enable_mes_kiq)
1237+
adev->mes.kiq_version = RREG32_SOC15(GC, 0, regCP_MES_GP3_LO);
12361238

1237-
soc21_grbm_select(adev, 0, 0, 0, 0);
1238-
mutex_unlock(&adev->srbm_mutex);
1239+
soc21_grbm_select(adev, 0, 0, 0, 0);
1240+
mutex_unlock(&adev->srbm_mutex);
1241+
}
12391242

12401243
return 0;
12411244
}

0 commit comments

Comments
 (0)