summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2023-08-24 06:19:21 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2023-08-24 06:19:21 +0000
commit351bfdc5fe70b2f7bc710489dfc4725b02c8b179 (patch)
tree731055080a5182d9bf9306e2f5c18be1303deffa /sys
parent44a049d6df3a6f08b96c69cc76e780d7d4ba5cc1 (diff)
drm/amd: flush any delayed gfxoff on suspend entry
From Mario Limonciello e1cbd5637f37e7facfd38d19cda4a36a85780613 in linux-6.1.y/6.1.47 a7b7d9e8aee4f71b4c7151702fd74237b8cef989 in mainline linux
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/drm/amd/amdgpu/amdgpu_device.c1
-rw-r--r--sys/dev/pci/drm/amd/amdgpu/amdgpu_gfx.c9
2 files changed, 2 insertions, 8 deletions
diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_device.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_device.c
index 73fa47c34f7..8bad65c85d4 100644
--- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_device.c
+++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_device.c
@@ -4354,6 +4354,7 @@ 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);
diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_gfx.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_gfx.c
index df5255c4a00..18578db215f 100644
--- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_gfx.c
+++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_gfx.c
@@ -587,15 +587,8 @@ 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) {
- 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,
+ schedule_delayed_work(&adev->gfx.gfx_off_delay_work,
delay);
- }
}
} else {
if (adev->gfx.gfx_off_req_count == 0) {