[Intel-gfx] [PATCH] drm/i915: Don't try to check max stride for disabled/non-existent display

Matt Roper matthew.d.roper at intel.com
Mon Aug 10 18:08:51 UTC 2020


Userspace may still create GEM dumb buffers even on platforms with
disabled or non-existent display.  When creating dumb buffers we try to
check the max fb stride for the platform by looking at the first pipe on
the platform.  We previously fixed a crash related to accessing the
non-existent PIPE_A in commit 8ac495f624a4 ("drm/i915: Don't oops in
dumb_create ioctl if we have no crtcs") but the crash is back as of
commit eae3da27ba84 ("drm/i915: Get first crtc instead of PIPE_A crtc")
because we now try to iterate over the [uninitialized] crtc list.

Fixes: eae3da27ba84 ("drm/i915: Get first crtc instead of PIPE_A crtc")
Cc: Anshuman Gupta <anshuman.gupta at intel.com>
Cc: Ville Syrjälä <ville.syrjala at linux.intel.com>
Signed-off-by: Matt Roper <matthew.d.roper at intel.com>
---
 drivers/gpu/drm/i915/display/intel_display.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 522c772a2111..47839bafcfe6 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -2723,6 +2723,9 @@ u32 intel_plane_fb_max_stride(struct drm_i915_private *dev_priv,
 	struct intel_crtc *crtc;
 	struct intel_plane *plane;
 
+	if (!HAS_DISPLAY(dev_priv) || !INTEL_DISPLAY_ENABLED(dev_priv))
+		return 0;
+
 	/*
 	 * We assume the primary plane for pipe A has
 	 * the highest stride limits of them all,
-- 
2.24.1



More information about the Intel-gfx mailing list