summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/egl/drivers/dri2/egl_dri2.c21
-rw-r--r--src/egl/main/eglapi.c2
2 files changed, 22 insertions, 1 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 864f7eb0c6..90c7d191f1 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -2136,7 +2136,15 @@ 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;
+ break;
+ case EGL_DRM_BUFFER_FORMAT_ARGB2101010_MESA:
+ format = __DRI_IMAGE_FORMAT_ARGB2101010;
+ break;
+ case EGL_DRM_BUFFER_FORMAT_ARGB1555_MESA:
+ format = __DRI_IMAGE_FORMAT_ARGB1555;
+ break;
+ case EGL_DRM_BUFFER_FORMAT_RGB565_MESA:
+ format = __DRI_IMAGE_FORMAT_RGB565;
break;
default:
_eglError(EGL_BAD_PARAMETER,
@@ -2144,6 +2152,8 @@ dri2_create_image_mesa_drm_buffer(_EGLDisplay *disp, _EGLContext *ctx,
return NULL;
}
+ pitch = attrs.DRMBufferStrideMESA;
+
dri_image =
dri2_dpy->image->createImageFromName(dri2_dpy->dri_screen,
attrs.Width,
@@ -2528,6 +2538,15 @@ 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_ARGB2101010_MESA:
+ format = __DRI_IMAGE_FORMAT_ARGB2101010;
+ break;
+ case EGL_DRM_BUFFER_FORMAT_ARGB1555_MESA:
+ format = __DRI_IMAGE_FORMAT_ARGB1555;
+ break;
+ case EGL_DRM_BUFFER_FORMAT_RGB565_MESA:
+ format = __DRI_IMAGE_FORMAT_RGB565;
+ break;
default:
_eglError(EGL_BAD_PARAMETER, __func__);
return EGL_NO_IMAGE_KHR;
diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c
index c110349119..ee85864515 100644
--- a/src/egl/main/eglapi.c
+++ b/src/egl/main/eglapi.c
@@ -521,6 +521,8 @@ _eglCreateExtensionsString(_EGLDisplay *dpy)
if (dpy->Extensions.KHR_no_config_context)
_eglAppendExtension(&exts, "EGL_MESA_configless_context");
_EGL_CHECK_EXTENSION(MESA_drm_image);
+ if (dpy->Extensions.MESA_drm_image)
+ _eglAppendExtension(&exts, "EGL_MESA_drm_image_formats");
_EGL_CHECK_EXTENSION(MESA_image_dma_buf_export);
_EGL_CHECK_EXTENSION(NOK_swap_region);