If the device is PME capable, we don't need to start the HPD polling during the runtime suspend. So to differentiate, plumb pme_capable flag which is set to true only if the platform supports PME and the device is PME capable. In i915, this is set to false. But for xe it will be set based on the PME capability. Until the PME capability support is added, this flag hard coded to false. Also cases like D3Cold where PME is not supported, this is set to false by default.
Assisted-by: GitHub_Copilot:claude-opus-5 Signed-off-by: Vinod Govindapillai <[email protected]> --- drivers/gpu/drm/i915/display/intel_display_driver.c | 3 ++- drivers/gpu/drm/i915/display/intel_display_driver.h | 3 ++- drivers/gpu/drm/i915/i915_driver.c | 2 +- drivers/gpu/drm/xe/display/xe_display.c | 4 ++-- drivers/gpu/drm/xe/display/xe_display.h | 4 ++-- drivers/gpu/drm/xe/xe_pci.c | 2 +- drivers/gpu/drm/xe/xe_pm.c | 7 ++++--- drivers/gpu/drm/xe/xe_pm.h | 2 +- 8 files changed, 15 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display_driver.c b/drivers/gpu/drm/i915/display/intel_display_driver.c index 70d112fd4287..ba494827c9cb 100644 --- a/drivers/gpu/drm/i915/display/intel_display_driver.c +++ b/drivers/gpu/drm/i915/display/intel_display_driver.c @@ -904,7 +904,8 @@ void intel_display_driver_pm_runtime_suspend(struct intel_display *display) } /* after irq suspend */ -void intel_display_driver_pm_runtime_suspend_late(struct intel_display *display) +void intel_display_driver_pm_runtime_suspend_late(struct intel_display *display, + bool pme_capable) { intel_display_power_runtime_suspend(display); diff --git a/drivers/gpu/drm/i915/display/intel_display_driver.h b/drivers/gpu/drm/i915/display/intel_display_driver.h index 1ae2ad7e95f6..a8bc663bb840 100644 --- a/drivers/gpu/drm/i915/display/intel_display_driver.h +++ b/drivers/gpu/drm/i915/display/intel_display_driver.h @@ -47,7 +47,8 @@ void intel_display_driver_runtime_pm_enable(struct intel_display *display); void intel_display_driver_runtime_pm_disable(struct intel_display *display); void intel_display_driver_pm_runtime_suspend(struct intel_display *display); -void intel_display_driver_pm_runtime_suspend_late(struct intel_display *display); +void intel_display_driver_pm_runtime_suspend_late(struct intel_display *display, + bool pme_capable); void intel_display_driver_pm_runtime_resume_early(struct intel_display *display); void intel_display_driver_pm_runtime_resume(struct intel_display *display); diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c index ce6d20958320..2899683c6b0b 100644 --- a/drivers/gpu/drm/i915/i915_driver.c +++ b/drivers/gpu/drm/i915/i915_driver.c @@ -1518,7 +1518,7 @@ static int i915_pm_runtime_suspend(struct device *kdev) for_each_gt(gt, dev_priv, i) intel_uncore_suspend(gt->uncore); - intel_display_driver_pm_runtime_suspend_late(display); + intel_display_driver_pm_runtime_suspend_late(display, false); ret = vlv_suspend_complete(dev_priv); if (ret) { diff --git a/drivers/gpu/drm/xe/display/xe_display.c b/drivers/gpu/drm/xe/display/xe_display.c index 6f1f8e0b25b5..16085b85444f 100644 --- a/drivers/gpu/drm/xe/display/xe_display.c +++ b/drivers/gpu/drm/xe/display/xe_display.c @@ -362,7 +362,7 @@ void xe_display_pm_runtime_suspend(struct xe_device *xe) } /* after irq suspend */ -void xe_display_pm_runtime_suspend_late(struct xe_device *xe) +void xe_display_pm_runtime_suspend_late(struct xe_device *xe, bool pme_capable) { struct intel_display *display = xe->display; @@ -376,7 +376,7 @@ void xe_display_pm_runtime_suspend_late(struct xe_device *xe) return; } - intel_display_driver_pm_runtime_suspend_late(display); + intel_display_driver_pm_runtime_suspend_late(display, pme_capable); } /* before irq resume */ diff --git a/drivers/gpu/drm/xe/display/xe_display.h b/drivers/gpu/drm/xe/display/xe_display.h index 19f313eba6fb..636b3768d882 100644 --- a/drivers/gpu/drm/xe/display/xe_display.h +++ b/drivers/gpu/drm/xe/display/xe_display.h @@ -42,7 +42,7 @@ void xe_display_pm_suspend_late(struct xe_device *xe); void xe_display_pm_resume_early(struct xe_device *xe); void xe_display_pm_resume(struct xe_device *xe); void xe_display_pm_runtime_suspend(struct xe_device *xe); -void xe_display_pm_runtime_suspend_late(struct xe_device *xe); +void xe_display_pm_runtime_suspend_late(struct xe_device *xe, bool pme_capable); void xe_display_pm_runtime_resume_early(struct xe_device *xe); void xe_display_pm_runtime_resume(struct xe_device *xe); @@ -80,7 +80,7 @@ static inline void xe_display_pm_suspend_late(struct xe_device *xe) {} static inline void xe_display_pm_resume_early(struct xe_device *xe) {} static inline void xe_display_pm_resume(struct xe_device *xe) {} static inline void xe_display_pm_runtime_suspend(struct xe_device *xe) {} -static inline void xe_display_pm_runtime_suspend_late(struct xe_device *xe) {} +static inline void xe_display_pm_runtime_suspend_late(struct xe_device *xe, bool pme_capable) {} static inline void xe_display_pm_runtime_resume_early(struct xe_device *xe) {} static inline void xe_display_pm_runtime_resume(struct xe_device *xe) {} diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c index ab4da1d9a9f1..c22b40045f7b 100644 --- a/drivers/gpu/drm/xe/xe_pci.c +++ b/drivers/gpu/drm/xe/xe_pci.c @@ -1392,7 +1392,7 @@ static int xe_pci_runtime_suspend(struct device *dev) xe_assert(xe, !IS_SRIOV_VF(xe)); xe_assert(xe, !pci_num_vf(pdev)); - err = xe_pm_runtime_suspend(xe); + err = xe_pm_runtime_suspend(xe, false); if (err) return err; diff --git a/drivers/gpu/drm/xe/xe_pm.c b/drivers/gpu/drm/xe/xe_pm.c index 1488c4dfcc05..c3a53c5f8b33 100644 --- a/drivers/gpu/drm/xe/xe_pm.c +++ b/drivers/gpu/drm/xe/xe_pm.c @@ -574,10 +574,11 @@ bool xe_pm_runtime_suspended(struct xe_device *xe) /** * xe_pm_runtime_suspend - Prepare our device for D3hot/D3Cold * @xe: xe device instance + * @pme_capable: indicates if the device can raise PME from runtime D3hot. * * Returns 0 for success, negative error code otherwise. */ -int xe_pm_runtime_suspend(struct xe_device *xe) +int xe_pm_runtime_suspend(struct xe_device *xe, bool pme_capable) { struct xe_bo *bo, *on; struct xe_gt *gt; @@ -639,9 +640,9 @@ int xe_pm_runtime_suspend(struct xe_device *xe) goto out_resume; } - xe_irq_suspend(xe, false); + xe_irq_suspend(xe, pme_capable); - xe_display_pm_runtime_suspend_late(xe); + xe_display_pm_runtime_suspend_late(xe, pme_capable); xe_i2c_pm_suspend(xe); diff --git a/drivers/gpu/drm/xe/xe_pm.h b/drivers/gpu/drm/xe/xe_pm.h index 6d5ab09cb769..27455a8d2061 100644 --- a/drivers/gpu/drm/xe/xe_pm.h +++ b/drivers/gpu/drm/xe/xe_pm.h @@ -21,7 +21,7 @@ int xe_pm_probe(struct xe_device *xe); int xe_pm_init(struct xe_device *xe); void xe_pm_fini(struct xe_device *xe); bool xe_pm_runtime_suspended(struct xe_device *xe); -int xe_pm_runtime_suspend(struct xe_device *xe); +int xe_pm_runtime_suspend(struct xe_device *xe, bool pme_capable); int xe_pm_runtime_resume(struct xe_device *xe); void xe_pm_runtime_get(struct xe_device *xe); int xe_pm_runtime_get_ioctl(struct xe_device *xe); -- 2.43.0
