summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2023-02-02 04:05:09 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2023-02-02 04:05:09 +0000
commit11007ad404595ae28d06491d2d57b3d9ba23c8f4 (patch)
treeb5f5daf88df63c666e7557fb3ad84da748fb64c3
parent72c9ec0152a4c79cba2eff48c642db3760d9ac14 (diff)
drm/amdgpu: complete gfxoff allow signal during suspend without delay
From Harsh Jain 3964b0c2e843334858da99db881859faa4df241d in linux-6.1.y/6.1.9 4b31b92b143f7d209f3d494c56d4c4673e9fc53d in mainline linux
-rw-r--r--sys/dev/pci/drm/amd/amdgpu/amdgpu_gfx.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_gfx.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_gfx.c
index 9a4a97121d9..aacff489489 100644
--- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_gfx.c
+++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_gfx.c
@@ -588,10 +588,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) {