[RFC weston] gl-renderer: make use of linux_dmabuf_buffer_get_user_data()
Pekka Paalanen
ppaalanen at gmail.com
Fri Feb 16 08:23:56 UTC 2018
On Thu, 15 Feb 2018 18:51:50 +0000
Emil Velikov <emil.l.velikov at gmail.com> wrote:
> From: Emil Velikov <emil.velikov at collabora.com>
>
> ... to get the user_data. Like everywhere else through weston.
>
> Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
> ---
> Some ancient patch, that I had locally.
>
Hi Emil,
that's a good change, pushed:
8b964bca..2d8331c4 master -> master
> It should be fine to land as-is, although it brings an interesting
> question - should one keep struct linux_dmabuf_buffer private or not?
>
> - No - the get/set user data accessors seem (sort of) pointless
> - Yes - one would need extra accessor for ::attributes, ...(?)
I would agree on making struct linux_dmabuf_buffer private to
linux-dmabuf.c, and letting struct dmabuf_attributes be "public" API,
and add a getter for 'const struct dmabuf_attributes *'.
From libweston point of view the whole linux-dmabuf.h is private API,
because we don't support external-project renderers or backends for the
time being. The header is also not installed. Unfortunately avoiding the
WL_EXPORTs in linux-dmabuf.c is inconvenient, because we need the
backend and renderer plugins to be able to access them.
This "not actually libweston public ABI, but must still export for our
own plugins" is a recurring issue throughout libweston.
Thanks,
pq
> ---
> libweston/gl-renderer.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c
> index d091d165..d3ed4a10 100644
> --- a/libweston/gl-renderer.c
> +++ b/libweston/gl-renderer.c
> @@ -1748,7 +1748,7 @@ gl_renderer_attach_egl(struct weston_surface *es, struct weston_buffer *buffer,
> static void
> gl_renderer_destroy_dmabuf(struct linux_dmabuf_buffer *dmabuf)
> {
> - struct dmabuf_image *image = dmabuf->user_data;
> + struct dmabuf_image *image = linux_dmabuf_buffer_get_user_data(dmabuf);
>
> dmabuf_image_destroy(image);
> }
-------------- 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/20180216/c1d99bf6/attachment.sig>
More information about the wayland-devel
mailing list