[PATCH 1/2] drm: Don't allow page flip to change pixel format
Singh, Satyeshwar
satyeshwar.singh at intel.com
Thu May 31 12:44:54 PDT 2012
Does this by extension mean that stride changes should also not be allowed while page flipping?
Thanks,
Satyeshwar
-----Original Message-----
From: dri-devel-bounces+satyeshwar.singh=intel.com at lists.freedesktop.org [mailto:dri-devel-bounces+satyeshwar.singh=intel.com at lists.freedesktop.org] On Behalf Of Laurent Pinchart
Sent: Thursday, May 31, 2012 9:26 AM
To: dri-devel at lists.freedesktop.org
Subject: [PATCH 1/2] 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 at ideasonboard.com>
---
drivers/gpu/drm/drm_crtc.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 92cea9d..0d15b56 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -3530,6 +3530,14 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev,
goto out;
}
+ if (crtc->fb->pixel_format != fb->pixel_format ||
+ crtc->fb->bits_per_pixel != crtc->fb->bits_per_pixel ||
+ crtc->fb->depth != fb->depth) {
+ 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);
--
1.7.3.4
_______________________________________________
dri-devel mailing list
dri-devel at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
More information about the dri-devel
mailing list