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.
Cc: Mathias Fröhlich <mathias.froehl...@gmx.net> Cc: Marek Olšák <mar...@gmail.com> 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 588c6a5f1eb..4696eca8f82 100644 --- a/src/egl/main/eglapi.c +++ b/src/egl/main/eglapi.c @@ -379,7 +379,7 @@ eglGetDisplay(EGLNativeDisplayType nativeDisplay) native_display_ptr = (void*) nativeDisplay; plat = _eglGetNativePlatform(native_display_ptr); - disp = _eglFindDisplay(plat, native_display_ptr); + disp = _eglFindDisplay(plat, native_display_ptr, NULL); return _eglGetDisplayHandle(disp); } diff --git a/src/egl/main/egldisplay.c b/src/egl/main/egldisplay.c index b26a9575087..e8ef3d8ed93 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 *disp; @@ -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 cfd0ff66d64..a7c2641b600 100644 --- a/src/egl/main/egldisplay.h +++ b/src/egl/main/egldisplay.h @@ -202,7 +202,7 @@ _eglFiniDisplay(void); extern _EGLDisplay * -_eglFindDisplay(_EGLPlatformType plat, void *plat_dpy); +_eglFindDisplay(_EGLPlatformType plat, void *plat_dpy, void *plat_opt); extern void -- 2.21.0 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev