egl: Configs w/o double buffering support have no `EGL_WINDOW_BIT`.
authorHal Gentz <zegentzy@protonmail.com>
Fri, 11 Oct 2019 00:35:50 +0000 (18:35 -0600)
committerAdam Jackson <ajax@nwnk.net>
Fri, 11 Oct 2019 21:57:21 +0000 (21:57 +0000)
commit075a96aa926e6e89795f95a6a59693f44d9ac970
tree81b0142a0494f8325711ab37542bb2f7051e57af
parenta800d16e4f1589e41e53edf8e8a771a33bb46a6a
egl: Configs w/o double buffering support have no `EGL_WINDOW_BIT`.

When users pass a config to `eglCreateWindowSurface` it requests double
buffering, but if the config doesn't have the appropriate `__DRIconfig`,
`eglCreateWindowSurface` fails with a `EGL_BAD_MATCH`.

Given that such behaviour is completely unacceptable, we drop the
`EGL_WINDOW_BIT` if we don't have at least one `__DRIconfig` supporting double
buffering, otherwise dropping the `EGL_PIXMAP_BIT`.

Fixes: 049f343e8ac "egl: Allow 24-bit visuals for 32-bit RGBA8888 configs"
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67676
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Hal Gentz <zegentzy@protonmail.com>
src/egl/drivers/dri2/egl_dri2.c
src/egl/drivers/dri2/egl_dri2.h
src/egl/drivers/dri2/platform_android.c
src/egl/drivers/dri2/platform_device.c
src/egl/drivers/dri2/platform_drm.c
src/egl/drivers/dri2/platform_surfaceless.c
src/egl/drivers/dri2/platform_wayland.c
src/egl/drivers/dri2/platform_x11.c
src/egl/main/eglconfig.c
src/egl/main/eglconfig.h