egl: Refresh DeviceList during eglInitialize()
authorRobert Foss <rfoss@kernel.org>
Tue, 13 Jun 2023 11:56:36 +0000 (13:56 +0200)
committerMarge Bot <emma+marge@anholt.net>
Mon, 17 Jul 2023 22:27:00 +0000 (22:27 +0000)
eglInitialize() must be called before the dri2 platforms probe
in order for the EGL DeviceList to be populate with devices.

Signed-off-by: Robert Foss <rfoss@kernel.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23742>

src/egl/main/eglapi.c
src/egl/main/egldevice.c
src/egl/main/egldevice.h

index ea8a011..109612f 100644 (file)
@@ -666,6 +666,8 @@ eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor)
 
    _EGL_FUNC_START(disp, EGL_OBJECT_DISPLAY_KHR, NULL);
 
+   _eglDeviceRefreshList();
+
    if (!disp)
       RETURN_EGL_ERROR(NULL, EGL_BAD_DISPLAY, EGL_FALSE);
 
index ab96a8d..24020b3 100644 (file)
@@ -284,7 +284,7 @@ _eglQueryDeviceStringEXT(_EGLDevice *dev, EGLint name)
  *
  * Must be called with the global lock held.
  */
-static int
+int
 _eglDeviceRefreshList(void)
 {
    ASSERTED _EGLDevice *dev;
index 6a91c13..6b52863 100644 (file)
@@ -81,6 +81,9 @@ _eglDeviceNext(_EGLDevice *dev);
 EGLBoolean
 _eglDeviceSupports(_EGLDevice *dev, _EGLDeviceExtension ext);
 
+int
+_eglDeviceRefreshList(void);
+
 EGLBoolean
 _eglQueryDeviceAttribEXT(_EGLDevice *dev, EGLint attribute, EGLAttrib *value);