[Mesa-dev] [PATCH 1/3][RFC] egl: Native Display autodetection

Chia-I Wu olvaffe at gmail.com
Tue Aug 9 20:50:38 PDT 2011


I'd prefer to leave out the second patch for now.  One comment below

On Tue, Aug 9, 2011 at 10:53 PM, Benjamin Franzke
<benjaminfranzke at googlemail.com> wrote:
> diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c
> index 0ba7794..5d186c6 100644
> --- a/src/egl/main/eglapi.c
> +++ b/src/egl/main/eglapi.c
> @@ -301,7 +301,7 @@ _eglUnlockDisplay(_EGLDisplay *dpy)
>  EGLDisplay EGLAPIENTRY
>  eglGetDisplay(EGLNativeDisplayType nativeDisplay)
>  {
> -   _EGLPlatformType plat = _eglGetNativePlatform();
> +   _EGLPlatformType plat = _eglGetNativePlatform(nativeDisplay);
>    _EGLDisplay *dpy = _eglFindDisplay(plat, (void *) nativeDisplay);
>    return _eglGetDisplayHandle(dpy);
>  }
> @@ -538,7 +538,7 @@ eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config,
>    EGLSurface ret;
>
>    _EGL_CHECK_CONFIG(disp, conf, EGL_NO_SURFACE, drv);
> -   if (disp->Platform != _eglGetNativePlatform())
> +   if (disp->Platform != _eglGetNativePlatform(disp->PlatformDisplay))
This check and the next two won't be necessary after the change to
_eglGetNativePlatform.
>       RETURN_EGL_ERROR(disp, EGL_BAD_NATIVE_WINDOW, EGL_NO_SURFACE);
>
>    surf = drv->API.CreateWindowSurface(drv, disp, conf, window, attrib_list);
> @@ -559,7 +559,7 @@ eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig config,
>    EGLSurface ret;
>
>    _EGL_CHECK_CONFIG(disp, conf, EGL_NO_SURFACE, drv);
> -   if (disp->Platform != _eglGetNativePlatform())
> +   if (disp->Platform != _eglGetNativePlatform(disp->PlatformDisplay))
>       RETURN_EGL_ERROR(disp, EGL_BAD_NATIVE_PIXMAP, EGL_NO_SURFACE);
>
>    surf = drv->API.CreatePixmapSurface(drv, disp, conf, pixmap, attrib_list);
> @@ -720,7 +720,7 @@ eglCopyBuffers(EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target)
>    EGLBoolean ret;
>
>    _EGL_CHECK_SURFACE(disp, surf, EGL_FALSE, drv);
> -   if (disp->Platform != _eglGetNativePlatform())
> +   if (disp->Platform != _eglGetNativePlatform(disp->PlatformDisplay))
>       RETURN_EGL_ERROR(disp, EGL_BAD_NATIVE_PIXMAP, EGL_FALSE);
>    ret = drv->API.CopyBuffers(drv, disp, surf, target);
>



-- 
olv at LunarG.com


More information about the mesa-dev mailing list