Skip to content

Commit 74248ea

Browse files
alexdeuchergregkh
authored andcommitted
drm/amdgpu/gfx9: manually control gfxoff for CS on RV
commit b35eb91 upstream. When mesa started using compute queues more often we started seeing additional hangs with compute queues. Disabling gfxoff seems to mitigate that. Manually control gfxoff and gfx pg with command submissions to avoid any issues related to gfxoff. KFD already does the same thing for these chips. v2: limit to compute v3: limit to APUs v4: limit to Raven/PCO v5: only update the compute ring_funcs v6: Disable GFX PG v7: adjust order Reviewed-by: Lijo Lazar <[email protected]> Suggested-by: Błażej Szczygieł <[email protected]> Suggested-by: Sergey Kovalenko <[email protected]> Link: https://gitlab.freedesktop.org/drm/amd/-/issues/3861 Link: https://lists.freedesktop.org/archives/amd-gfx/2025-January/119116.html Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected] # 6.12.x Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent a711733 commit 74248ea

File tree

1 file changed

+30
-2
lines changed

1 file changed

+30
-2
lines changed

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

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7439,6 +7439,34 @@ static void gfx_v9_0_ring_emit_cleaner_shader(struct amdgpu_ring *ring)
74397439
amdgpu_ring_write(ring, 0); /* RESERVED field, programmed to zero */
74407440
}
74417441

7442+
static void gfx_v9_0_ring_begin_use_compute(struct amdgpu_ring *ring)
7443+
{
7444+
struct amdgpu_device *adev = ring->adev;
7445+
7446+
amdgpu_gfx_enforce_isolation_ring_begin_use(ring);
7447+
7448+
/* Raven and PCO APUs seem to have stability issues
7449+
* with compute and gfxoff and gfx pg. Disable gfx pg during
7450+
* submission and allow again afterwards.
7451+
*/
7452+
if (amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(9, 1, 0))
7453+
gfx_v9_0_set_powergating_state(adev, AMD_PG_STATE_UNGATE);
7454+
}
7455+
7456+
static void gfx_v9_0_ring_end_use_compute(struct amdgpu_ring *ring)
7457+
{
7458+
struct amdgpu_device *adev = ring->adev;
7459+
7460+
/* Raven and PCO APUs seem to have stability issues
7461+
* with compute and gfxoff and gfx pg. Disable gfx pg during
7462+
* submission and allow again afterwards.
7463+
*/
7464+
if (amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(9, 1, 0))
7465+
gfx_v9_0_set_powergating_state(adev, AMD_PG_STATE_GATE);
7466+
7467+
amdgpu_gfx_enforce_isolation_ring_end_use(ring);
7468+
}
7469+
74427470
static const struct amd_ip_funcs gfx_v9_0_ip_funcs = {
74437471
.name = "gfx_v9_0",
74447472
.early_init = gfx_v9_0_early_init,
@@ -7615,8 +7643,8 @@ static const struct amdgpu_ring_funcs gfx_v9_0_ring_funcs_compute = {
76157643
.emit_wave_limit = gfx_v9_0_emit_wave_limit,
76167644
.reset = gfx_v9_0_reset_kcq,
76177645
.emit_cleaner_shader = gfx_v9_0_ring_emit_cleaner_shader,
7618-
.begin_use = amdgpu_gfx_enforce_isolation_ring_begin_use,
7619-
.end_use = amdgpu_gfx_enforce_isolation_ring_end_use,
7646+
.begin_use = gfx_v9_0_ring_begin_use_compute,
7647+
.end_use = gfx_v9_0_ring_end_use_compute,
76207648
};
76217649

76227650
static const struct amdgpu_ring_funcs gfx_v9_0_ring_funcs_kiq = {

0 commit comments

Comments
 (0)