[PATCH 06/11] drm/amdgpu/gfx10: manually control gfxoff for CS

Alex Deucher alexander.deucher at amd.com
Mon Feb 3 21:43:43 UTC 2025


Manually disallow and then allow gfxoff in begin_use
and end_use to avoid any potential FW races when
ringing the doorbell.  There are no known issues
with gfxoff that this solves, but it shouldn't hurt anything
and shouldn't affect power usage since we are only
toggling it around the doorbell update.

Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
index 7b01828eea8dc..96346a19950b9 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
@@ -9826,14 +9826,14 @@ static void gfx_v10_0_ring_emit_cleaner_shader(struct amdgpu_ring *ring)
 static void gfx_v10_0_ring_begin_use(struct amdgpu_ring *ring)
 {
 	amdgpu_gfx_profile_ring_begin_use(ring);
-
 	amdgpu_gfx_enforce_isolation_ring_begin_use(ring);
+	amdgpu_gfx_off_ctrl_immediate(ring->adev, false);
 }
 
 static void gfx_v10_0_ring_end_use(struct amdgpu_ring *ring)
 {
+	amdgpu_gfx_off_ctrl_immediate(ring->adev, true);
 	amdgpu_gfx_profile_ring_end_use(ring);
-
 	amdgpu_gfx_enforce_isolation_ring_end_use(ring);
 }
 
-- 
2.48.1



More information about the amd-gfx mailing list