Re: [PATCH] drm/i915: Fix DPT suspend/resume on !HAS_DISPLAY platforms

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Nov 25, 2021 at 07:16:03PM +0200, Imre Deak wrote:
> The drm.mode_config state is not initialized in case of !HAS_DISPLAY
> so taking the fb_lock and iterating the fb list won't work on those
> platforms. Skip the suspend/resume with an explicit check for this.
> 
> Fixes: 9755f055f512 ("drm/i915: Restore memory mapping for DPT FBs across system suspend/resume")
> Cc: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> Cc: Ville Syrjala <ville.syrjala@xxxxxxxxxxxxxxx>
> Cc: Jani Nikula <jani.nikula@xxxxxxxxxxxxxxx>
> Signed-off-by: Imre Deak <imre.deak@xxxxxxxxx>

Reviewed-by: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>

> ---
>  drivers/gpu/drm/i915/display/intel_dpt.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_dpt.c b/drivers/gpu/drm/i915/display/intel_dpt.c
> index 56755788547d2..963ca7155b064 100644
> --- a/drivers/gpu/drm/i915/display/intel_dpt.c
> +++ b/drivers/gpu/drm/i915/display/intel_dpt.c
> @@ -183,6 +183,9 @@ void intel_dpt_resume(struct drm_i915_private *i915)
>  {
>  	struct drm_framebuffer *drm_fb;
>  
> +	if (!HAS_DISPLAY(i915))
> +		return;
> +
>  	mutex_lock(&i915->drm.mode_config.fb_lock);
>  	drm_for_each_fb(drm_fb, &i915->drm) {
>  		struct intel_framebuffer *fb = to_intel_framebuffer(drm_fb);
> @@ -207,6 +210,9 @@ void intel_dpt_suspend(struct drm_i915_private *i915)
>  {
>  	struct drm_framebuffer *drm_fb;
>  
> +	if (!HAS_DISPLAY(i915))
> +		return;
> +
>  	mutex_lock(&i915->drm.mode_config.fb_lock);
>  
>  	drm_for_each_fb(drm_fb, &i915->drm) {
> -- 
> 2.27.0

-- 
Ville Syrjälä
Intel



[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux