[Mesa-dev] [PATCH 10/11 v3] add YUYV support to eglCreateImageKHR and eglCreateDRMImageMESA
Zhao Halley
halley.zhao at intel.com
Thu Jun 14 03:32:15 PDT 2012
---
include/EGL/eglmesaext.h | 3 +++
src/egl/drivers/dri2/egl_dri2.c | 9 ++++++++-
2 files changed, 11 insertions(+), 1 deletions(-)
mode change 100644 => 100755 include/EGL/eglext.h
mode change 100644 => 100755 include/EGL/eglmesaext.h
diff --git a/include/EGL/eglext.h b/include/EGL/eglext.h
old mode 100644
new mode 100755
diff --git a/include/EGL/eglmesaext.h b/include/EGL/eglmesaext.h
old mode 100644
new mode 100755
index 52dd5b1..cb251fd
--- a/include/EGL/eglmesaext.h
+++ b/include/EGL/eglmesaext.h
@@ -107,6 +107,9 @@ typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETDRMDISPLAYMESA) (int fd);
#ifndef EGL_DRM_BUFFER_USE_CURSOR_MESA
#define EGL_DRM_BUFFER_USE_CURSOR_MESA 0x0004
#endif
+#ifndef EGL_DRM_BUFFER_FORMAT_YUYV_MESA
+#define EGL_DRM_BUFFER_FORMAT_YUYV_MESA 0x31D6 /* EGL_DRM_BUFFER_FORMAT_MESA attribute value */
+#endif
#endif
#ifndef EGL_WL_bind_wayland_display
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index a058046..02eeafb 100755
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -1055,8 +1055,12 @@ dri2_create_image_mesa_drm_buffer(_EGLDisplay *disp, _EGLContext *ctx,
switch (attrs.DRMBufferFormatMESA) {
case EGL_DRM_BUFFER_FORMAT_ARGB32_MESA:
format = __DRI_IMAGE_FORMAT_ARGB8888;
- pitch = attrs.DRMBufferStrideMESA;
+ pitch = attrs.DRMBufferStrideMESA/4;
break;
+ case EGL_DRM_BUFFER_FORMAT_YUYV_MESA:
+ format = __DRI_IMAGE_FORMAT_YUYV;
+ pitch = attrs.DRMBufferStrideMESA/2;
+ break;
default:
_eglError(EGL_BAD_PARAMETER,
"dri2_create_image_khr: unsupported pixmap depth");
@@ -1195,6 +1199,9 @@ dri2_create_drm_image_mesa(_EGLDriver *drv, _EGLDisplay *disp,
case EGL_DRM_BUFFER_FORMAT_ARGB32_MESA:
format = __DRI_IMAGE_FORMAT_ARGB8888;
break;
+ case EGL_DRM_BUFFER_FORMAT_YUYV_MESA:
+ format = __DRI_IMAGE_FORMAT_YUYV;
+ break;
default:
_eglLog(_EGL_WARNING, "bad image format value 0x%04x",
attrs.DRMBufferFormatMESA);
--
1.7.5.4
More information about the mesa-dev
mailing list