]> www.infradead.org Git - linux.git/commitdiff
drm/xe/display: Separate the d3cold and non-d3cold runtime PM handling
authorImre Deak <imre.deak@intel.com>
Wed, 9 Oct 2024 19:43:57 +0000 (22:43 +0300)
committerImre Deak <imre.deak@intel.com>
Fri, 11 Oct 2024 14:00:57 +0000 (17:00 +0300)
For clarity separate the d3cold and non-d3cold runtime PM handling. The
only change in behavior is disabling polling later during runtime
resume. This shouldn't make a difference, since the poll disabling is
handled from a work, which could run at any point wrt. the runtime
resume handler. The work will also require a runtime PM reference,
syncing it with the resume handler.

Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241009194358.1321200-4-imre.deak@intel.com
drivers/gpu/drm/xe/display/xe_display.c

index 26b2cae11d46de98c98107d1c0249d3a929aaf7e..9ef75a20c3c08f8894c6dddc1e6c0204d369969a 100644 (file)
@@ -341,6 +341,9 @@ static void __xe_display_pm_suspend(struct xe_device *xe, bool runtime)
        intel_opregion_suspend(display, s2idle ? PCI_D1 : PCI_D3cold);
 
        intel_dmc_suspend(xe);
+
+       if (runtime && has_display(xe))
+               intel_hpd_poll_enable(xe);
 }
 
 void xe_display_pm_suspend(struct xe_device *xe)
@@ -383,8 +386,10 @@ void xe_display_pm_runtime_suspend(struct xe_device *xe)
        if (!xe->info.probe_display)
                return;
 
-       if (xe->d3cold.allowed)
+       if (xe->d3cold.allowed) {
                __xe_display_pm_suspend(xe, true);
+               return;
+       }
 
        intel_hpd_poll_enable(xe);
 }
@@ -447,9 +452,11 @@ static void __xe_display_pm_resume(struct xe_device *xe, bool runtime)
                intel_display_driver_resume(xe);
                drm_kms_helper_poll_enable(&xe->drm);
                intel_display_driver_enable_user_access(xe);
-               intel_hpd_poll_disable(xe);
        }
 
+       if (has_display(xe))
+               intel_hpd_poll_disable(xe);
+
        intel_opregion_resume(display);
 
        intel_fbdev_set_suspend(&xe->drm, FBINFO_STATE_RUNNING, false);
@@ -467,10 +474,12 @@ void xe_display_pm_runtime_resume(struct xe_device *xe)
        if (!xe->info.probe_display)
                return;
 
-       intel_hpd_poll_disable(xe);
-
-       if (xe->d3cold.allowed)
+       if (xe->d3cold.allowed) {
                __xe_display_pm_resume(xe, true);
+               return;
+       }
+
+       intel_hpd_poll_disable(xe);
 }