diff options
author | Ander Conselvan de Oliveira <[email protected]> | 2013-07-18 15:11:25 +0300 |
---|---|---|
committer | Kristian Høgsberg <[email protected]> | 2013-08-07 10:37:58 -0700 |
commit | 8d29b5271a2e66fc78436be31ed6748ff006f0cb (patch) | |
tree | b8a28a8c8fe46f04decaf3229a936c1bff110a80 /src/egl/drivers/dri2 | |
parent | 602351dd58c11af072f706e41ff1a204dac26a86 (diff) |
egl: Update to Wayland 1.2 server API
Since Wayland 1.2, struct wl_buffer and a few functions are deprecated.
References to wl_buffer are replaced with wl_resource and some getter
functions and calls to deprecated functions are replaced with the proper
new API. The latter changes are related to resource versioning.
Signed-off-by: Ander Conselvan de Oliveira <[email protected]>
Diffstat (limited to 'src/egl/drivers/dri2')
-rw-r--r-- | src/egl/drivers/dri2/egl_dri2.c | 28 | ||||
-rw-r--r-- | src/egl/drivers/dri2/egl_dri2.h | 1 |
2 files changed, 17 insertions, 12 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index 81ae271bb55..04ab5649e52 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -42,6 +42,10 @@ #include "egl_dri2.h" +#ifdef HAVE_WAYLAND_PLATFORM +#include "wayland-drm.h" +#endif + const __DRIuseInvalidateExtension use_invalidate = { { __DRI_USE_INVALIDATE, 1 } }; @@ -1200,7 +1204,7 @@ dri2_create_image_wayland_wl_buffer(_EGLDisplay *disp, _EGLContext *ctx, EGLClientBuffer _buffer, const EGLint *attr_list) { - struct wl_drm_buffer *buffer = (struct wl_drm_buffer *) _buffer; + struct wl_drm_buffer *buffer; struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp); const struct wl_drm_components_descriptor *f; __DRIimage *dri_image; @@ -1208,7 +1212,8 @@ dri2_create_image_wayland_wl_buffer(_EGLDisplay *disp, _EGLContext *ctx, EGLint err; int32_t plane; - if (!wayland_buffer_is_drm(&buffer->buffer)) + buffer = wayland_drm_buffer_get((struct wl_resource *) _buffer); + if (!buffer) return NULL; err = _eglParseImageAttribList(&attrs, disp, attr_list); @@ -1770,8 +1775,8 @@ dri2_wl_reference_buffer(void *user_data, uint32_t name, int fd, if (fd == -1) img = dri2_dpy->image->createImageFromNames(dri2_dpy->dri_screen, - buffer->buffer.width, - buffer->buffer.height, + buffer->width, + buffer->height, buffer->format, (int*)&name, 1, buffer->stride, @@ -1779,8 +1784,8 @@ dri2_wl_reference_buffer(void *user_data, uint32_t name, int fd, NULL); else img = dri2_dpy->image->createImageFromFds(dri2_dpy->dri_screen, - buffer->buffer.width, - buffer->buffer.height, + buffer->width, + buffer->height, buffer->format, &fd, 1, buffer->stride, @@ -1869,13 +1874,14 @@ dri2_unbind_wayland_display_wl(_EGLDriver *drv, _EGLDisplay *disp, static EGLBoolean dri2_query_wayland_buffer_wl(_EGLDriver *drv, _EGLDisplay *disp, - struct wl_buffer *_buffer, + struct wl_resource *buffer_resource, EGLint attribute, EGLint *value) { - struct wl_drm_buffer *buffer = (struct wl_drm_buffer *) _buffer; + struct wl_drm_buffer *buffer; const struct wl_drm_components_descriptor *format; - if (!wayland_buffer_is_drm(&buffer->buffer)) + buffer = wayland_drm_buffer_get(buffer_resource); + if (!buffer) return EGL_FALSE; format = buffer->driver_format; @@ -1884,10 +1890,10 @@ dri2_query_wayland_buffer_wl(_EGLDriver *drv, _EGLDisplay *disp, *value = format->components; return EGL_TRUE; case EGL_WIDTH: - *value = buffer->buffer.width; + *value = buffer->width; return EGL_TRUE; case EGL_HEIGHT: - *value = buffer->buffer.height; + *value = buffer->height; return EGL_TRUE; } diff --git a/src/egl/drivers/dri2/egl_dri2.h b/src/egl/drivers/dri2/egl_dri2.h index 6dfdf946fc8..fba5f81af8c 100644 --- a/src/egl/drivers/dri2/egl_dri2.h +++ b/src/egl/drivers/dri2/egl_dri2.h @@ -37,7 +37,6 @@ #ifdef HAVE_WAYLAND_PLATFORM #include <wayland-client.h> -#include "wayland-drm.h" #include "wayland-egl-priv.h" #endif |