[5/8] drm: set power_state to DRM_SWITCH_POWER_CHANGING before changing

Submitted by Karol Herbst on Sept. 23, 2019, 8:39 p.m.

Details

Message ID 20190923203951.1652-6-kherbst@redhat.com
State New
Headers show
Series "Add workaround for fixing runpm" ( rev: 2 ) in Nouveau

Not browsing as part of any series.

Commit Message

Karol Herbst Sept. 23, 2019, 8:39 p.m.
---
 drm/nouveau/nouveau_drm.c | 2 ++
 1 file changed, 2 insertions(+)

Patch hide | download patch | download mbox

diff --git a/drm/nouveau/nouveau_drm.c b/drm/nouveau/nouveau_drm.c
index 3d32afe8a..466271c0c 100644
--- a/drm/nouveau/nouveau_drm.c
+++ b/drm/nouveau/nouveau_drm.c
@@ -917,6 +917,7 @@  nouveau_pmops_runtime_suspend(struct device *dev)
 		return -EBUSY;
 	}
 
+	drm_dev->switch_power_state = DRM_SWITCH_POWER_CHANGING;
 	nouveau_switcheroo_optimus_dsm();
 	ret = nouveau_do_suspend(drm_dev, true);
 	pci_save_state(pdev);
@@ -941,6 +942,7 @@  nouveau_pmops_runtime_resume(struct device *dev)
 		return -EBUSY;
 	}
 
+	drm_dev->switch_power_state = DRM_SWITCH_POWER_CHANGING;
 	pci_set_power_state(pdev, PCI_D0);
 	pci_restore_state(pdev);
 	ret = pci_enable_device(pdev);