From 0de013b61930505bbeaf094d079b566df18a0cf7 Mon Sep 17 00:00:00 2001 From: Topi Pohjolainen Date: Fri, 22 Mar 2013 14:31:01 +0200 Subject: egl: definitions for EXT_image_dma_buf_import As specified in: http://www.khronos.org/registry/egl/extensions/EXT/EGL_EXT_image_dma_buf_import.txt Checking for the valid fourcc values is left for drivers avoiding dependency to drm header files here. v2: enforce EGL_NO_CONTEXT v3: declare the extension as EGL (not GLES) v4: do not update eglext.h manually but rely on update from Khronos instead v5: (Eric) report invalid context as EGL_BAD_PARAMETER instead of as EGL_BAD_CONTEXT v6: (Chad) fix the checking for valid hints. Before all values were rejected. v7: (Chad) comment style change from /** * Multi- * line into /* Multi- * line Signed-off-by: Topi Pohjolainen Reviewed-by: Chad Versace --- src/egl/main/eglapi.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/egl/main/eglapi.c') diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c index 4a9831bc7f1..96c9e06c4ab 100644 --- a/src/egl/main/eglapi.c +++ b/src/egl/main/eglapi.c @@ -1344,6 +1344,11 @@ eglCreateImageKHR(EGLDisplay dpy, EGLContext ctx, EGLenum target, RETURN_EGL_EVAL(disp, EGL_NO_IMAGE_KHR); if (!context && ctx != EGL_NO_CONTEXT) RETURN_EGL_ERROR(disp, EGL_BAD_CONTEXT, EGL_NO_IMAGE_KHR); + /* "If is EGL_LINUX_DMA_BUF_EXT, must be a valid display, + * must be EGL_NO_CONTEXT..." + */ + if (ctx != EGL_NO_CONTEXT && target == EGL_LINUX_DMA_BUF_EXT) + RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_NO_IMAGE_KHR); img = drv->API.CreateImageKHR(drv, disp, context, target, buffer, attr_list); -- cgit v1.2.3