Skip to content

Commit

Permalink
drm: Don't allow page flip to change pixel format
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Laurent Pinchart authored and Dave Airlie committed Apr 22, 2013
1 parent 64c026e commit 909d9cd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/gpu/drm/drm_crtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -3638,6 +3638,12 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev,
goto out;
}

if (crtc->fb->pixel_format != fb->pixel_format) {
DRM_DEBUG_KMS("Page flip is not allowed to change frame buffer format.\n");
ret = -EINVAL;
goto out;
}

if (page_flip->flags & DRM_MODE_PAGE_FLIP_EVENT) {
ret = -ENOMEM;
spin_lock_irqsave(&dev->event_lock, flags);
Expand Down

0 comments on commit 909d9cd

Please sign in to comment.