st/egl: Update to the new wl_shm_pool interface
authorBenjamin Franzke <benjaminfranzke@googlemail.com>
Tue, 3 Apr 2012 18:20:49 +0000 (20:20 +0200)
committerBenjamin Franzke <benjaminfranzke@googlemail.com>
Tue, 3 Apr 2012 18:28:20 +0000 (20:28 +0200)
src/gallium/state_trackers/egl/wayland/native_shm.c
src/gallium/winsys/sw/wayland/wayland_sw_winsys.c
src/gallium/winsys/sw/wayland/wayland_sw_winsys.h

index c2375788aac0eb3d536221c179824e200732304e..574ffce4b6658854e7cbafe558744f01a8adcca3 100644 (file)
@@ -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
index 1a31ada0296edbe67eda73424958920c75537623..331900e362d12610c5e3d695cc2762922ab02ba6 100644 (file)
@@ -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;
 }
index bedd2408f056df8841b93c7d8ee455889924b048..c7a0b5c1ddecb5dc92a91907db24e195ba3159c4 100644 (file)
@@ -32,6 +32,7 @@ struct wl_display;
 struct winsys_handle {
    int fd;
    unsigned stride;
+   unsigned size;
 };
 
 struct sw_winsys *