[RFC weston] gl-renderer: make use of linux_dmabuf_buffer_get_user_data()

Emil Velikov emil.l.velikov at gmail.com
Thu Feb 15 18:51:50 UTC 2018


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.

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, ...(?)
---
 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);
 }
-- 
2.16.0



More information about the wayland-devel mailing list