drm/xe/display: Extract xe_display_pm_runtime_suspend_late()
authorGustavo Sousa <gustavo.sousa@intel.com>
Fri, 29 Nov 2024 16:37:55 +0000 (13:37 -0300)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Sat, 30 Nov 2024 17:07:30 +0000 (12:07 -0500)
The current behavior for the runtime suspend case is that
xe_display_pm_suspend_late() is only called when D3cold is allowed.
Let's incorporate that behavior into a function specific to runtime PM
and call it xe_display_pm_runtime_suspend_late().

With that, we keep stuff a bit more self-contained and allow having a
place for adding more "late display runtime suspend"-related logic that
isn't dependent on the "D3cold allowed" state.

v2:
  - Fix typo in that caused xe_display_pm_runtime_suspend_late() to call
    itself instead of xe_display_pm_suspend_late().
  - Add the empty version of xe_display_pm_runtime_suspend_late() for
    the !CONFIG_DRM_XE_DISPLAY case.

Signed-off-by: Gustavo Sousa <gustavo.sousa@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241129164010.29887-3-gustavo.sousa@intel.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/display/xe_display.c
drivers/gpu/drm/xe/display/xe_display.h
drivers/gpu/drm/xe/xe_pm.c

index 760847959bc1037b7151400b4be24e0805c47edd..5696ef49f30376137044330e9f6516c910ea0980 100644 (file)
@@ -402,6 +402,15 @@ void xe_display_pm_suspend_late(struct xe_device *xe)
        intel_display_power_suspend_late(xe, s2idle);
 }
 
+void xe_display_pm_runtime_suspend_late(struct xe_device *xe)
+{
+       if (!xe->info.probe_display)
+               return;
+
+       if (xe->d3cold.allowed)
+               xe_display_pm_suspend_late(xe);
+}
+
 void xe_display_pm_shutdown_late(struct xe_device *xe)
 {
        if (!xe->info.probe_display)
index 17afa537aee50882de91a059a18c4e93bd256084..233f81a26c25563c237b98c4fb12c7fcc309eed5 100644 (file)
@@ -41,6 +41,7 @@ void xe_display_pm_shutdown_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_resume(struct xe_device *xe);
 
 #else
@@ -74,6 +75,7 @@ static inline void xe_display_pm_shutdown_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_resume(struct xe_device *xe) {}
 
 #endif /* CONFIG_DRM_XE_DISPLAY */
index 40f7c844ed44ae4f9422766793a9e047058f2549..96f3e16a5b7d07e13129c960694abff3f2e8def8 100644 (file)
@@ -414,8 +414,8 @@ int xe_pm_runtime_suspend(struct xe_device *xe)
 
        xe_irq_suspend(xe);
 
-       if (xe->d3cold.allowed)
-               xe_display_pm_suspend_late(xe);
+       xe_display_pm_runtime_suspend_late(xe);
+
 out:
        if (err)
                xe_display_pm_runtime_resume(xe);