All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] drm: Basic mode sanity checks
@ 2014-12-17 11:56 ville.syrjala
  2014-12-17 11:56 ` [PATCH 1/3] drm: Reorganize probed mode validation ville.syrjala
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: ville.syrjala @ 2014-12-17 11:56 UTC (permalink / raw)
  To: dri-devel

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

We had a bug in i915 land recently where X passed in a zeroed mode with
mode_valid=1 to setcrtc. That didn't go down so well and caused a
div-by-zero in i915.

For a long time I've been thinking that we need some real checks to
validate the modes we feed into the hardware. I started to sketch out
something for that but it quickly turned into a bit of a nightmare
with the whole panel fitter, stereo 3D, SDVO etc. special cases we
have in i915.

So I gave up on that for now, and instead cooked up this small series
to add some basic sanity checks to the mode validation, and also apply
the same sanity checks to user provided modes. This is enough to
prevent the div-by-zero in i915 with buggy X.

The risk is that we start to reject some modes that more or less worked
by accident before. Given how lax we've been in handling the panel fitter
on i915 for instance, this could be a real problem if people have been
useing custom modes that have been filled out only partially. But I'm
hoping the number of users doing that is so small that we can risk it.

The other concern is drivers which might also provide funky modes from
their .get_modes(). I tried to look at all the drivers a bit, and most
produce modes via EDID, CVT, DMT, or drm_display_mode_from_videomode().
All of those look safe, except mode->clock might be an issue with
drm_display_mode_from_videomode(), but hopefully there's some kind of
clock provided in most cases. I didn't dig through all the nooks and
crannies in all drivers though, so may have missed something.

Ville Syrjälä (3):
  drm: Reorganize probed mode validation
  drm: Perform basic sanity checks on probed modes
  drm: Do basic sanity checks for user modes

 drivers/gpu/drm/drm_crtc.c         |  6 ++++
 drivers/gpu/drm/drm_modes.c        | 56 ++++++++++++++++++++++++++++++--------
 drivers/gpu/drm/drm_probe_helper.c | 43 ++++++++++++++---------------
 include/drm/drm_modes.h            |  6 ++--
 4 files changed, 74 insertions(+), 37 deletions(-)

-- 
2.0.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2014-12-19 16:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-17 11:56 [PATCH 0/3] drm: Basic mode sanity checks ville.syrjala
2014-12-17 11:56 ` [PATCH 1/3] drm: Reorganize probed mode validation ville.syrjala
2014-12-17 11:56 ` [PATCH 2/3] drm: Perform basic sanity checks on probed modes ville.syrjala
2014-12-17 11:56 ` [PATCH 3/3] drm: Do basic sanity checks for user modes ville.syrjala
2014-12-17 17:09 ` [PATCH 0/3] drm: Basic mode sanity checks Alex Deucher
2014-12-17 17:30   ` Daniel Vetter
2014-12-19 15:46     ` Adam Jackson
2014-12-19 16:54       ` Ville Syrjälä

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.