egl: add EGL_BAD_MATCH error case for surfaceless and android
authorTapani Pälli <tapani.palli@intel.com>
Fri, 4 May 2018 05:28:50 +0000 (08:28 +0300)
committerTapani Pälli <tapani.palli@intel.com>
Fri, 4 May 2018 11:04:03 +0000 (14:04 +0300)
Just like is done for other backends when suitable config is not
found (added in fd4eba4929).

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
src/egl/drivers/dri2/platform_android.c
src/egl/drivers/dri2/platform_surfaceless.c

index 7f1a496ea24180c9dedeec877e4833951fc1f027..1d6ed92bd614497f747c7f70222b0a222f3ee5cd 100644 (file)
@@ -337,8 +337,10 @@ droid_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
 
    config = dri2_get_dri_config(dri2_conf, type,
                                 dri2_surf->base.GLColorspace);
-   if (!config)
+   if (!config) {
+      _eglError(EGL_BAD_MATCH, "Unsupported surfacetype/colorspace configuration");
       goto cleanup_surface;
+   }
 
    if (dri2_dpy->image_driver)
       createNewDrawable = dri2_dpy->image_driver->createNewDrawable;
index 70b302c0ce42f8ec8a5a6961bf3e267d009e4e55..a0348a5e95449dfc086711b2220db2e855bfe997 100644 (file)
@@ -130,8 +130,10 @@ dri2_surfaceless_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
    config = dri2_get_dri_config(dri2_conf, type,
                                 dri2_surf->base.GLColorspace);
 
-   if (!config)
+   if (!config) {
+      _eglError(EGL_BAD_MATCH, "Unsupported surfacetype/colorspace configuration");
       goto cleanup_surface;
+   }
 
    dri2_surf->dri_drawable =
       dri2_dpy->image_driver->createNewDrawable(dri2_dpy->dri_screen, config,