summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2025-09-19 21:50:14 +0300
committerVille Syrjälä <ville.syrjala@linux.intel.com>2025-09-22 19:34:53 +0300
commit3a3d9cb0b18df22d0d6466e3eca45cd0ad2ddbc8 (patch)
tree3457160cc972121662acd63782a376ba7e58a9c5 /drivers/gpu
parent03a37f5c3a169bea3c25b1e07e632cd0ddbcf302 (diff)
downloadlinux-3a3d9cb0b18df22d0d6466e3eca45cd0ad2ddbc8.tar.gz
linux-3a3d9cb0b18df22d0d6466e3eca45cd0ad2ddbc8.zip
drm/i915/pm: Allow drivers/pci to manage our pci state normally
Stop doing the pci_save_state(), except when we need to prevent D3 due to BIOS bugs, so that the code in drivers/pci is allowed to manage the state of the PCI device. Less chance something getting left by the wayside by i915 if/when the things change in drivers/pci. Cc: Badal Nilawar <badal.nilawar@intel.com> Reviewed-by: Jouni Högander <jouni.hogander@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250919185015.14561-6-ville.syrjala@linux.intel.com
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/i915/i915_driver.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c
index 009f4e27cf49..0cb874e64971 100644
--- a/drivers/gpu/drm/i915/i915_driver.c
+++ b/drivers/gpu/drm/i915/i915_driver.c
@@ -1162,9 +1162,8 @@ static int i915_drm_suspend_noirq(struct drm_device *dev, bool hibernation)
* pci_save_state() prevents drivers/pci from
* automagically putting the device into D3.
*/
- pci_save_state(pdev);
- if (!(hibernation && GRAPHICS_VER(dev_priv) < 6))
- pci_set_power_state(pdev, PCI_D3hot);
+ if (hibernation && GRAPHICS_VER(dev_priv) < 6)
+ pci_save_state(pdev);
return 0;
}
@@ -1172,6 +1171,7 @@ static int i915_drm_suspend_noirq(struct drm_device *dev, bool hibernation)
int i915_driver_suspend_switcheroo(struct drm_i915_private *i915,
pm_message_t state)
{
+ struct pci_dev *pdev = to_pci_dev(i915->drm.dev);
int error;
if (drm_WARN_ON_ONCE(&i915->drm, state.event != PM_EVENT_SUSPEND &&
@@ -1189,9 +1189,8 @@ int i915_driver_suspend_switcheroo(struct drm_i915_private *i915,
if (error)
return error;
- error = i915_drm_suspend_noirq(&i915->drm, false);
- if (error)
- return error;
+ pci_save_state(pdev);
+ pci_set_power_state(pdev, PCI_D3hot);
return 0;
}