diff options
author | Kristian Høgsberg <[email protected]> | 2012-07-05 14:19:48 -0400 |
---|---|---|
committer | Kristian Høgsberg <[email protected]> | 2012-07-11 15:28:35 -0400 |
commit | 379eb47ea61c87c9ac071fa6d93e49ae3f02ac2c (patch) | |
tree | 0edd148ee5870f6dae465edb0d4908c8326e2c16 /src/egl/drivers | |
parent | 95bc0527e9f81c62cbfe02dace94e73d9950d04d (diff) |
wayland-drm: Pass struct wl_drm_buffer to the driver
We're going to extend this to support multi-plane buffers, so pass this
to the driver so it can access the details.
Diffstat (limited to 'src/egl/drivers')
-rw-r--r-- | src/egl/drivers/dri2/egl_dri2.c | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index e2dee798d60..bb30e699fe4 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -1220,43 +1220,40 @@ dri2_export_drm_image_mesa(_EGLDriver *drv, _EGLDisplay *disp, _EGLImage *img, #ifdef HAVE_WAYLAND_PLATFORM -static void * +static void dri2_wl_reference_buffer(void *user_data, uint32_t name, - int32_t width, int32_t height, - uint32_t stride, uint32_t format) + struct wl_drm_buffer *buffer) { _EGLDisplay *disp = user_data; struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp); - __DRIimage *image; - int dri_format; - switch (format) { + switch (buffer->format) { case WL_DRM_FORMAT_ARGB8888: - dri_format =__DRI_IMAGE_FORMAT_ARGB8888; + buffer->driver_format =__DRI_IMAGE_FORMAT_ARGB8888; break; case WL_DRM_FORMAT_XRGB8888: - dri_format = __DRI_IMAGE_FORMAT_XRGB8888; + buffer->driver_format = __DRI_IMAGE_FORMAT_XRGB8888; break; default: - return NULL; + return; } - image = dri2_dpy->image->createImageFromName(dri2_dpy->dri_screen, - width, height, - dri_format, name, stride / 4, - NULL); - - return image; + buffer->driver_buffer = + dri2_dpy->image->createImageFromName(dri2_dpy->dri_screen, + buffer->buffer.width, + buffer->buffer.height, + buffer->driver_format, name, + buffer->stride0 / 4, + NULL); } static void -dri2_wl_release_buffer(void *user_data, void *buffer) +dri2_wl_release_buffer(void *user_data, struct wl_drm_buffer *buffer) { _EGLDisplay *disp = user_data; - __DRIimage *image = buffer; struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp); - dri2_dpy->image->destroyImage(image); + dri2_dpy->image->destroyImage(buffer->driver_buffer); } static struct wayland_drm_callbacks wl_drm_callbacks = { |