summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorImre Deak <imre.deak@intel.com>2021-11-25 20:16:03 +0300
committerImre Deak <imre.deak@intel.com>2021-11-29 23:21:29 +0300
commit74ba89c08e309bfeb2b2f401bf588ab54a1542fe (patch)
tree59bb85395f8b1f063a468f5a71c33958a71d2779 /drivers/gpu/drm
parent86c82c8aeebf6db5df8ab73cec8333853c405070 (diff)
downloadlinux-74ba89c08e309bfeb2b2f401bf588ab54a1542fe.tar.xz
drm/i915: Fix DPT suspend/resume on !HAS_DISPLAY platforms
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@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
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/i915/display/intel_dpt.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_dpt.c b/drivers/gpu/drm/i915/display/intel_dpt.c
index 56755788547d..963ca7155b06 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) {