From 9ba3cecaa02eba07bc6456c441126e4e2e823da5 Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Tue, 3 Apr 2012 20:20:49 +0200 Subject: [PATCH] st/egl: Update to the new wl_shm_pool interface --- src/gallium/state_trackers/egl/wayland/native_shm.c | 11 ++++++++--- src/gallium/winsys/sw/wayland/wayland_sw_winsys.c | 1 + src/gallium/winsys/sw/wayland/wayland_sw_winsys.h | 1 + 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/gallium/state_trackers/egl/wayland/native_shm.c b/src/gallium/state_trackers/egl/wayland/native_shm.c index c2375788aac..574ffce4b66 100644 --- a/src/gallium/state_trackers/egl/wayland/native_shm.c +++ b/src/gallium/state_trackers/egl/wayland/native_shm.c @@ -84,6 +84,8 @@ wayland_create_shm_buffer(struct wayland_display *display, struct winsys_handle wsh; uint width, height; enum wl_shm_format format; + struct wl_buffer *buffer; + struct wl_shm_pool *pool; resource = resource_surface_get_single_resource(surface->rsurf, attachment); resource_surface_get_size(surface->rsurf, &width, &height); @@ -104,9 +106,12 @@ wayland_create_shm_buffer(struct wayland_display *display, break; } - return wl_shm_create_buffer(shmdpy->wl_shm, wsh.fd, - width, height, - wsh.stride, format); + pool = wl_shm_create_pool(shmdpy->wl_shm, wsh.fd, wsh.size); + buffer = wl_shm_pool_create_buffer(pool, 0, width, height, + wsh.stride, format); + wl_shm_pool_destroy(pool); + + return buffer; } static void diff --git a/src/gallium/winsys/sw/wayland/wayland_sw_winsys.c b/src/gallium/winsys/sw/wayland/wayland_sw_winsys.c index 1a31ada0296..331900e362d 100644 --- a/src/gallium/winsys/sw/wayland/wayland_sw_winsys.c +++ b/src/gallium/winsys/sw/wayland/wayland_sw_winsys.c @@ -243,6 +243,7 @@ wayland_displaytarget_get_handle(struct sw_winsys *ws, whandle->fd = wldt->fd; whandle->stride = wldt->stride; + whandle->size = wldt->size; return TRUE; } diff --git a/src/gallium/winsys/sw/wayland/wayland_sw_winsys.h b/src/gallium/winsys/sw/wayland/wayland_sw_winsys.h index bedd2408f05..c7a0b5c1dde 100644 --- a/src/gallium/winsys/sw/wayland/wayland_sw_winsys.h +++ b/src/gallium/winsys/sw/wayland/wayland_sw_winsys.h @@ -32,6 +32,7 @@ struct wl_display; struct winsys_handle { int fd; unsigned stride; + unsigned size; }; struct sw_winsys * -- 2.30.2