* [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
* Re: [RFC PATCH] drm: Add new fb flags to pass interlaced alternate field
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
0 siblings, 0 replies; 2+ messages in thread
From: Daniel Vetter @ 2018-10-01 7:19 UTC (permalink / raw)
To: Satish Kumar Nagireddy; +Cc: dri-devel@lists.freedesktop.org
On Mon, Sep 24, 2018 at 06:54:02PM +0000, Satish Kumar Nagireddy wrote:
> 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>
Yeah as a draft this seems more reasonable. What we now need is fleshing
out the full stack:
- Full kernel-side implementation, including driver code.
- igt testcase to validate all the corner-cases, e.g. how exactly does
this interact with FB_INTERLACED? What happens if the client fails to
supply the next field?
- Userspace compositor/app driving this. See
https://dri.freedesktop.org/docs/drm/gpu/drm-uapi.html#open-source-userspace-requirements
for full details.
Cheers, Daniel
> ---
> 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
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [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