Module: Mesa Branch: staging/23.3 Commit: c256207e9f7bd83724f05a5034a446bb4a1e9914 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=c256207e9f7bd83724f05a5034a446bb4a1e9914
Author: Robert Foss <[email protected]> Date: Thu Nov 9 15:16:46 2023 +0100 egl/surfaceless: Fix EGL_DEVICE_EXT implementation The native_display checks are incorrect and partially never executed due to native_display always being NULL. Fixes: 1efaa858890 ("egl: Fix attrib_list[0] == EGL_NONE check") Signed-off-by: Robert Foss <[email protected]> Reviewed-by: Adam Jackson <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26131> (cherry picked from commit cda9980f9639093cf86897a760e90c89df7b6c0f) --- .pick_status.json | 2 +- src/egl/main/egldisplay.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index dda50bb437e..a105cb11a00 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1384,7 +1384,7 @@ "description": "egl/surfaceless: Fix EGL_DEVICE_EXT implementation", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "1efaa85889051978f806c4ea7c6d4997329624e5", "notes": null diff --git a/src/egl/main/egldisplay.c b/src/egl/main/egldisplay.c index dd4926ce2ab..4eadb8f10aa 100644 --- a/src/egl/main/egldisplay.c +++ b/src/egl/main/egldisplay.c @@ -642,6 +642,7 @@ _EGLDisplay * _eglGetSurfacelessDisplay(void *native_display, const EGLAttrib *attrib_list) { _EGLDisplay *dpy; + _EGLDevice *dev = NULL; /* Any native display must be an EGLDeviceEXT we know about */ if (native_display != NULL) { @@ -657,8 +658,8 @@ _eglGetSurfacelessDisplay(void *native_display, const EGLAttrib *attrib_list) switch (attrib) { case EGL_DEVICE_EXT: - if ((native_display && native_display != (void *)value) || - (native_display != _eglLookupDevice(native_display))) { + dev = _eglLookupDevice((void *)value); + if (!dev) { _eglError(EGL_BAD_DEVICE_EXT, "eglGetPlatformDisplay"); return NULL; } @@ -671,10 +672,9 @@ _eglGetSurfacelessDisplay(void *native_display, const EGLAttrib *attrib_list) } } - dpy = - _eglFindDisplay(_EGL_PLATFORM_SURFACELESS, native_display, attrib_list); + dpy = _eglFindDisplay(_EGL_PLATFORM_SURFACELESS, NULL, attrib_list); if (dpy) { - dpy->Device = native_display; + dpy->Device = dev; } return dpy;
