X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fegl%2Fmain%2Feglapi.c;h=51557be0864a43f3f4621fc04e130e614caa4c0c;hb=e64b91e34aa04a137a322ae9444c1c603383c6d4;hp=2831761f0ea232f102863fcacf2b8f978203ec40;hpb=eeacd66324c54bfe58fd29dd56918efa43d28836;p=mesa.git diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c index 2831761f0ea..51557be0864 100644 --- a/src/egl/main/eglapi.c +++ b/src/egl/main/eglapi.c @@ -405,6 +405,11 @@ _eglGetPlatformDisplayCommon(EGLenum platform, void *native_display, case EGL_PLATFORM_SURFACELESS_MESA: disp = _eglGetSurfacelessDisplay(native_display, attrib_list); break; +#endif +#ifdef HAVE_ANDROID_PLATFORM + case EGL_PLATFORM_ANDROID_KHR: + disp = _eglGetAndroidDisplay(native_display, attrib_list); + break; #endif case EGL_PLATFORM_DEVICE_EXT: disp = _eglGetDeviceDisplay(native_display, attrib_list); @@ -671,6 +676,10 @@ eglTerminate(EGLDisplay dpy) /* do not reset disp->Driver */ disp->ClientAPIsString[0] = 0; disp->Initialized = EGL_FALSE; + + /* Reset blob cache funcs on terminate. */ + disp->BlobCacheSet = NULL; + disp->BlobCacheGet = NULL; } RETURN_EGL_SUCCESS(disp, EGL_TRUE); @@ -1678,18 +1687,13 @@ eglCreatePbufferFromClientBuffer(EGLDisplay dpy, EGLenum buftype, _EGLDisplay *disp = _eglLockDisplay(dpy); _EGLConfig *conf = _eglLookupConfig(config, disp); _EGLDriver *drv; - _EGLSurface *surf; - EGLSurface ret; _EGL_FUNC_START(disp, EGL_OBJECT_DISPLAY_KHR, NULL, EGL_NO_SURFACE); _EGL_CHECK_CONFIG(disp, conf, EGL_NO_SURFACE, drv); - surf = drv->API.CreatePbufferFromClientBuffer(drv, disp, buftype, buffer, - conf, attrib_list); - ret = (surf) ? _eglLinkSurface(surf) : EGL_NO_SURFACE; - - RETURN_EGL_EVAL(disp, ret); + /* OpenVG is not supported */ + RETURN_EGL_ERROR(disp, EGL_BAD_ALLOC, EGL_NO_SURFACE); } @@ -1847,9 +1851,10 @@ _eglCreateSync(_EGLDisplay *disp, EGLenum type, const EGLAttrib *attrib_list, (type == EGL_SYNC_FENCE_KHR || type == EGL_SYNC_NATIVE_FENCE_ANDROID)) RETURN_EGL_ERROR(disp, EGL_BAD_MATCH, EGL_NO_SYNC_KHR); - /* return an error if the client API doesn't support GL_OES_EGL_sync */ + /* return an error if the client API doesn't support GL_[OES|MESA]_EGL_sync. */ if (ctx && (ctx->Resource.Display != disp || - ctx->ClientAPI != EGL_OPENGL_ES_API)) + (ctx->ClientAPI != EGL_OPENGL_ES_API && + ctx->ClientAPI != EGL_OPENGL_API))) RETURN_EGL_ERROR(disp, EGL_BAD_MATCH, EGL_NO_SYNC_KHR); switch (type) { @@ -2031,8 +2036,10 @@ _eglWaitSyncCommon(_EGLDisplay *disp, _EGLSync *s, EGLint flags) _EGL_CHECK_SYNC(disp, s, EGL_FALSE, drv); assert(disp->Extensions.KHR_wait_sync); - /* return an error if the client API doesn't support GL_OES_EGL_sync */ - if (ctx == EGL_NO_CONTEXT || ctx->ClientAPI != EGL_OPENGL_ES_API) + /* return an error if the client API doesn't support GL_[OES|MESA]_EGL_sync. */ + if (ctx == EGL_NO_CONTEXT || + (ctx->ClientAPI != EGL_OPENGL_ES_API && + ctx->ClientAPI != EGL_OPENGL_API)) RETURN_EGL_ERROR(disp, EGL_BAD_MATCH, EGL_FALSE); /* the API doesn't allow any flags yet */ @@ -2108,6 +2115,10 @@ eglGetSyncAttrib(EGLDisplay dpy, EGLSync sync, EGLint attribute, EGLAttrib *valu _EGLDisplay *disp = _eglLockDisplay(dpy); _EGLSync *s = _eglLookupSync(sync, disp); _EGL_FUNC_START(disp, EGL_OBJECT_SYNC_KHR, s, EGL_FALSE); + + if (!value) + RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_FALSE); + return _eglGetSyncAttribCommon(disp, s, attribute, value); }