]> git.baikalelectronics.ru Git - kernel.git/commit
drm/modes: Provide global mode_valid hook
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 14 Nov 2017 18:32:57 +0000 (20:32 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 29 Jan 2018 19:51:51 +0000 (21:51 +0200)
commit15b7d64d6704cf77edeb7db2e7348dfdeda40069
treedd77ee71b0813434e34d971aeaa1a64251a24545
parent5517ad173adcf24f6c3fba8cdf84da1fd6a34013
drm/modes: Provide global mode_valid hook

Allow drivers to provide a device wide .mode_valid() hook in addition to
the already existing crtc/encoder/bridge/connector hooks. This can be
used to validate device/driver wide constraings without having to add
those to the other hooks. And since we call this hook also for user
modes later on in the modeset we don't have to worry about anything the
hook has already rejected.

I also have some further ideas for this hook. Eg. we could replace the
drm_mode_set_crtcinfo(HALVE_V) call in drm_mode_convert_umode()/etc.
with a driver specific variant via this hook. At least on i915 we would
like to pass CRTC_STEREO_DOUBLE to that function instead, and then
we could safely use the crtc_ timings in all our .mode_valid() hooks,
which would allow us to reuse those hooks for validating the
adjusted_mode during a modeset.

v2: Fix the language fails in the kernel docs (Daniel)

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171114183258.16976-10-ville.syrjala@linux.intel.com
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/drm_atomic.c
drivers/gpu/drm/drm_crtc.c
drivers/gpu/drm/drm_modes.c
drivers/gpu/drm/drm_probe_helper.c
include/drm/drm_mode_config.h
include/drm/drm_modes.h