From: Emil Velikov <emil.veli...@collabora.com> The EGL_EXT_platform_device extension will be coming shortly. It will effectively require comparing the platform specific options, passed via the attribs array.
Signed-off-by: Emil Velikov <emil.veli...@collabora.com> --- I'm not a huge fan of this. Yet again the other platform (x11) that uses these has a number of issues, see below for details. Once those are resolved we could try and make this more uniform. a) spec does not mention if a new (or the existing) EGLDislay should be given for same native_dpy/screen_no combo. b) the implementation has number of issues: - screen 0 is hardcoded when using DEFAULT_DISPLAY - screen is _ignored_ when using !DEFAULT_DISPLAY --- src/egl/main/eglapi.c | 2 +- src/egl/main/egldisplay.c | 12 +++++++----- src/egl/main/egldisplay.h | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c index 6df5e841463..0f018ff62ff 100644 --- a/src/egl/main/eglapi.c +++ b/src/egl/main/eglapi.c @@ -371,7 +371,7 @@ eglGetDisplay(EGLNativeDisplayType nativeDisplay) native_display_ptr = (void*) nativeDisplay; plat = _eglGetNativePlatform(native_display_ptr); - dpy = _eglFindDisplay(plat, native_display_ptr); + dpy = _eglFindDisplay(plat, native_display_ptr, NULL); return _eglGetDisplayHandle(dpy); } diff --git a/src/egl/main/egldisplay.c b/src/egl/main/egldisplay.c index 387df6a66d0..94f94bb96e6 100644 --- a/src/egl/main/egldisplay.c +++ b/src/egl/main/egldisplay.c @@ -211,9 +211,11 @@ _eglFiniDisplay(void) /** * Find the display corresponding to the specified native display, or create a * new one. + * + * Certain platform types can use plat_opt. */ _EGLDisplay * -_eglFindDisplay(_EGLPlatformType plat, void *plat_dpy) +_eglFindDisplay(_EGLPlatformType plat, void *plat_dpy, void *plat_opt) { _EGLDisplay *dpy; @@ -477,7 +479,7 @@ _eglGetX11Display(Display *native_display, const EGLAttrib *attrib_list) { _EGLDisplay *display = _eglFindDisplay(_EGL_PLATFORM_X11, - native_display); + native_display, NULL); if (!display) { _eglError(EGL_BAD_ALLOC, "eglGetPlatformDisplay"); @@ -503,7 +505,7 @@ _eglGetGbmDisplay(struct gbm_device *native_display, return NULL; } - return _eglFindDisplay(_EGL_PLATFORM_DRM, native_display); + return _eglFindDisplay(_EGL_PLATFORM_DRM, native_display, NULL); } #endif /* HAVE_DRM_PLATFORM */ @@ -518,7 +520,7 @@ _eglGetWaylandDisplay(struct wl_display *native_display, return NULL; } - return _eglFindDisplay(_EGL_PLATFORM_WAYLAND, native_display); + return _eglFindDisplay(_EGL_PLATFORM_WAYLAND, native_display, NULL); } #endif /* HAVE_WAYLAND_PLATFORM */ @@ -539,6 +541,6 @@ _eglGetSurfacelessDisplay(void *native_display, return NULL; } - return _eglFindDisplay(_EGL_PLATFORM_SURFACELESS, native_display); + return _eglFindDisplay(_EGL_PLATFORM_SURFACELESS, native_display, NULL); } #endif /* HAVE_SURFACELESS_PLATFORM */ diff --git a/src/egl/main/egldisplay.h b/src/egl/main/egldisplay.h index fae90520368..f43d7b589fa 100644 --- a/src/egl/main/egldisplay.h +++ b/src/egl/main/egldisplay.h @@ -201,7 +201,7 @@ _eglFiniDisplay(void); extern _EGLDisplay * -_eglFindDisplay(_EGLPlatformType plat, void *plat_dpy); +_eglFindDisplay(_EGLPlatformType plat, void *plat_dpy, void *plat_opt); extern void -- 2.18.0 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev