egl: check if colorspace/surface type is supported
authorJuan A. Suarez Romero <jasuarez@igalia.com>
Wed, 2 May 2018 16:20:16 +0000 (16:20 +0000)
committerJuan A. Suarez Romero <jasuarez@igalia.com>
Thu, 3 May 2018 10:26:12 +0000 (12:26 +0200)
commitfd4eba4929e0e87f71b3b72a4e9fa5ac4abae52c
tree7f9a8e35ef25ad4fff1b71ce192328a5d779955b
parent0ba0ac815e078185c1f408ec7078fd1efac1a634
egl: check if colorspace/surface type is supported

According to EGL 1.4 spec, section 3.5.1 ("Creating On-Screen Rendering
Surfaces"), if config does not support the colorspace or alpha format
attributes specified in attrib_list (as defined for
eglCreateWindowSurface), an EGL_BAD_MATCH error is generated.

This fixes dEQP-EGL.functional.wide_color.*_888_colorspace_srgb (still
not merged,
https://android-review.googlesource.com/c/platform/external/deqp/+/667322),
which is crashing when trying to create a windows surface with RGB888
configuration and sRGB colorspace.

v2: Handle the fix in other backends (Tapani)

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
src/egl/drivers/dri2/platform_drm.c
src/egl/drivers/dri2/platform_wayland.c
src/egl/drivers/dri2/platform_x11.c
src/egl/drivers/dri2/platform_x11_dri3.c