[PATCH] dmabuf: get supported dmabuf formats from compositor backend
Bryce Harrington
bryce at osg.samsung.com
Thu Oct 29 17:27:51 PDT 2015
On Tue, Oct 20, 2015 at 08:45:50AM -0700, Bryce Harrington wrote:
> On Tue, Oct 20, 2015 at 04:54:30PM +0200, Fabien Dessenne wrote:
> > Add the possibility for the compositor backend to provide with the list
> > of supported pixel formats for dmabuf-based buffers.
> > This information is used by linux_dmabuf to inform clients when binding.
> >
> > Signed-off-by: Fabien Dessenne <fabien.dessenne at st.com>
>
> Reviewed-by <bryce at osg.samsung.com>
>
> There's not a way to verify the list is getting sent across to the
> client is there?
Also, patch no longer applies since e3c0d8af.
I'd like to better understand what this is going to be used for, before
landing it. Another R-b on this would be nice as well; Giulio perhaps
you could give this patch a review?
Bryce
> Bryce
>
> > ---
> > src/compositor.h | 2 ++
> > src/linux-dmabuf.c | 16 +++++++++++++---
> > 2 files changed, 15 insertions(+), 3 deletions(-)
> >
> > diff --git a/src/compositor.h b/src/compositor.h
> > index 2e2a185..f58e0cc 100644
> > --- a/src/compositor.h
> > +++ b/src/compositor.h
> > @@ -613,6 +613,8 @@ enum weston_capability {
> > struct weston_backend {
> > void (*destroy)(struct weston_compositor *ec);
> > void (*restore)(struct weston_compositor *ec);
> > + void (*get_dmabuf_formats)(struct weston_compositor *ec,
> > + struct wl_array *formats);
> > };
> >
> > struct weston_compositor {
> > diff --git a/src/linux-dmabuf.c b/src/linux-dmabuf.c
> > index 90c9757..ee02ea4 100644
> > --- a/src/linux-dmabuf.c
> > +++ b/src/linux-dmabuf.c
> > @@ -433,9 +433,19 @@ bind_linux_dmabuf(struct wl_client *client,
> > wl_resource_set_implementation(resource, &linux_dmabuf_implementation,
> > compositor, NULL);
> >
> > - /* EGL_EXT_image_dma_buf_import does not provide a way to query the
> > - * supported pixel formats. */
> > - /* XXX: send formats */
> > + if (compositor->backend->get_dmabuf_formats) {
> > + struct wl_array dmabuf_formats;
> > + uint32_t *p;
> > +
> > + wl_array_init(&dmabuf_formats);
> > +
> > + compositor->backend->get_dmabuf_formats(compositor,
> > + &dmabuf_formats);
> > + wl_array_for_each(p, &dmabuf_formats)
> > + zlinux_dmabuf_send_format(resource, *p);
> > +
> > + wl_array_release(&dmabuf_formats);
> > + }
> > }
> >
> > /** Advertise linux_dmabuf support
> > --
> > 1.9.1
> >
> > _______________________________________________
> > wayland-devel mailing list
> > wayland-devel at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/wayland-devel
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
More information about the wayland-devel
mailing list