On Fri, May 29, 2026 at 02:03:54PM +0300, Jani Nikula wrote:
> The intel_display_driver_pm_suspend() calls are surrounded by near
> identical display calls. Move the calls inside
> intel_display_driver_pm_suspend().
> 
> There's a slight functional change in that
> intel_display_driver_pm_suspend() returns early for
> !HAS_DISPLAY(). Assume this is what we want, and there are no cases
> where display engine is present but all pipes have been fused off.
> 
> Signed-off-by: Jani Nikula <[email protected]>

Reviewed-by: Ville Syrjälä <[email protected]>

> ---
>  .../drm/i915/display/intel_display_driver.c   | 11 ++++++++++
>  drivers/gpu/drm/i915/i915_driver.c            |  9 --------
>  drivers/gpu/drm/xe/display/xe_display.c       | 22 ++-----------------
>  3 files changed, 13 insertions(+), 29 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display_driver.c 
> b/drivers/gpu/drm/i915/display/intel_display_driver.c
> index 9be4c94740dc..41a2244985fa 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_driver.c
> +++ b/drivers/gpu/drm/i915/display/intel_display_driver.c
> @@ -686,6 +686,17 @@ int intel_display_driver_pm_suspend(struct intel_display 
> *display)
>       if (!HAS_DISPLAY(display))
>               return 0;
>  
> +     /*
> +      * We do a lot of poking in a lot of registers, make sure they work
> +      * properly.
> +      */
> +     intel_display_power_disable(display);
> +
> +     drm_client_dev_suspend(display->drm);
> +
> +     drm_kms_helper_poll_disable(display->drm);
> +     intel_display_driver_disable_user_access(display);
> +
>       state = drm_atomic_helper_suspend(display->drm);
>       ret = PTR_ERR_OR_ZERO(state);
>       if (ret)
> diff --git a/drivers/gpu/drm/i915/i915_driver.c 
> b/drivers/gpu/drm/i915/i915_driver.c
> index bd73d64c1ccb..f161723f653e 100644
> --- a/drivers/gpu/drm/i915/i915_driver.c
> +++ b/drivers/gpu/drm/i915/i915_driver.c
> @@ -1130,15 +1130,6 @@ static int i915_drm_suspend(struct drm_device *dev)
>  
>       disable_rpm_wakeref_asserts(&dev_priv->runtime_pm);
>  
> -     /* We do a lot of poking in a lot of registers, make sure they work
> -      * properly. */
> -     intel_display_power_disable(display);
> -     drm_client_dev_suspend(dev);
> -     if (intel_display_device_present(display)) {
> -             drm_kms_helper_poll_disable(dev);
> -             intel_display_driver_disable_user_access(display);
> -     }
> -
>       intel_display_driver_pm_suspend(display);
>  
>       intel_encoder_block_all_hpds(display);
> diff --git a/drivers/gpu/drm/xe/display/xe_display.c 
> b/drivers/gpu/drm/xe/display/xe_display.c
> index 38ebcc2b712a..027db7b6ceb5 100644
> --- a/drivers/gpu/drm/xe/display/xe_display.c
> +++ b/drivers/gpu/drm/xe/display/xe_display.c
> @@ -198,14 +198,7 @@ void xe_display_shutdown(struct xe_device *xe)
>       if (!xe->info.probe_display)
>               return;
>  
> -     intel_display_power_disable(display);
> -     drm_client_dev_suspend(&xe->drm);
> -
> -     if (intel_display_device_present(display)) {
> -             drm_kms_helper_poll_disable(&xe->drm);
> -             intel_display_driver_disable_user_access(display);
> -             intel_display_driver_pm_suspend(display);
> -     }
> +     intel_display_driver_pm_suspend(display);
>  
>       intel_encoder_block_all_hpds(display);
>       intel_hpd_cancel_work(display);
> @@ -297,18 +290,7 @@ void xe_display_pm_suspend(struct xe_device *xe)
>       if (!xe->info.probe_display)
>               return;
>  
> -     /*
> -      * We do a lot of poking in a lot of registers, make sure they work
> -      * properly.
> -      */
> -     intel_display_power_disable(display);
> -     drm_client_dev_suspend(&xe->drm);
> -
> -     if (intel_display_device_present(display)) {
> -             drm_kms_helper_poll_disable(&xe->drm);
> -             intel_display_driver_disable_user_access(display);
> -             intel_display_driver_pm_suspend(display);
> -     }
> +     intel_display_driver_pm_suspend(display);
>  
>       intel_encoder_block_all_hpds(display);
>  
> -- 
> 2.47.3

-- 
Ville Syrjälä
Intel

Reply via email to