dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH] drm: Add new fb flags to pass interlaced alternate field
@ 2018-09-24 18:54 Satish Kumar Nagireddy
  2018-10-01  7:19 ` Daniel Vetter
  0 siblings, 1 reply; 2+ messages in thread
From: Satish Kumar Nagireddy @ 2018-09-24 18:54 UTC (permalink / raw)
  To: dri-devel@lists.freedesktop.org

This patch adds two new framebuffer flags, so that application can
communicate alternate interlaced field information to DRM.

This patch also modifies the validation of framebuffer flags in DRM
core framework. This is to ensure that application is setting the
right framebuffer flags.

Signed-off-by: Satish Kumar Nagireddy <satish.nagireddy.nagireddy@xilinx.com>
---
 drivers/gpu/drm/drm_framebuffer.c | 3 ++-
 include/uapi/drm/drm_mode.h       | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gpu/drm/drm_framebuffer.c
index 28a0108..d330256 100644
--- a/drivers/gpu/drm/drm_framebuffer.c
+++ b/drivers/gpu/drm/drm_framebuffer.c
@@ -241,7 +241,8 @@ drm_internal_framebuffer_create(struct drm_device *dev,
        struct drm_framebuffer *fb;
        int ret;

-       if (r->flags & ~(DRM_MODE_FB_INTERLACED | DRM_MODE_FB_MODIFIERS)) {
+       if (r->flags & ~(DRM_MODE_FB_INTERLACED | DRM_MODE_FB_MODIFIERS |
+               DRM_MODE_FB_ALTERNATE_TOP | DRM_MODE_FB_ALTERNATE_BOTTOM)) {
                DRM_DEBUG_KMS("bad framebuffer flags 0x%08x\n", r->flags);
                return ERR_PTR(-EINVAL);
        }
diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h
index ce7efe2..b857ed4 100644
--- a/include/uapi/drm/drm_mode.h
+++ b/include/uapi/drm/drm_mode.h
@@ -388,6 +388,8 @@ struct drm_mode_fb_cmd {

 #define DRM_MODE_FB_INTERLACED (1<<0) /* for interlaced framebuffers */
 #define DRM_MODE_FB_MODIFIERS  (1<<1) /* enables ->modifer[] */
+#define DRM_MODE_FB_ALTERNATE_TOP      (1<<2) /* for alternate top field */
+#define DRM_MODE_FB_ALTERNATE_BOTTOM   (1<<3) /* for alternate bottom field */

 struct drm_mode_fb_cmd2 {
        __u32 fb_id;
--
2.7.4
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-10-01  7:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-24 18:54 [RFC PATCH] drm: Add new fb flags to pass interlaced alternate field Satish Kumar Nagireddy
2018-10-01  7:19 ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox