Skip to contentSkip to conversation

drm/amdgpu: complete gfxoff allow signal during suspend without delay

PATCH In review Harsh Jain 2 participants 2 messages Nov 7, 2022

Subsystems (2)
lore
Share & tools
lore

Harsh Jain

author
#0 lore raw

PATCH v3 1/1 drm/amdgpu: complete gfxoff allow signal during suspend without delay

change guarantees that gfxoff is allowed before moving further in s2idle sequence to add more reliablity about gfxoff in amdgpu IP's suspend flow

---

v2: replaced flush_work with direct call to amdgpu_dpm_set_powergating_by_smu and edited title
v3: added braces for readbility
---

drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +7 -3
index 9546adc8a76f..23692e5d4d13 100644
@@ -583,10 +583,14 @@ void amdgpu_gfx_off_ctrl(struct amdgpu_device *adev, bool enable)
 		if (adev->gfx.gfx_off_req_count == 0 &&
 		    !adev->gfx.gfx_off_state) {
 			/* If going to s2idle, no need to wait */
-			if (adev->in_s0ix)
-				delay = GFX_OFF_NO_DELAY;
-			schedule_delayed_work(&adev->gfx.gfx_off_delay_work,
+			if (adev->in_s0ix) {
+				if (!amdgpu_dpm_set_powergating_by_smu(adev,
+						AMD_IP_BLOCK_TYPE_GFX, true))
+					adev->gfx.gfx_off_state = true;
+			} else {
+				schedule_delayed_work(&adev->gfx.gfx_off_delay_work,
 					      delay);
+			}
 		}
 	} else {
 		if (adev->gfx.gfx_off_req_count == 0) {
Signature · 1 line
2.25.1
Reviewed-by on v3 1/1
#1 lore raw

[AMD Official Use Only - General]

Quoted 53 lines

-----Original Message-----
From: Jain, Harsh <[email protected]>
Sent: Monday, November 7, 2022 4:43 PM
To: Deucher, Alexander <[email protected]>; Quan, Evan <[email protected]>
Cc: [email protected]; Jain, Harsh <[email protected]>
Subject: [PATCH v3] drm/amdgpu: complete gfxoff allow signal during suspend without delay

change guarantees that gfxoff is allowed before moving further in s2idle sequence to add more reliablity about gfxoff in amdgpu IP's suspend flow

---

v2: replaced flush_work with direct call to
amdgpu_dpm_set_powergating_by_smu
and edited title
v3: added braces for readbility
---

drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +6 -3
index 9546adc8a76f..23692e5d4d13 100644
@@ -583,10 +583,14 @@ void amdgpu_gfx_off_ctrl(struct amdgpu_device
 *adev, bool enable)
 		if (adev->gfx.gfx_off_req_count == 0 &&
 		    !adev->gfx.gfx_off_state) {
 			/* If going to s2idle, no need to wait */
-			if (adev->in_s0ix)
-				delay = GFX_OFF_NO_DELAY;
-			schedule_delayed_work(&adev-
 >gfx.gfx_off_delay_work,
+			if (adev->in_s0ix) {
+				if
 (!amdgpu_dpm_set_powergating_by_smu(adev,
+						AMD_IP_BLOCK_TYPE_GFX,
 true))
+					adev->gfx.gfx_off_state = true;
+			} else {
+				schedule_delayed_work(&adev-
Quoted 1 line

gfx.gfx_off_delay_work,

drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +1 -1
 					      delay);
+			}
 		}
 	} else {
 		if (adev->gfx.gfx_off_req_count == 0) {
--

2.25.1