]> git.baikalelectronics.ru Git - kernel.git/commit
drm: Perform basic sanity checks on probed modes
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 17 Dec 2014 11:56:23 +0000 (13:56 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 17 Dec 2014 17:29:35 +0000 (18:29 +0100)
commitbde669fa3d1f79bb89521fb9d1739093c0af6664
tree37d56dd85aefc2ec4f297268b11242e3ddbf89fa
parentbc2a0b19f5510be091b550e9ace0b264dbf78621
drm: Perform basic sanity checks on probed modes

Make sure the timings of probed modes at least pass some very basic
sanity checks.

The checks include:
 - clock,hdisplay,vdisplay are non zero
 - sync pulse fits within the blanking period
 - htotal,vtotal are big enough

I have not checked all the drivers to see if the modes the generate
might violate these constraints. I'm hoping not, because that would mean
either abandoning the idea of doing this from the core code, or fixing
the drivers.

I'm not entirely sure about limiting the sync pulse to the blanking
period. Intel hardware doesn't support such things, but some other
hardware might. However at least HDMI doesn't allow having sync pulse
edges within the active period, so I'm thinking the check is probably
OK to have in the common code.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/drm_modes.c
drivers/gpu/drm/drm_probe_helper.c
include/drm/drm_modes.h