From a4a831c814a88fe05ad253a74d259acc009812c3 Mon Sep 17 00:00:00 2001 From: jsg Date: Thu, 2 Feb 2023 04:05:08 +0000 Subject: [PATCH] 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 --- sys/dev/pci/drm/amd/amdgpu/amdgpu_gfx.c | 10 +++++++--- 1 file 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) { -- 2.20.1