EGL_KHR_image_pixmap says:
> If <target> is EGL_NATIVE_PIXMAP_KHR, and <ctx> is not EGL_NO_CONTEXT,
> the error EGL_BAD_PARAMETER is generated.
Reported-by: Rohan Garg <rohan@garg.io>
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/166
Fixes:
a1c4a8a3c855d52fbfef "egl: Add support for EGL_KHR_image."
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/454>
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 <target> is EGL_NATIVE_PIXMAP_KHR, and <ctx> is not EGL_NO_CONTEXT,
+ * the error EGL_BAD_PARAMETER is generated."
+ */
+ if (target == EGL_NATIVE_PIXMAP_KHR && ctx != EGL_NO_CONTEXT)
+ RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_NO_IMAGE_KHR);
+
/* "If <target> is EGL_LINUX_DMA_BUF_EXT, <dpy> must be a valid display,
* <ctx> must be EGL_NO_CONTEXT..."
*/