All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/i915: add sanity checks for hsync and htotal
@ 2012-06-20 20:15 Jani Nikula
  2012-06-20 20:15 ` [PATCH 2/2] drm/i915: Cantiga+ cannot handle a hsync front porch of 0 Jani Nikula
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Jani Nikula @ 2012-06-20 20:15 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula

Restrict hsync start, end, hdisplay and htotal to be according to hw
spec. Through drm_mode_set_crtcinfo(), these will also limit hblank start,
end.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>

---

Let's see if this will be frowned upon... seems better to have these
separate from the follow-up workaround patch, which addresses a specific hw
constraint.

Embarrassingly, I have to acknowledge I didn't test this. I seem to have
trouble with creating an initrd that would tackle the disk encryption that
I have on this laptop I'm currently restricted to. *sigh*.
---
 drivers/gpu/drm/i915/intel_display.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 9730162..ada736d 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -3420,6 +3420,11 @@ static bool intel_crtc_mode_fixup(struct drm_crtc *crtc,
 	if (!(adjusted_mode->private_flags & INTEL_MODE_CRTC_TIMINGS_SET))
 		drm_mode_set_crtcinfo(adjusted_mode, 0);
 
+	if (adjusted_mode->hsync_start < adjusted_mode->hdisplay ||
+		adjusted_mode->hsync_end > adjusted_mode->htotal ||
+		adjusted_mode->hsync_start >= adjusted_mode->hsync_end)
+		return false;
+
 	return true;
 }
 
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-08-22 15:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-20 20:15 [PATCH 1/2] drm/i915: add sanity checks for hsync and htotal Jani Nikula
2012-06-20 20:15 ` [PATCH 2/2] drm/i915: Cantiga+ cannot handle a hsync front porch of 0 Jani Nikula
2012-06-20 21:36 ` [PATCH 1/2] drm/i915: add sanity checks for hsync and htotal Adam Jackson
2012-06-21  7:33   ` Jani Nikula
2012-06-21 10:19 ` [PATCH v2] drm/i915: Cantiga+ cannot handle a hsync front porch of 0 Jani Nikula
2012-06-21 12:16   ` Ville Syrjälä
2012-08-22 15:39   ` Daniel Vetter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.