Revert "drm/amd: flush any delayed gfxoff on suspend entry"
authorjsg <jsg@openbsd.org>
Sun, 25 Feb 2024 23:54:12 +0000 (23:54 +0000)
committerjsg <jsg@openbsd.org>
Sun, 25 Feb 2024 23:54:12 +0000 (23:54 +0000)
From Mario Limonciello
caa2565a2e13899be31f7b1e069e6465d3e2adb0 in linux-6.6.y/6.6.18
916361685319098f696b798ef1560f69ed96e934 in mainline linux

sys/dev/pci/drm/amd/amdgpu/amdgpu_device.c
sys/dev/pci/drm/amd/amdgpu/amdgpu_gfx.c

index 61a6748..7901aeb 100644 (file)
@@ -4249,7 +4249,6 @@ int amdgpu_device_suspend(struct drm_device *dev, bool fbcon)
                drm_fb_helper_set_suspend_unlocked(adev_to_drm(adev)->fb_helper, true);
 
        cancel_delayed_work_sync(&adev->delayed_init_work);
-       flush_delayed_work(&adev->gfx.gfx_off_delay_work);
 
        amdgpu_ras_suspend(adev);
 
index a31ed41..4355718 100644 (file)
@@ -704,8 +704,15 @@ void amdgpu_gfx_off_ctrl(struct amdgpu_device *adev, bool enable)
 
                if (adev->gfx.gfx_off_req_count == 0 &&
                    !adev->gfx.gfx_off_state) {
-                       schedule_delayed_work(&adev->gfx.gfx_off_delay_work,
+                       /* If going to s2idle, no need to wait */
+                       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) {