[PATCH 1/2] compositor-drm: don't put y-inverted / interlaced / bottom-first dmabufs on overlays
Pekka Paalanen
ppaalanen at gmail.com
Mon Feb 6 11:45:59 UTC 2017
On Wed, 1 Feb 2017 15:28:23 -0500
Micah Fedke <micah.fedke at collabora.co.uk> wrote:
> This patch checks the attribute flags on incoming dmabufs and refuses to
> put them overlays if they have any of the flags set (currently:
> ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_Y_INVERT,
> ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_INTERLACED and
> ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_BOTTOM_FIRST), instead defaulting to
> the gl-renderer which can handle some of the flags.
>
> This check should be superceded by buffer transforms, when they become
> available.
> ---
> libweston/compositor-drm.c | 14 +++++++++++++-
> 1 file changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c
> index 564e3244..a16136d3 100644
> --- a/libweston/compositor-drm.c
> +++ b/libweston/compositor-drm.c
> @@ -60,6 +60,7 @@
> #include "vaapi-recorder.h"
> #include "presentation-time-server-protocol.h"
> #include "linux-dmabuf.h"
> +#include "linux-dmabuf-unstable-v1-server-protocol.h"
>
> #ifndef DRM_CAP_TIMESTAMP_MONOTONIC
> #define DRM_CAP_TIMESTAMP_MONOTONIC 0x6
> @@ -1016,7 +1017,18 @@ drm_output_prepare_overlay_view(struct drm_output *output,
> .format = dmabuf->attributes.format
> };
>
> - if (dmabuf->attributes.n_planes != 1 || dmabuf->attributes.offset[0] != 0)
> + /* XXX: TODO:
> + *
> + * Currently the buffer is rejected if any dmabuf attribute
> + * flag is set. This keeps us from passing an inverted /
> + * interlaced / bottom-first buffer (or any other type that may
> + * be added in the future) through to an overlay. Ultimately,
> + * these types of buffers should be handled through buffer
> + * transforms and not as spot-checks requiring specific
> + * knowledge. */
> + if (dmabuf->attributes.n_planes != 1 ||
> + dmabuf->attributes.offset[0] != 0 ||
> + dmabuf->attributes.flags)
> return NULL;
>
> bo = gbm_bo_import(b->gbm, GBM_BO_IMPORT_FD, &gbm_dmabuf,
R-b me and pushed:
2779935..c889012 master -> master
Next time, please remember your S-o-b. :-)
Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 801 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20170206/04a7eb50/attachment.sig>
More information about the wayland-devel
mailing list