[Mesa-dev] [PATCH v2 8/8] egl_dri2: Set content type for wl_buffer

Kristian Høgsberg krh at bitplanet.net
Mon Jul 9 14:03:54 PDT 2012


This lets the compositor know about the structure of the wl_buffer, namely
which planes and components are available and in which order.
---
 src/egl/drivers/dri2/egl_dri2.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index d003a9e..05a5cea 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -1337,18 +1337,23 @@ dri2_wl_reference_buffer(void *user_data, uint32_t name,
    switch (buffer->format) {
    case WL_DRM_FORMAT_ARGB8888:
       buffer->driver_format =__DRI_IMAGE_FORMAT_ARGB8888;
+      buffer->buffer.content = WL_BUFFER_CONTENT_RGBA;
       break;
    case WL_DRM_FORMAT_XRGB8888:
       buffer->driver_format = __DRI_IMAGE_FORMAT_XRGB8888;
+      buffer->buffer.content = WL_BUFFER_CONTENT_RGB;
       break;
    case WL_DRM_FORMAT_YUV420:
       buffer->driver_format =__DRI_IMAGE_FORMAT_NONE;
+      buffer->buffer.content = WL_BUFFER_CONTENT_Y_U_V;
       break;
    case WL_DRM_FORMAT_NV12:
       buffer->driver_format = __DRI_IMAGE_FORMAT_NONE;
+      buffer->buffer.content = WL_BUFFER_CONTENT_Y_UV;
       break;
    case WL_DRM_FORMAT_YUYV:
       buffer->driver_format = __DRI_IMAGE_FORMAT_NONE;
+      buffer->buffer.content = WL_BUFFER_CONTENT_Y_XUXV;
       break;
    default:
       return;
-- 
1.7.10.2



More information about the mesa-dev mailing list