diff mbox series

[RFC] drm: Add new fb flags to pass interlaced alternate field information

Message ID 1537814613-18017-1-git-send-email-satish.nagireddy.nagireddy@xilinx.com (mailing list archive)
State New, archived
Headers show
Series [RFC] drm: Add new fb flags to pass interlaced alternate field information | expand

Commit Message

Satish Kumar Nagireddy Sept. 24, 2018, 6:43 p.m. UTC
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(-)

Comments

Satish Kumar Nagireddy Sept. 26, 2018, 1:35 a.m. UTC | #1
Hi Ville Syrjälä, Daniel Vetter, Daniel Stone,

Thanks a lot for your suggestions on my previous patch.
https://patchwork.kernel.org/patch/10593641/
https://www.spinics.net/lists/dri-devel/msg190054.html
Could you please take a look at this patch and let me know your comments?

This patch will allow application to pass field flag to DRM. This would be more useful in use cases like
"capture -> display" and "decode -> display". The reason is capture device may drop fields and also decoder also
may fail to decode if a field is corrupted.

Regards,
Satish

> -----Original Message-----
> From: Satish Kumar Nagireddy [mailto:satish.nagireddy.nagireddy@xilinx.com]
> Sent: Monday, September 24, 2018 11:44 AM
> To: dri-devel@lists.freedesktop.org
> Cc: Satish Kumar Nagireddy <SATISHNA@xilinx.com>
> Subject: [RFC PATCH] drm: Add new fb flags to pass interlaced alternate field
> information
> 
> 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
diff mbox series

Patch

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;