From 662b2bcb84d5782aff1b93732eb010b0b43e5706 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Tue, 22 Sep 2020 09:54:15 +0200 Subject: [PATCH] xwayland: Use the pixmap release callback with EGLStream MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit 77658741 - "xwayland: Add buffer release callback" added an API to deal with Wayland buffer release callbacks. The EGLstream implementation has its own wl_buffer callback, move that to the buffer release API instead so we don't have to deal with Wayland buffers directly and match the other Xwayland pixmap backend implementations. Signed-off-by: Olivier Fourdan Reviewed-by: Michel Dänzer Tested-by: Erik Kurzinger --- hw/xwayland/xwayland-glamor-eglstream.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hw/xwayland/xwayland-glamor-eglstream.c b/hw/xwayland/xwayland-glamor-eglstream.c index 06cc1ad2a..0bbffd50b 100644 --- a/hw/xwayland/xwayland-glamor-eglstream.c +++ b/hw/xwayland/xwayland-glamor-eglstream.c @@ -465,14 +465,14 @@ xwl_eglstream_queue_pending_stream(struct xwl_screen *xwl_screen, } static void -xwl_eglstream_buffer_release_callback(void *data, struct wl_buffer *wl_buffer) +xwl_eglstream_buffer_release_callback(void *data) { /* drop the reference we took in post_damage, freeing if necessary */ dixDestroyPixmap(data, 0); } static const struct wl_buffer_listener xwl_eglstream_buffer_release_listener = { - xwl_eglstream_buffer_release_callback + xwl_pixmap_buffer_release_cb, }; static void @@ -511,6 +511,10 @@ xwl_eglstream_create_pending_stream(struct xwl_screen *xwl_screen, &xwl_eglstream_buffer_release_listener, pixmap); + xwl_pixmap_set_buffer_release_cb(pixmap, + xwl_eglstream_buffer_release_callback, + pixmap); + wl_eglstream_controller_attach_eglstream_consumer( xwl_eglstream->controller, xwl_window->surface, xwl_pixmap->buffer);