Skip to content

Commit

Permalink
drm/i915: Fix DPT suspend/resume on !HAS_DISPLAY platforms
Browse files Browse the repository at this point in the history
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: 9755f05 ("drm/i915: Restore memory mapping for DPT FBs across system suspend/resume")
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211125171603.1775179-1-imre.deak@intel.com
  • Loading branch information
Imre Deak committed Nov 29, 2021
1 parent 86c82c8 commit 74ba89c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/gpu/drm/i915/display/intel_dpt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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) {
Expand Down

0 comments on commit 74ba89c

Please sign in to comment.