egl: Fix attrib_list[0] == EGL_NONE check
authorRobert Foss <rfoss@kernel.org>
Mon, 31 Jul 2023 09:40:23 +0000 (11:40 +0200)
committerMarge Bot <emma+marge@anholt.net>
Tue, 1 Aug 2023 11:21:59 +0000 (11:21 +0000)
commit1efaa85889051978f806c4ea7c6d4997329624e5
tree9fd9b51407294f627c683c8e1c1529aefb9efec4
parent1440a0f95bede8c77ba842273cf8264dd2dc6a47
egl: Fix attrib_list[0] == EGL_NONE check

_eglGetSurfacelessDisplay(), _eglGetWaylandDisplay() and
_eglGetGbmDisplay() handle the attrib_list[0] == EGL_NONE
case incorrectly by returning an EGL_BAD_ATTRIBUTE error.

Fix this bug, and switch the functions to use switch/case
in order to have the same structure as the sibling
_eglGetXXXDisplay() functions which support multiple attributes.

Fixes: c237539d621 ("egl: Implement EGL_EXT_explicit_device")

Signed-off-by: Robert Foss <rfoss@kernel.org>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24394>
src/egl/main/egldisplay.c