Skip to content

Commit 4ce4d5e

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 7d672fd commit 4ce4d5e

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

+30-2
Original file line numberDiff line numberDiff line change
@@ -7415,6 +7415,34 @@ static void gfx_v9_0_ring_emit_cleaner_shader(struct amdgpu_ring *ring)
74157415
amdgpu_ring_write(ring, 0); /* RESERVED field, programmed to zero */
74167416
}
74177417

7418+
static void gfx_v9_0_ring_begin_use_compute(struct amdgpu_ring *ring)
7419+
{
7420+
struct amdgpu_device *adev = ring->adev;
7421+
7422+
amdgpu_gfx_enforce_isolation_ring_begin_use(ring);
7423+
7424+
/* Raven and PCO APUs seem to have stability issues
7425+
* with compute and gfxoff and gfx pg. Disable gfx pg during
7426+
* submission and allow again afterwards.
7427+
*/
7428+
if (amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(9, 1, 0))
7429+
gfx_v9_0_set_powergating_state(adev, AMD_PG_STATE_UNGATE);
7430+
}
7431+
7432+
static void gfx_v9_0_ring_end_use_compute(struct amdgpu_ring *ring)
7433+
{
7434+
struct amdgpu_device *adev = ring->adev;
7435+
7436+
/* Raven and PCO APUs seem to have stability issues
7437+
* with compute and gfxoff and gfx pg. Disable gfx pg during
7438+
* submission and allow again afterwards.
7439+
*/
7440+
if (amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(9, 1, 0))
7441+
gfx_v9_0_set_powergating_state(adev, AMD_PG_STATE_GATE);
7442+
7443+
amdgpu_gfx_enforce_isolation_ring_end_use(ring);
7444+
}
7445+
74187446
static const struct amd_ip_funcs gfx_v9_0_ip_funcs = {
74197447
.name = "gfx_v9_0",
74207448
.early_init = gfx_v9_0_early_init,
@@ -7591,8 +7619,8 @@ static const struct amdgpu_ring_funcs gfx_v9_0_ring_funcs_compute = {
75917619
.emit_wave_limit = gfx_v9_0_emit_wave_limit,
75927620
.reset = gfx_v9_0_reset_kcq,
75937621
.emit_cleaner_shader = gfx_v9_0_ring_emit_cleaner_shader,
7594-
.begin_use = amdgpu_gfx_enforce_isolation_ring_begin_use,
7595-
.end_use = amdgpu_gfx_enforce_isolation_ring_end_use,
7622+
.begin_use = gfx_v9_0_ring_begin_use_compute,
7623+
.end_use = gfx_v9_0_ring_end_use_compute,
75967624
};
75977625

75987626
static const struct amdgpu_ring_funcs gfx_v9_0_ring_funcs_kiq = {

0 commit comments

Comments
 (0)