[PATCH weston] gl-renderer: Ignore INVALID modifier
Pekka Paalanen
ppaalanen at gmail.com
Thu Oct 5 07:15:05 UTC 2017
On Wed, 4 Oct 2017 18:35:45 +0100
Daniel Stone <daniels at collabora.com> wrote:
> If the user has passed an INVALID modifier, it's because there is no
> applicable modifier, and the buffer layout should be determined by a
> magic side-channel call (e.g. bo_get_tiling). If the modifier is
> INVALID, don't try to pass it through to EGL, but just drop it.
>
> On the other hand, if a modifier _is_ explicitly specified and we don't
> have the modifiers extension, then refuse to import the buffer.
>
> Signed-off-by: Daniel Stone <daniels at collabora.com>
> ---
> libweston/gl-renderer.c | 15 ++++++++++++---
> 1 file changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c
> index 5749aa71..244ce309 100644
> --- a/libweston/gl-renderer.c
> +++ b/libweston/gl-renderer.c
> @@ -1735,6 +1735,7 @@ import_simple_dmabuf(struct gl_renderer *gr,
> struct egl_image *image;
> EGLint attribs[50];
> int atti = 0;
> + bool has_modifier;
>
> /* This requires the Mesa commit in
> * Mesa 10.3 (08264e5dad4df448e7718e782ad9077902089a07) or
> @@ -1751,6 +1752,14 @@ import_simple_dmabuf(struct gl_renderer *gr,
> attribs[atti++] = EGL_LINUX_DRM_FOURCC_EXT;
> attribs[atti++] = attributes->format;
>
> + if (attributes->modifier[0] != DRM_FORMAT_MOD_INVALID) {
> + if (!gr->has_dmabuf_import_modifiers)
> + return NULL;
> + has_modifier = true;
> + } else {
> + has_modifier = false;
> + }
> +
gl_renderer_import_dmabuf() guarantees that all modifiers are equal,
hence checking only one is enough.
Reviewed-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20171005/cdfac85b/attachment.sig>
More information about the wayland-devel
mailing list