diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-12-08 11:49:20 +0300 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2016-01-05 12:07:51 +0300 |
commit | 4cba68507cf58db99752cf79198beb4a85a9f8ce (patch) | |
tree | ce0e53f48983a7414baedc51df01a284908fe7e6 /drivers/gpu/drm/drm_atomic_helper.c | |
parent | 4cd9fa529d77dde8f760adb3d934dfac6e169b1e (diff) | |
download | linux-4cba68507cf58db99752cf79198beb4a85a9f8ce.tar.xz |
drm/atomic-helper: Reject legacy flips on a disabled pipe
We want this for consistency with existing page_flip semantics.
Since this spurred quite a discussion on IRC also document why we
reject event generation when the pipe is off: It's not that it's hard
to implement, but userspace has a track recording which proves that it's
way too easy to accidentally abuse and cause havoc. We want to make
sure userspace doesn't get away with that.
v2: Somehow thought we do reject events already, but that code only
existed in my imagination ... Also suggestions from Thierry.
Cc: Daniel Stone <daniels@collabora.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1449564561-3896-4-git-send-email-daniel.vetter@ffwll.ch
Diffstat (limited to 'drivers/gpu/drm/drm_atomic_helper.c')
-rw-r--r-- | drivers/gpu/drm/drm_atomic_helper.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index 26d258d0618b..738104b68d26 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -2284,6 +2284,15 @@ retry: goto fail; drm_atomic_set_fb_for_plane(plane_state, fb); + /* Make sure we don't accidentally do a full modeset. */ + state->allow_modeset = false; + if (!crtc_state->active) { + DRM_DEBUG_ATOMIC("[CRTC:%d] disabled, rejecting legacy flip\n", + crtc->base.id); + ret = -EINVAL; + goto fail; + } + ret = drm_atomic_async_commit(state); if (ret != 0) goto fail; |