[Mesa-dev] [PATCH 3/5] wayland: support EGL_TEXTURE_STRUCTURE_WL queries for wl_buffer.
Gwenole Beauchesne
gwenole.beauchesne at intel.com
Mon Jul 30 09:45:17 PDT 2012
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne at intel.com>
---
include/EGL/eglmesaext.h | 5 +++++
src/egl/drivers/dri2/egl_dri2.c | 15 +++++++++++++++
2 files changed, 20 insertions(+)
diff --git a/include/EGL/eglmesaext.h b/include/EGL/eglmesaext.h
index d476d18..d08ba09 100644
--- a/include/EGL/eglmesaext.h
+++ b/include/EGL/eglmesaext.h
@@ -115,6 +115,11 @@ typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETDRMDISPLAYMESA) (int fd);
#define EGL_WAYLAND_BUFFER_WL 0x31D5 /* eglCreateImageKHR target */
#define EGL_WAYLAND_PLANE_WL 0x31D6 /* eglCreateImageKHR target */
+#define EGL_TEXTURE_STRUCTURE_WL 0x31DA /* eglCreateImageKHR target */
+#define EGL_TEXTURE_STRUCTURE_FRAME_WL 0x0000
+#define EGL_TEXTURE_STRUCTURE_TOP_FIELD_WL 0x0001
+#define EGL_TEXTURE_STRUCTURE_BOTTOM_FIELD_WL 0x0002
+
#define EGL_TEXTURE_Y_U_V_WL 0x31D7
#define EGL_TEXTURE_Y_UV_WL 0x31D8
#define EGL_TEXTURE_Y_XUXV_WL 0x31D9
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 4ae2856..738c51c 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -1437,6 +1437,21 @@ dri2_query_wayland_buffer_wl(_EGLDriver *drv, _EGLDisplay *disp,
case EGL_TEXTURE_FORMAT:
*value = format->components;
return EGL_TRUE;
+ case EGL_TEXTURE_STRUCTURE_WL:
+ switch (buffer->picture_structure) {
+ case WL_DRM_PICTURE_STRUCTURE_FRAME:
+ *value = EGL_TEXTURE_STRUCTURE_FRAME_WL;
+ break;
+ case WL_DRM_PICTURE_STRUCTURE_TOP_FIELD:
+ *value = EGL_TEXTURE_STRUCTURE_TOP_FIELD_WL;
+ break;
+ case WL_DRM_PICTURE_STRUCTURE_BOTTOM_FIELD:
+ *value = EGL_TEXTURE_STRUCTURE_BOTTOM_FIELD_WL;
+ break;
+ default:
+ return EGL_FALSE;
+ }
+ return EGL_TRUE;
case EGL_WIDTH:
*value = buffer->buffer.width;
break;
--
1.7.9.5
More information about the mesa-dev
mailing list