egl: Make the 565 pbuffer-only config single buffered.
authorKenneth Graunke <kenneth@whitecape.org>
Sat, 23 Mar 2019 01:00:55 +0000 (18:00 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 22 Jul 2019 23:58:09 +0000 (16:58 -0700)
commit6ad31c4ff33d92f6359b196a94ace99682272111
treef0eff08a6b721ec5d56b7ed22309da35f8d2bd08
parentfc21394bc4d4e5c3ec06675bbb26974e5550c385
egl: Make the 565 pbuffer-only config single buffered.

In commit dacb11a585face5ca179c34cfc588a71a425c1e0, Eric found the first
matching 565 pbuffer config, and stopped.  Our double-buffered configs
come first in the list, so we added that, making a pbuffer-only config
that claimed to be double buffered.  This doesn't make sense, since
pixmaps/pbuffers are fundamentally not double buffered.

When using that config, every call to eglCreatePbufferSurface would fail
with EGL_BAD_MATCH.  The call chain looks like this:

   - eglCreatePbufferSurface
   - dri3_create_pbuffer_surface
   - dri3_create_surface
   - dri2_get_dri_config

which eventually does:

   const bool double_buffer = surface_type == EGL_WINDOW_BIT;

and then fails to find a matching config, because it ends up looking
for a single-buffered config - and there aren't any.

To fix this, make the 565 pbuffer config single-buffered.  This fixes
at least 51 dEQP-EGL.* tests.

Fixes: dacb11a585f ("egl: Add a 565 pbuffer-only EGL config under X11.")
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/egl/drivers/dri2/platform_x11.c