[Mesa-dev] [PATCH 2/2] egl: Express eglGetDisplay in terms of _eglGetPlatformDisplayCommon

Adam Jackson ajax at redhat.com
Fri Nov 17 21:50:31 UTC 2017


On Fri, 2017-11-17 at 16:26 +0000, Eric Engestrom wrote:
> On Thursday, 2017-11-16 13:27:28 -0500, Adam Jackson wrote:
> 
> > @@ -402,6 +380,11 @@ _eglGetPlatformDisplayCommon(EGLenum platform, void *native_display,
> >     case EGL_PLATFORM_SURFACELESS_MESA:
> >        dpy = _eglGetSurfacelessDisplay(native_display, attrib_list);
> >        break;
> > +#endif
> > +#if defined(HAVE_HAIKU_PLATFORM) || defined(HAVE_ANDROID_PLATFORM)
> > +   case _EGL_NATIVE_PLATFORM:
> > +      dpy = _eglFindDisplay(_EGL_NATIVE_PLATFORM, native_display);
> > +      break;
> 
> Should this be in a second commit?

Without this change, eglGetDisplay would be entirely broken on Haiku
and Android. It maybe belongs in a prior commit?

> Also, I would add a separate EGL_PLATFORM_ANDROID_KHR case; android can
> be used without being the default platform (I'm thinking surfaceless
> cros with arc++, or android-x86 living side by side with eg. wayland)

Yeah, fair point, the Android path should use the extension written for
that purpose. I'll fix that up and resubmit.
 
> > +static EGLenum
> > +_eglTranslatePlatform(_EGLPlatformType plat)
> > +{
> > +   /* mirror of _EGLPlatformType, kinda */
> > +   EGLenum platform[] = {
> > +      EGL_PLATFORM_X11_KHR,
> > +      EGL_PLATFORM_WAYLAND_KHR,
> > +      EGL_PLATFORM_GBM_KHR,
> > +      _EGL_NATIVE_PLATFORM,
> > +      _EGL_NATIVE_PLATFORM,
> > +      EGL_PLATFORM_SURFACELESS_MESA,
> > +   };
> 
> Since you're using those as indexes, you should probably also define
> them using those same indexes:

Will do.

- ajax


More information about the mesa-dev mailing list