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

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

 



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@xxxxxxxxx>
Cc: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
Signed-off-by: Matt Roper <matthew.d.roper@xxxxxxxxx>
---
 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

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




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

  Powered by Linux