[Mesa-dev] [PATCH v2] egl: check if colorspace/surface type is supported
Emil Velikov
emil.l.velikov at gmail.com
Thu May 3 17:49:48 UTC 2018
On 2 May 2018 at 17:23, Juan A. Suarez Romero <jasuarez at igalia.com> wrote:
> 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)
> ---
> src/egl/drivers/dri2/platform_drm.c | 5 +++++
> src/egl/drivers/dri2/platform_wayland.c | 6 ++++++
> src/egl/drivers/dri2/platform_x11.c | 5 +++++
> src/egl/drivers/dri2/platform_x11_dri3.c | 5 +++++
> 4 files changed, 21 insertions(+)
>
> diff --git a/src/egl/drivers/dri2/platform_drm.c b/src/egl/drivers/dri2/platform_drm.c
> index dc4efea9103..35bc4b5b1ac 100644
> --- a/src/egl/drivers/dri2/platform_drm.c
> +++ b/src/egl/drivers/dri2/platform_drm.c
> @@ -155,6 +155,11 @@ dri2_drm_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
> config = dri2_get_dri_config(dri2_conf, EGL_WINDOW_BIT,
> dri2_surf->base.GLColorspace);
>
> + if (!config) {
> + _eglError(EGL_BAD_MATCH, "Unsupported surfacetype/colorspace configuration");
Seems like android and surfaceless are missing the EGL_BAD_MATCH bit.
AFAICT they need it right?
-Emil
More information about the mesa-dev
mailing list