drm/amdgpu: complete gfxoff allow signal during suspend without delay
authorjsg <jsg@openbsd.org>
Thu, 2 Feb 2023 04:05:08 +0000 (04:05 +0000)
committerjsg <jsg@openbsd.org>
Thu, 2 Feb 2023 04:05:08 +0000 (04:05 +0000)
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

index 9a4a971..aacff48 100644 (file)
@@ -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) {