[PATCH] dmabuf: get supported dmabuf formats from compositor backend
Giulio Camuffo
giuliocamuffo at gmail.com
Fri Oct 30 00:49:20 PDT 2015
2015-10-30 2:27 GMT+02:00 Bryce Harrington <bryce at osg.samsung.com>:
> 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?
I'm not sure i understand this question.
>
> 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?
Well, it doesn't apply because we now have a new vfunc in
weston_backend, but rebasing it should be trivial.
>
> 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) {
Can the formats change in the compositor lifetime? If not, it may be
better to ask for them once and store the result instead of asking for
each new client.
>> > + 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