diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2013-04-21 19:38:46 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2013-04-22 05:48:21 -0400 |
commit | 909d9cda2edfc61b8ec82e248eee3545b592e20d (patch) | |
tree | 253a10c2ee12c32820bddb29290757170aeee431 /drivers/gpu/drm/drm_crtc.c | |
parent | 64c026e28d68bf64b0a3c85e31d74c42a7cdecd3 (diff) |
drm: Don't allow page flip to change pixel format
A page flip is not a mode set, changing the frame buffer pixel format
doesn't make sense and isn't handled by most drivers anyway. Disallow
it.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/drm_crtc.c')
-rw-r--r-- | drivers/gpu/drm/drm_crtc.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 957fb70e8d0e..c577baec416f 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c | |||
@@ -3638,6 +3638,12 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev, | |||
3638 | goto out; | 3638 | goto out; |
3639 | } | 3639 | } |
3640 | 3640 | ||
3641 | if (crtc->fb->pixel_format != fb->pixel_format) { | ||
3642 | DRM_DEBUG_KMS("Page flip is not allowed to change frame buffer format.\n"); | ||
3643 | ret = -EINVAL; | ||
3644 | goto out; | ||
3645 | } | ||
3646 | |||
3641 | if (page_flip->flags & DRM_MODE_PAGE_FLIP_EVENT) { | 3647 | if (page_flip->flags & DRM_MODE_PAGE_FLIP_EVENT) { |
3642 | ret = -ENOMEM; | 3648 | ret = -ENOMEM; |
3643 | spin_lock_irqsave(&dev->event_lock, flags); | 3649 | spin_lock_irqsave(&dev->event_lock, flags); |