Lines Matching refs:disp
122 #define RETURN_EGL_ERROR(disp, err, ret) \
124 if (disp) \
125 _eglUnlockDisplay(disp); \
132 #define RETURN_EGL_SUCCESS(disp, ret) \
133 RETURN_EGL_ERROR(disp, EGL_SUCCESS, ret)
136 #define RETURN_EGL_EVAL(disp, ret) \
137 RETURN_EGL_ERROR(disp, (ret) ? EGL_SUCCESS : 0, ret)
144 #define _EGL_CHECK_DISPLAY(disp, ret) \
146 if (!_eglCheckDisplay(disp, __func__)) \
147 RETURN_EGL_ERROR(disp, 0, ret); \
150 #define _EGL_CHECK_OBJECT(disp, type, obj, ret) \
152 if (!_eglCheck ## type(disp, obj, __func__)) \
153 RETURN_EGL_ERROR(disp, 0, ret); \
156 #define _EGL_CHECK_SURFACE(disp, surf, ret) \
157 _EGL_CHECK_OBJECT(disp, Surface, surf, ret)
159 #define _EGL_CHECK_CONTEXT(disp, context, ret) \
160 _EGL_CHECK_OBJECT(disp, Context, context, ret)
162 #define _EGL_CHECK_CONFIG(disp, conf, ret) \
163 _EGL_CHECK_OBJECT(disp, Config, conf, ret)
165 #define _EGL_CHECK_SYNC(disp, s, ret) \
166 _EGL_CHECK_OBJECT(disp, Sync, s, ret)
179 _eglCheckDisplay(_EGLDisplay *disp, const char *msg)
181 if (!disp) {
185 if (!disp->Initialized) {
194 _eglCheckSurface(_EGLDisplay *disp, _EGLSurface *surf, const char *msg)
196 if (!_eglCheckDisplay(disp, msg))
207 _eglCheckContext(_EGLDisplay *disp, _EGLContext *context, const char *msg)
209 if (!_eglCheckDisplay(disp, msg))
220 _eglCheckConfig(_EGLDisplay *disp, _EGLConfig *conf, const char *msg)
222 if (!_eglCheckDisplay(disp, msg))
233 _eglCheckSync(_EGLDisplay *disp, _EGLSync *s, const char *msg)
235 if (!_eglCheckDisplay(disp, msg))
251 _EGLDisplay *disp = _eglLookupDisplay(dpy);
252 if (disp)
253 mtx_lock(&disp->Mutex);
254 return disp;
262 _eglUnlockDisplay(_EGLDisplay *disp)
264 mtx_unlock(&disp->Mutex);
268 _eglSetFuncName(const char *funcName, _EGLDisplay *disp, EGLenum objectType, _EGLResource *object)
277 else if (objectType == EGL_OBJECT_DISPLAY_KHR && disp)
278 thr->CurrentObjectLabel = disp->Label;
289 #define _EGL_FUNC_START(disp, objectType, object, ret) \
291 if (!_eglSetFuncName(__func__, disp, objectType, (_EGLResource *) object)) { \
292 if (disp) \
293 _eglUnlockDisplay(disp); \
366 _EGLDisplay *disp;
375 disp = _eglFindDisplay(plat, native_display_ptr, NULL);
376 return _eglGetDisplayHandle(disp);
383 _EGLDisplay *disp;
388 disp = _eglGetX11Display((Display*) native_display, attrib_list);
393 disp = _eglGetXcbDisplay((xcb_connection_t*) native_display, attrib_list);
398 disp = _eglGetGbmDisplay((struct gbm_device*) native_display,
404 disp = _eglGetWaylandDisplay((struct wl_display*) native_display,
409 disp = _eglGetSurfacelessDisplay(native_display, attrib_list);
413 disp = _eglGetAndroidDisplay(native_display, attrib_list);
417 disp = _eglGetDeviceDisplay(native_display, attrib_list);
423 return _eglGetDisplayHandle(disp);
431 EGLDisplay disp;
438 disp = _eglGetPlatformDisplayCommon(platform, native_display, attrib_list);
440 return disp;
479 _eglCreateExtensionsString(_EGLDisplay *disp)
483 if (disp->Extensions.ext) { \
485 assert(exts <= disp->ExtensionsString + _EGL_MAX_EXTENSIONS_LEN); \
489 char *exts = disp->ExtensionsString;
524 if (disp->Extensions.KHR_image_base && disp->Extensions.KHR_image_pixmap)
525 disp->Extensions.KHR_image = EGL_TRUE;
534 if (disp->Extensions.EXT_swap_buffers_with_damage)
539 if (disp->Extensions.KHR_no_config_context)
557 _eglCreateAPIsString(_EGLDisplay *disp)
561 const size_t old_len = strlen(disp->ClientAPIsString); \
563 const size_t max_len = sizeof(disp->ClientAPIsString) - 1; \
565 strcat(disp->ClientAPIsString, str " "); \
567 assert(!"disp->ClientAPIsString is not large enough"); \
570 if (disp->ClientAPIs & EGL_OPENGL_BIT)
573 if (disp->ClientAPIs & EGL_OPENGL_ES_BIT ||
574 disp->ClientAPIs & EGL_OPENGL_ES2_BIT ||
575 disp->ClientAPIs & EGL_OPENGL_ES3_BIT_KHR) {
579 if (disp->ClientAPIs & EGL_OPENVG_BIT)
586 _eglComputeVersion(_EGLDisplay *disp)
588 disp->Version = 14;
590 if (disp->Extensions.KHR_fence_sync &&
591 disp->Extensions.KHR_cl_event2 &&
592 disp->Extensions.KHR_wait_sync &&
593 disp->Extensions.KHR_image_base &&
594 disp->Extensions.KHR_gl_texture_2D_image &&
595 disp->Extensions.KHR_gl_texture_3D_image &&
596 disp->Extensions.KHR_gl_texture_cubemap_image &&
597 disp->Extensions.KHR_gl_renderbuffer_image &&
598 disp->Extensions.KHR_create_context &&
599 disp->Extensions.EXT_create_context_robustness &&
600 disp->Extensions.KHR_get_all_proc_addresses &&
601 disp->Extensions.KHR_gl_colorspace &&
602 disp->Extensions.KHR_surfaceless_context)
603 disp->Version = 15;
607 disp->Version = 14;
618 _EGLDisplay *disp = _eglLockDisplay(dpy);
620 _EGL_FUNC_START(disp, EGL_OBJECT_DISPLAY_KHR, NULL, EGL_FALSE);
622 if (!disp)
625 if (!disp->Initialized) {
627 disp->Options.ForceSoftware =
629 if (disp->Options.ForceSoftware)
636 if (!_eglDriver.Initialize(disp)) {
637 if (disp->Options.ForceSoftware)
638 RETURN_EGL_ERROR(disp, EGL_NOT_INITIALIZED, EGL_FALSE);
640 disp->Options.ForceSoftware = EGL_TRUE;
641 if (!_eglDriver.Initialize(disp))
642 RETURN_EGL_ERROR(disp, EGL_NOT_INITIALIZED, EGL_FALSE);
646 disp->Initialized = EGL_TRUE;
647 disp->Driver = &_eglDriver;
650 disp->ClientAPIs &= _EGL_API_ALL_BITS;
667 disp->Extensions.KHR_get_all_proc_addresses = EGL_TRUE;
672 disp->Extensions.KHR_config_attribs = EGL_TRUE;
674 _eglComputeVersion(disp);
675 _eglCreateExtensionsString(disp);
676 _eglCreateAPIsString(disp);
677 snprintf(disp->VersionString, sizeof(disp->VersionString),
678 "%d.%d", disp->Version / 10, disp->Version % 10);
683 *major = disp->Version / 10;
684 *minor = disp->Version % 10;
687 RETURN_EGL_SUCCESS(disp, EGL_TRUE);
694 _EGLDisplay *disp = _eglLockDisplay(dpy);
696 _EGL_FUNC_START(disp, EGL_OBJECT_DISPLAY_KHR, NULL, EGL_FALSE);
698 if (!disp)
701 if (disp->Initialized) {
702 disp->Driver->Terminate(disp);
703 /* do not reset disp->Driver */
704 disp->ClientAPIsString[0] = 0;
705 disp->Initialized = EGL_FALSE;
708 disp->BlobCacheSet = NULL;
709 disp->BlobCacheGet = NULL;
712 RETURN_EGL_SUCCESS(disp, EGL_TRUE);
719 _EGLDisplay *disp;
727 disp = _eglLockDisplay(dpy);
728 _EGL_FUNC_START(disp, EGL_OBJECT_DISPLAY_KHR, NULL, NULL);
729 _EGL_CHECK_DISPLAY(disp, NULL);
733 RETURN_EGL_SUCCESS(disp, _EGL_VENDOR_STRING);
735 RETURN_EGL_SUCCESS(disp, disp->VersionString);
737 RETURN_EGL_SUCCESS(disp, disp->ExtensionsString);
739 RETURN_EGL_SUCCESS(disp, disp->ClientAPIsString);
741 RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, NULL);
750 _EGLDisplay *disp = _eglLockDisplay(dpy);
753 _EGL_FUNC_START(disp, EGL_OBJECT_DISPLAY_KHR, NULL, EGL_FALSE);
755 _EGL_CHECK_DISPLAY(disp, EGL_FALSE);
758 RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_FALSE);
760 ret = _eglGetConfigs(disp, configs, config_size, num_config);
762 RETURN_EGL_EVAL(disp, ret);
770 _EGLDisplay *disp = _eglLockDisplay(dpy);
773 _EGL_FUNC_START(disp, EGL_OBJECT_DISPLAY_KHR, NULL, EGL_FALSE);
775 _EGL_CHECK_DISPLAY(disp, EGL_FALSE);
778 RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_FALSE);
780 ret = _eglChooseConfig(disp, attrib_list, configs,
783 RETURN_EGL_EVAL(disp, ret);
791 _EGLDisplay *disp = _eglLockDisplay(dpy);
792 _EGLConfig *conf = _eglLookupConfig(config, disp);
795 _EGL_FUNC_START(disp, EGL_OBJECT_DISPLAY_KHR, NULL, EGL_FALSE);
797 _EGL_CHECK_CONFIG(disp, conf, EGL_FALSE);
799 ret = _eglGetConfigAttrib(disp, conf, attribute, value);
801 RETURN_EGL_EVAL(disp, ret);
809 _EGLDisplay *disp = _eglLockDisplay(dpy);
810 _EGLConfig *conf = _eglLookupConfig(config, disp);
811 _EGLContext *share = _eglLookupContext(share_list, disp);
815 _EGL_FUNC_START(disp, EGL_OBJECT_DISPLAY_KHR, NULL, EGL_NO_CONTEXT);
817 _EGL_CHECK_DISPLAY(disp, EGL_NO_CONTEXT);
820 _EGL_CHECK_CONFIG(disp, conf, EGL_NO_CONTEXT);
821 else if (!disp->Extensions.KHR_no_config_context)
822 RETURN_EGL_ERROR(disp, EGL_BAD_CONFIG, EGL_NO_CONTEXT);
825 RETURN_EGL_ERROR(disp, EGL_BAD_CONTEXT, EGL_NO_CONTEXT);
827 context = disp->Driver->CreateContext(disp, conf, share, attrib_list);
830 RETURN_EGL_EVAL(disp, ret);
837 _EGLDisplay *disp = _eglLockDisplay(dpy);
838 _EGLContext *context = _eglLookupContext(ctx, disp);
841 _EGL_FUNC_START(disp, EGL_OBJECT_CONTEXT_KHR, context, EGL_FALSE);
843 _EGL_CHECK_CONTEXT(disp, context, EGL_FALSE);
845 ret = disp->Driver->DestroyContext(disp, context);
847 RETURN_EGL_EVAL(disp, ret);
855 _EGLDisplay *disp = _eglLockDisplay(dpy);
856 _EGLContext *context = _eglLookupContext(ctx, disp);
857 _EGLSurface *draw_surf = _eglLookupSurface(draw, disp);
858 _EGLSurface *read_surf = _eglLookupSurface(read, disp);
861 _EGL_FUNC_START(disp, EGL_OBJECT_CONTEXT_KHR, context, EGL_FALSE);
863 if (!disp)
864 RETURN_EGL_ERROR(disp, EGL_BAD_DISPLAY, EGL_FALSE);
867 if (!disp->Initialized) {
870 RETURN_EGL_ERROR(disp, EGL_BAD_DISPLAY, EGL_FALSE);
872 if (!disp->Driver)
873 RETURN_EGL_SUCCESS(disp, EGL_TRUE);
876 RETURN_EGL_ERROR(disp, EGL_BAD_CONTEXT, EGL_FALSE);
883 if (!disp->Extensions.KHR_surfaceless_context && ctx != EGL_NO_CONTEXT)
884 RETURN_EGL_ERROR(disp, EGL_BAD_SURFACE, EGL_FALSE);
888 RETURN_EGL_ERROR(disp, EGL_BAD_SURFACE, EGL_FALSE);
890 RETURN_EGL_ERROR(disp, EGL_BAD_MATCH, EGL_FALSE);
897 RETURN_EGL_ERROR(disp, EGL_BAD_NATIVE_WINDOW, EGL_FALSE);
899 RETURN_EGL_ERROR(disp, EGL_BAD_NATIVE_WINDOW, EGL_FALSE);
907 RETURN_EGL_ERROR(disp, EGL_BAD_ACCESS, EGL_FALSE);
909 ret = disp->Driver->MakeCurrent(disp, draw_surf, read_surf, context);
911 RETURN_EGL_EVAL(disp, ret);
919 _EGLDisplay *disp = _eglLockDisplay(dpy);
920 _EGLContext *context = _eglLookupContext(ctx, disp);
923 _EGL_FUNC_START(disp, EGL_OBJECT_CONTEXT_KHR, context, EGL_FALSE);
925 _EGL_CHECK_CONTEXT(disp, context, EGL_FALSE);
929 RETURN_EGL_EVAL(disp, ret);
938 _eglNativeSurfaceAlreadyUsed(_EGLDisplay *disp, void *native_surface)
942 list = disp->ResourceLists[_EGL_RESOURCE_SURFACE];
960 _eglCreateWindowSurfaceCommon(_EGLDisplay *disp, EGLConfig config,
963 _EGLConfig *conf = _eglLookupConfig(config, disp);
969 RETURN_EGL_ERROR(disp, EGL_BAD_NATIVE_WINDOW, EGL_NO_SURFACE);
971 if (disp && (disp->Platform == _EGL_PLATFORM_SURFACELESS ||
972 disp->Platform == _EGL_PLATFORM_DEVICE)) {
985 RETURN_EGL_ERROR(disp, EGL_BAD_NATIVE_WINDOW, EGL_NO_SURFACE);
988 _EGL_CHECK_CONFIG(disp, conf, EGL_NO_SURFACE);
991 RETURN_EGL_ERROR(disp, EGL_BAD_MATCH, EGL_NO_SURFACE);
993 if (_eglNativeSurfaceAlreadyUsed(disp, native_window))
994 RETURN_EGL_ERROR(disp, EGL_BAD_ALLOC, EGL_NO_SURFACE);
996 surf = disp->Driver->CreateWindowSurface(disp, conf, native_window, attrib_list);
999 RETURN_EGL_EVAL(disp, ret);
1007 _EGLDisplay *disp = _eglLockDisplay(dpy);
1009 _EGL_FUNC_START(disp, EGL_OBJECT_DISPLAY_KHR, NULL, EGL_NO_SURFACE);
1011 return _eglCreateWindowSurfaceCommon(disp, config, (void*) window,
1016 _fixupNativeWindow(_EGLDisplay *disp, void *native_window)
1019 if (disp && disp->Platform == _EGL_PLATFORM_X11 && native_window != NULL) {
1038 _EGLDisplay *disp = _eglLockDisplay(dpy);
1040 native_window = _fixupNativeWindow(disp, native_window);
1042 _EGL_FUNC_START(disp, EGL_OBJECT_DISPLAY_KHR, NULL, EGL_NO_SURFACE);
1043 return _eglCreateWindowSurfaceCommon(disp, config, native_window,
1053 _EGLDisplay *disp = _eglLockDisplay(dpy);
1057 _EGL_FUNC_START(disp, EGL_OBJECT_DISPLAY_KHR, NULL, EGL_NO_SURFACE);
1061 RETURN_EGL_ERROR(disp, EGL_BAD_ALLOC, EGL_NO_SURFACE);
1063 native_window = _fixupNativeWindow(disp, native_window);
1064 surface = _eglCreateWindowSurfaceCommon(disp, config, native_window,
1071 _fixupNativePixmap(_EGLDisplay *disp, void *native_pixmap)
1081 if (disp && disp->Platform == _EGL_PLATFORM_X11 && native_pixmap != NULL)
1088 _eglCreatePixmapSurfaceCommon(_EGLDisplay *disp, EGLConfig config,
1091 _EGLConfig *conf = _eglLookupConfig(config, disp);
1095 if (disp && (disp->Platform == _EGL_PLATFORM_SURFACELESS ||
1096 disp->Platform == _EGL_PLATFORM_DEVICE)) {
1107 RETURN_EGL_ERROR(disp, EGL_BAD_NATIVE_PIXMAP, EGL_NO_SURFACE);
1110 _EGL_CHECK_CONFIG(disp, conf, EGL_NO_SURFACE);
1113 RETURN_EGL_ERROR(disp, EGL_BAD_MATCH, EGL_NO_SURFACE);
1116 RETURN_EGL_ERROR(disp, EGL_BAD_NATIVE_PIXMAP, EGL_NO_SURFACE);
1118 if (_eglNativeSurfaceAlreadyUsed(disp, native_pixmap))
1119 RETURN_EGL_ERROR(disp, EGL_BAD_ALLOC, EGL_NO_SURFACE);
1121 surf = disp->Driver->CreatePixmapSurface(disp, conf, native_pixmap, attrib_list);
1124 RETURN_EGL_EVAL(disp, ret);
1132 _EGLDisplay *disp = _eglLockDisplay(dpy);
1134 _EGL_FUNC_START(disp, EGL_OBJECT_DISPLAY_KHR, NULL, EGL_NO_SURFACE);
1136 return _eglCreatePixmapSurfaceCommon(disp, config, (void*) pixmap,
1145 _EGLDisplay *disp = _eglLockDisplay(dpy);
1147 _EGL_FUNC_START(disp, EGL_OBJECT_DISPLAY_KHR, NULL, EGL_NO_SURFACE);
1148 native_pixmap = _fixupNativePixmap(disp, native_pixmap);
1149 return _eglCreatePixmapSurfaceCommon(disp, config, native_pixmap,
1159 _EGLDisplay *disp = _eglLockDisplay(dpy);
1163 _EGL_FUNC_START(disp, EGL_OBJECT_DISPLAY_KHR, NULL, EGL_NO_SURFACE);
1167 RETURN_EGL_ERROR(disp, EGL_BAD_ALLOC, EGL_NO_SURFACE);
1169 native_pixmap = _fixupNativePixmap(disp, native_pixmap);
1170 surface = _eglCreatePixmapSurfaceCommon(disp, config, native_pixmap,
1181 _EGLDisplay *disp = _eglLockDisplay(dpy);
1182 _EGLConfig *conf = _eglLookupConfig(config, disp);
1186 _EGL_FUNC_START(disp, EGL_OBJECT_DISPLAY_KHR, NULL, EGL_NO_SURFACE);
1187 _EGL_CHECK_CONFIG(disp, conf, EGL_NO_SURFACE);
1190 RETURN_EGL_ERROR(disp, EGL_BAD_MATCH, EGL_NO_SURFACE);
1192 surf = disp->Driver->CreatePbufferSurface(disp, conf, attrib_list);
1195 RETURN_EGL_EVAL(disp, ret);
1202 _EGLDisplay *disp = _eglLockDisplay(dpy);
1203 _EGLSurface *surf = _eglLookupSurface(surface, disp);
1206 _EGL_FUNC_START(disp, EGL_OBJECT_SURFACE_KHR, surf, EGL_FALSE);
1207 _EGL_CHECK_SURFACE(disp, surf, EGL_FALSE);
1209 ret = disp->Driver->DestroySurface(disp, surf);
1211 RETURN_EGL_EVAL(disp, ret);
1218 _EGLDisplay *disp = _eglLockDisplay(dpy);
1219 _EGLSurface *surf = _eglLookupSurface(surface, disp);
1222 _EGL_FUNC_START(disp, EGL_OBJECT_SURFACE_KHR, surf, EGL_FALSE);
1223 _EGL_CHECK_SURFACE(disp, surf, EGL_FALSE);
1225 if (disp->Driver->QuerySurface)
1226 ret = disp->Driver->QuerySurface(disp, surf, attribute, value);
1228 ret = _eglQuerySurface(disp, surf, attribute, value);
1230 RETURN_EGL_EVAL(disp, ret);
1237 _EGLDisplay *disp = _eglLockDisplay(dpy);
1238 _EGLSurface *surf = _eglLookupSurface(surface, disp);
1241 _EGL_FUNC_START(disp, EGL_OBJECT_SURFACE_KHR, surf, EGL_FALSE);
1242 _EGL_CHECK_SURFACE(disp, surf, EGL_FALSE);
1244 ret = _eglSurfaceAttrib(disp, surf, attribute, value);
1246 RETURN_EGL_EVAL(disp, ret);
1253 _EGLDisplay *disp = _eglLockDisplay(dpy);
1254 _EGLSurface *surf = _eglLookupSurface(surface, disp);
1257 _EGL_FUNC_START(disp, EGL_OBJECT_SURFACE_KHR, surf, EGL_FALSE);
1258 _EGL_CHECK_SURFACE(disp, surf, EGL_FALSE);
1259 ret = disp->Driver->BindTexImage(disp, surf, buffer);
1261 RETURN_EGL_EVAL(disp, ret);
1268 _EGLDisplay *disp = _eglLockDisplay(dpy);
1269 _EGLSurface *surf = _eglLookupSurface(surface, disp);
1272 _EGL_FUNC_START(disp, EGL_OBJECT_SURFACE_KHR, surf, EGL_FALSE);
1273 _EGL_CHECK_SURFACE(disp, surf, EGL_FALSE);
1274 ret = disp->Driver->ReleaseTexImage(disp, surf, buffer);
1276 RETURN_EGL_EVAL(disp, ret);
1283 _EGLDisplay *disp = _eglLockDisplay(dpy);
1288 _EGL_FUNC_START(disp, EGL_OBJECT_SURFACE_KHR, surf, EGL_FALSE);
1289 _EGL_CHECK_DISPLAY(disp, EGL_FALSE);
1292 ctx->Resource.Display != disp)
1293 RETURN_EGL_ERROR(disp, EGL_BAD_CONTEXT, EGL_FALSE);
1296 RETURN_EGL_ERROR(disp, EGL_BAD_SURFACE, EGL_FALSE);
1299 RETURN_EGL_EVAL(disp, EGL_TRUE);
1305 if (surf->SwapInterval != interval && disp->Driver->SwapInterval)
1306 ret = disp->Driver->SwapInterval(disp, surf, interval);
1313 RETURN_EGL_EVAL(disp, ret);
1321 _EGLDisplay *disp = _eglLockDisplay(dpy);
1322 _EGLSurface *surf = _eglLookupSurface(surface, disp);
1325 _EGL_FUNC_START(disp, EGL_OBJECT_SURFACE_KHR, surf, EGL_FALSE);
1326 _EGL_CHECK_SURFACE(disp, surf, EGL_FALSE);
1332 RETURN_EGL_ERROR(disp, EGL_BAD_SURFACE, EGL_FALSE);
1336 RETURN_EGL_EVAL(disp, EGL_TRUE);
1345 RETURN_EGL_ERROR(disp, EGL_BAD_NATIVE_WINDOW, EGL_FALSE);
1347 ret = disp->Driver->SwapBuffers(disp, surf);
1358 RETURN_EGL_EVAL(disp, ret);
1363 _eglSwapBuffersWithDamageCommon(_EGLDisplay *disp, _EGLSurface *surf,
1369 _EGL_CHECK_SURFACE(disp, surf, EGL_FALSE);
1374 RETURN_EGL_ERROR(disp, EGL_BAD_SURFACE, EGL_FALSE);
1377 RETURN_EGL_EVAL(disp, EGL_TRUE);
1380 RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_FALSE);
1382 ret = disp->Driver->SwapBuffersWithDamageEXT(disp, surf, rects, n_rects);
1393 RETURN_EGL_EVAL(disp, ret);
1400 _EGLDisplay *disp = _eglLockDisplay(dpy);
1401 _EGLSurface *surf = _eglLookupSurface(surface, disp);
1402 _EGL_FUNC_START(disp, EGL_OBJECT_SURFACE_KHR, surf, EGL_FALSE);
1403 return _eglSwapBuffersWithDamageCommon(disp, surf, rects, n_rects);
1410 _EGLDisplay *disp = _eglLockDisplay(dpy);
1411 _EGLSurface *surf = _eglLookupSurface(surface, disp);
1412 _EGL_FUNC_START(disp, EGL_OBJECT_SURFACE_KHR, surf, EGL_FALSE);
1413 return _eglSwapBuffersWithDamageCommon(disp, surf, rects, n_rects);
1446 _EGLDisplay *disp = _eglLockDisplay(dpy);
1447 _EGLSurface *surf = _eglLookupSurface(surface, disp);
1448 _EGL_FUNC_START(disp, EGL_OBJECT_SURFACE_KHR, surf, EGL_FALSE);
1451 _EGL_CHECK_SURFACE(disp, surf, EGL_FALSE);
1457 RETURN_EGL_ERROR(disp, EGL_BAD_MATCH, EGL_FALSE);
1465 RETURN_EGL_ERROR(disp, EGL_BAD_ACCESS, EGL_FALSE);
1468 ret = disp->Driver->SetDamageRegion(disp, surf, rects, n_rects);
1473 RETURN_EGL_EVAL(disp, ret);
1479 _EGLDisplay *disp = _eglLockDisplay(dpy);
1480 _EGLSurface *surf = _eglLookupSurface(surface, disp);
1484 _EGL_FUNC_START(disp, EGL_OBJECT_SURFACE_KHR, surf, EGL_FALSE);
1488 _EGL_CHECK_SURFACE(disp, surf, EGL_FALSE);
1490 RETURN_EGL_ERROR(disp, EGL_BAD_ACCESS, EGL_FALSE);
1491 ret = disp->Driver->CopyBuffers(disp, surf, native_pixmap_ptr);
1493 RETURN_EGL_EVAL(disp, ret);
1501 _EGLDisplay *disp;
1507 disp = ctx->Resource.Display;
1508 mtx_lock(&disp->Mutex);
1513 RETURN_EGL_ERROR(disp, EGL_BAD_CURRENT_SURFACE, EGL_FALSE);
1516 assert(disp->Initialized);
1517 ret = disp->Driver->WaitClient(disp, ctx);
1519 RETURN_EGL_EVAL(disp, ret);
1542 _EGLDisplay *disp;
1550 disp = ctx->Resource.Display;
1551 mtx_lock(&disp->Mutex);
1556 RETURN_EGL_ERROR(disp, EGL_BAD_CURRENT_SURFACE, EGL_FALSE);
1559 assert(disp->Initialized);
1560 ret = disp->Driver->WaitNative(engine);
1562 RETURN_EGL_EVAL(disp, ret);
1689 _EGLDisplay *disp = _eglLockDisplay(dpy);
1690 _EGLConfig *conf = _eglLookupConfig(config, disp);
1692 _EGL_FUNC_START(disp, EGL_OBJECT_DISPLAY_KHR, NULL, EGL_NO_SURFACE);
1694 _EGL_CHECK_CONFIG(disp, conf, EGL_NO_SURFACE);
1697 RETURN_EGL_ERROR(disp, EGL_BAD_ALLOC, EGL_NO_SURFACE);
1712 _EGLDisplay *disp = ctx->Resource.Display;
1714 mtx_lock(&disp->Mutex);
1715 (void) disp->Driver->MakeCurrent(disp, NULL, NULL, NULL);
1716 mtx_unlock(&disp->Mutex);
1727 _eglCreateImageCommon(_EGLDisplay *disp, EGLContext ctx, EGLenum target,
1730 _EGLContext *context = _eglLookupContext(ctx, disp);
1734 _EGL_CHECK_DISPLAY(disp, EGL_NO_IMAGE_KHR);
1735 if (!disp->Extensions.KHR_image_base)
1736 RETURN_EGL_EVAL(disp, EGL_NO_IMAGE_KHR);
1738 RETURN_EGL_ERROR(disp, EGL_BAD_CONTEXT, EGL_NO_IMAGE_KHR);
1743 RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_NO_IMAGE_KHR);
1745 img = disp->Driver->CreateImageKHR(disp, context, target, buffer, attr_list);
1748 RETURN_EGL_EVAL(disp, ret);
1755 _EGLDisplay *disp = _eglLockDisplay(dpy);
1756 _EGL_FUNC_START(disp, EGL_OBJECT_DISPLAY_KHR, NULL, EGL_NO_IMAGE_KHR);
1757 return _eglCreateImageCommon(disp, ctx, target, buffer, attr_list);
1765 _EGLDisplay *disp = _eglLockDisplay(dpy);
1769 _EGL_FUNC_START(disp, EGL_OBJECT_DISPLAY_KHR, NULL, EGL_NO_IMAGE_KHR);
1773 RETURN_EGL_ERROR(disp, EGL_BAD_ALLOC, EGL_NO_IMAGE);
1775 image = _eglCreateImageCommon(disp, ctx, target, buffer, int_attribs);
1782 _eglDestroyImageCommon(_EGLDisplay *disp, _EGLImage *img)
1786 _EGL_CHECK_DISPLAY(disp, EGL_FALSE);
1787 if (!disp->Extensions.KHR_image_base)
1788 RETURN_EGL_EVAL(disp, EGL_FALSE);
1790 RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_FALSE);
1793 ret = disp->Driver->DestroyImageKHR(disp, img);
1795 RETURN_EGL_EVAL(disp, ret);
1801 _EGLDisplay *disp = _eglLockDisplay(dpy);
1802 _EGLImage *img = _eglLookupImage(image, disp);
1803 _EGL_FUNC_START(disp, EGL_OBJECT_IMAGE_KHR, img, EGL_FALSE);
1804 return _eglDestroyImageCommon(disp, img);
1810 _EGLDisplay *disp = _eglLockDisplay(dpy);
1811 _EGLImage *img = _eglLookupImage(image, disp);
1812 _EGL_FUNC_START(disp, EGL_OBJECT_IMAGE_KHR, img, EGL_FALSE);
1813 return _eglDestroyImageCommon(disp, img);
1818 _eglCreateSync(_EGLDisplay *disp, EGLenum type, const EGLAttrib *attrib_list,
1826 _EGL_CHECK_DISPLAY(disp, EGL_NO_SYNC_KHR);
1828 if (!disp->Extensions.KHR_cl_event2 && orig_is_EGLAttrib) {
1838 RETURN_EGL_ERROR(disp, EGL_BAD_MATCH, EGL_NO_SYNC_KHR);
1847 RETURN_EGL_ERROR(disp, EGL_BAD_MATCH, EGL_NO_SYNC_KHR);
1850 if (ctx && (ctx->Resource.Display != disp ||
1853 RETURN_EGL_ERROR(disp, EGL_BAD_MATCH, EGL_NO_SYNC_KHR);
1857 if (!disp->Extensions.KHR_fence_sync)
1858 RETURN_EGL_ERROR(disp, invalid_type_error, EGL_NO_SYNC_KHR);
1861 if (!disp->Extensions.KHR_reusable_sync)
1862 RETURN_EGL_ERROR(disp, invalid_type_error, EGL_NO_SYNC_KHR);
1865 if (!disp->Extensions.KHR_cl_event2)
1866 RETURN_EGL_ERROR(disp, invalid_type_error, EGL_NO_SYNC_KHR);
1869 if (!disp->Extensions.ANDROID_native_fence_sync)
1870 RETURN_EGL_ERROR(disp, invalid_type_error, EGL_NO_SYNC_KHR);
1873 RETURN_EGL_ERROR(disp, invalid_type_error, EGL_NO_SYNC_KHR);
1876 sync = disp->Driver->CreateSyncKHR(disp, type, attrib_list);
1879 RETURN_EGL_EVAL(disp, ret);
1886 _EGLDisplay *disp = _eglLockDisplay(dpy);
1887 _EGL_FUNC_START(disp, EGL_OBJECT_DISPLAY_KHR, NULL, EGL_FALSE);
1898 RETURN_EGL_ERROR(disp, err, EGL_NO_SYNC);
1901 sync = _eglCreateSync(disp, type, attrib_list, EGL_FALSE,
1915 _EGLDisplay *disp = _eglLockDisplay(dpy);
1916 _EGL_FUNC_START(disp, EGL_OBJECT_DISPLAY_KHR, NULL, EGL_FALSE);
1917 return _eglCreateSync(disp, type, attrib_list, EGL_TRUE,
1925 _EGLDisplay *disp = _eglLockDisplay(dpy);
1926 _EGL_FUNC_START(disp, EGL_OBJECT_DISPLAY_KHR, NULL, EGL_FALSE);
1927 return _eglCreateSync(disp, type, attrib_list, EGL_TRUE,
1933 _eglDestroySync(_EGLDisplay *disp, _EGLSync *s)
1937 _EGL_CHECK_SYNC(disp, s, EGL_FALSE);
1938 assert(disp->Extensions.KHR_reusable_sync ||
1939 disp->Extensions.KHR_fence_sync ||
1940 disp->Extensions.ANDROID_native_fence_sync);
1943 ret = disp->Driver->DestroySyncKHR(disp, s);
1945 RETURN_EGL_EVAL(disp, ret);
1951 _EGLDisplay *disp = _eglLockDisplay(dpy);
1952 _EGLSync *s = _eglLookupSync(sync, disp);
1953 _EGL_FUNC_START(disp, EGL_OBJECT_SYNC_KHR, s, EGL_FALSE);
1954 return _eglDestroySync(disp, s);
1960 _EGLDisplay *disp = _eglLockDisplay(dpy);
1961 _EGLSync *s = _eglLookupSync(sync, disp);
1962 _EGL_FUNC_START(disp, EGL_OBJECT_SYNC_KHR, s, EGL_FALSE);
1963 return _eglDestroySync(disp, s);
1968 _eglClientWaitSyncCommon(_EGLDisplay *disp, EGLDisplay dpy,
1973 _EGL_CHECK_SYNC(disp, s, EGL_FALSE);
1974 assert(disp->Extensions.KHR_reusable_sync ||
1975 disp->Extensions.KHR_fence_sync ||
1976 disp->Extensions.ANDROID_native_fence_sync);
1979 RETURN_EGL_EVAL(disp, EGL_CONDITION_SATISFIED_KHR);
1989 ret = disp->Driver->ClientWaitSyncKHR(disp, s, flags, timeout);
1992 * 'disp' is already unlocked for reusable sync type,
1998 RETURN_EGL_EVAL(disp, ret);
2005 _EGLDisplay *disp = _eglLockDisplay(dpy);
2006 _EGLSync *s = _eglLookupSync(sync, disp);
2007 _EGL_FUNC_START(disp, EGL_OBJECT_SYNC_KHR, s, EGL_FALSE);
2008 return _eglClientWaitSyncCommon(disp, dpy, s, flags, timeout);
2015 _EGLDisplay *disp = _eglLockDisplay(dpy);
2016 _EGLSync *s = _eglLookupSync(sync, disp);
2017 _EGL_FUNC_START(disp, EGL_OBJECT_SYNC_KHR, s, EGL_FALSE);
2018 return _eglClientWaitSyncCommon(disp, dpy, s, flags, timeout);
2023 _eglWaitSyncCommon(_EGLDisplay *disp, _EGLSync *s, EGLint flags)
2028 _EGL_CHECK_SYNC(disp, s, EGL_FALSE);
2029 assert(disp->Extensions.KHR_wait_sync);
2035 RETURN_EGL_ERROR(disp, EGL_BAD_MATCH, EGL_FALSE);
2039 RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_FALSE);
2041 ret = disp->Driver->WaitSyncKHR(disp, s);
2043 RETURN_EGL_EVAL(disp, ret);
2049 _EGLDisplay *disp = _eglLockDisplay(dpy);
2050 _EGLSync *s = _eglLookupSync(sync, disp);
2051 _EGL_FUNC_START(disp, EGL_OBJECT_SYNC_KHR, s, EGL_FALSE);
2052 return _eglWaitSyncCommon(disp, s, flags);
2063 _EGLDisplay *disp = _eglLockDisplay(dpy);
2064 _EGLSync *s = _eglLookupSync(sync, disp);
2065 _EGL_FUNC_START(disp, EGL_OBJECT_SYNC_KHR, s, EGL_FALSE);
2066 return _eglWaitSyncCommon(disp, s, flags);
2073 _EGLDisplay *disp = _eglLockDisplay(dpy);
2074 _EGLSync *s = _eglLookupSync(sync, disp);
2077 _EGL_FUNC_START(disp, EGL_OBJECT_SYNC_KHR, s, EGL_FALSE);
2079 _EGL_CHECK_SYNC(disp, s, EGL_FALSE);
2080 assert(disp->Extensions.KHR_reusable_sync);
2081 ret = disp->Driver->SignalSyncKHR(disp, s, mode);
2083 RETURN_EGL_EVAL(disp, ret);
2088 _eglGetSyncAttribCommon(_EGLDisplay *disp, _EGLSync *s, EGLint attribute, EGLAttrib *value)
2092 _EGL_CHECK_SYNC(disp, s, EGL_FALSE);
2093 assert(disp->Extensions.KHR_reusable_sync ||
2094 disp->Extensions.KHR_fence_sync ||
2095 disp->Extensions.ANDROID_native_fence_sync);
2097 ret = _eglGetSyncAttrib(disp, s, attribute, value);
2099 RETURN_EGL_EVAL(disp, ret);
2105 _EGLDisplay *disp = _eglLockDisplay(dpy);
2106 _EGLSync *s = _eglLookupSync(sync, disp);
2107 _EGL_FUNC_START(disp, EGL_OBJECT_SYNC_KHR, s, EGL_FALSE);
2110 RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_FALSE);
2112 return _eglGetSyncAttribCommon(disp, s, attribute, value);
2119 _EGLDisplay *disp = _eglLockDisplay(dpy);
2120 _EGLSync *s = _eglLookupSync(sync, disp);
2124 _EGL_FUNC_START(disp, EGL_OBJECT_SYNC_KHR, s, EGL_FALSE);
2127 RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_FALSE);
2130 result = _eglGetSyncAttribCommon(disp, s, attribute, &attrib);
2146 _EGLDisplay *disp = _eglLockDisplay(dpy);
2147 _EGLSync *s = _eglLookupSync(sync, disp);
2150 _EGL_FUNC_START(disp, EGL_OBJECT_SYNC_KHR, s, EGL_FALSE);
2157 RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_NO_NATIVE_FENCE_FD_ANDROID);
2159 _EGL_CHECK_SYNC(disp, s, EGL_NO_NATIVE_FENCE_FD_ANDROID);
2160 assert(disp->Extensions.ANDROID_native_fence_sync);
2161 ret = disp->Driver->DupNativeFenceFDANDROID(disp, s);
2163 RETURN_EGL_SUCCESS(disp, ret);
2171 _EGLDisplay *disp = _eglLockDisplay(dpy);
2172 _EGLSurface *surf = _eglLookupSurface(surface, disp);
2175 _EGL_FUNC_START(disp, EGL_OBJECT_SURFACE_KHR, surf, EGL_FALSE);
2177 _EGL_CHECK_SURFACE(disp, surf, EGL_FALSE);
2179 if (!disp->Extensions.NOK_swap_region)
2180 RETURN_EGL_EVAL(disp, EGL_FALSE);
2185 RETURN_EGL_ERROR(disp, EGL_BAD_SURFACE, EGL_FALSE);
2187 ret = disp->Driver->SwapBuffersRegionNOK(disp, surf, numRects, rects);
2189 RETURN_EGL_EVAL(disp, ret);
2196 _EGLDisplay *disp = _eglLockDisplay(dpy);
2200 _EGL_FUNC_START(disp, EGL_OBJECT_DISPLAY_KHR, NULL, EGL_FALSE);
2202 _EGL_CHECK_DISPLAY(disp, EGL_NO_IMAGE_KHR);
2203 if (!disp->Extensions.MESA_drm_image)
2204 RETURN_EGL_EVAL(disp, EGL_NO_IMAGE_KHR);
2206 img = disp->Driver->CreateDRMImageMESA(disp, attr_list);
2209 RETURN_EGL_EVAL(disp, ret);
2216 _EGLDisplay *disp = _eglLockDisplay(dpy);
2217 _EGLImage *img = _eglLookupImage(image, disp);
2220 _EGL_FUNC_START(disp, EGL_OBJECT_IMAGE_KHR, img, EGL_FALSE);
2222 _EGL_CHECK_DISPLAY(disp, EGL_FALSE);
2223 assert(disp->Extensions.MESA_drm_image);
2226 RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_FALSE);
2228 ret = disp->Driver->ExportDRMImageMESA(disp, img, name, handle, stride);
2230 RETURN_EGL_EVAL(disp, ret);
2239 _EGLDisplay *disp = _eglLockDisplay(dpy);
2242 _EGL_FUNC_START(disp, EGL_OBJECT_DISPLAY_KHR, NULL, EGL_FALSE);
2244 _EGL_CHECK_DISPLAY(disp, EGL_FALSE);
2245 assert(disp->Extensions.WL_bind_wayland_display);
2248 RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_FALSE);
2250 ret = disp->Driver->BindWaylandDisplayWL(disp, display);
2252 RETURN_EGL_EVAL(disp, ret);
2258 _EGLDisplay *disp = _eglLockDisplay(dpy);
2261 _EGL_FUNC_START(disp, EGL_OBJECT_DISPLAY_KHR, NULL, EGL_FALSE);
2263 _EGL_CHECK_DISPLAY(disp, EGL_FALSE);
2264 assert(disp->Extensions.WL_bind_wayland_display);
2267 RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_FALSE);
2269 ret = disp->Driver->UnbindWaylandDisplayWL(disp, display);
2271 RETURN_EGL_EVAL(disp, ret);
2278 _EGLDisplay *disp = _eglLockDisplay(dpy);
2281 _EGL_FUNC_START(disp, EGL_OBJECT_DISPLAY_KHR, NULL, EGL_FALSE);
2283 _EGL_CHECK_DISPLAY(disp, EGL_FALSE);
2284 assert(disp->Extensions.WL_bind_wayland_display);
2287 RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_FALSE);
2289 ret = disp->Driver->QueryWaylandBufferWL(disp, buffer, attribute, value);
2291 RETURN_EGL_EVAL(disp, ret);
2298 _EGLDisplay *disp = _eglLockDisplay(dpy);
2302 _EGL_FUNC_START(disp, EGL_OBJECT_DISPLAY_KHR, NULL, EGL_FALSE);
2304 _EGL_CHECK_DISPLAY(disp, NULL);
2305 if (!disp->Extensions.WL_create_wayland_buffer_from_image)
2306 RETURN_EGL_EVAL(disp, NULL);
2308 img = _eglLookupImage(image, disp);
2311 RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, NULL);
2313 ret = disp->Driver->CreateWaylandBufferFromImageWL(disp, img);
2315 RETURN_EGL_EVAL(disp, ret);
2322 _EGLDisplay *disp = _eglLockDisplay(dpy);
2323 _EGLSurface *surf = _eglLookupSurface(surface, disp);
2326 _EGL_FUNC_START(disp, EGL_OBJECT_SURFACE_KHR, surf, EGL_FALSE);
2328 _EGL_CHECK_SURFACE(disp, surf, EGL_FALSE);
2330 if (!disp->Extensions.NV_post_sub_buffer)
2331 RETURN_EGL_EVAL(disp, EGL_FALSE);
2333 ret = disp->Driver->PostSubBufferNV(disp, surf, x, y, width, height);
2335 RETURN_EGL_EVAL(disp, ret);
2343 _EGLDisplay *disp = _eglLockDisplay(dpy);
2344 _EGLSurface *surf = _eglLookupSurface(surface, disp);
2347 _EGL_FUNC_START(disp, EGL_OBJECT_SURFACE_KHR, surf, EGL_FALSE);
2349 _EGL_CHECK_SURFACE(disp, surf, EGL_FALSE);
2350 if (!disp->Extensions.CHROMIUM_sync_control)
2351 RETURN_EGL_EVAL(disp, EGL_FALSE);
2354 RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_FALSE);
2356 ret = disp->Driver->GetSyncValuesCHROMIUM(disp, surf, ust, msc, sbc);
2358 RETURN_EGL_EVAL(disp, ret);
2366 _EGLDisplay *disp = _eglLockDisplay(dpy);
2367 _EGLImage *img = _eglLookupImage(image, disp);
2370 _EGL_FUNC_START(disp, EGL_OBJECT_IMAGE_KHR, img, EGL_FALSE);
2372 _EGL_CHECK_DISPLAY(disp, EGL_FALSE);
2373 assert(disp->Extensions.MESA_image_dma_buf_export);
2376 RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_FALSE);
2378 ret = disp->Driver->ExportDMABUFImageQueryMESA(disp, img, fourcc, nplanes, modifiers);
2380 RETURN_EGL_EVAL(disp, ret);
2387 _EGLDisplay *disp = _eglLockDisplay(dpy);
2388 _EGLImage *img = _eglLookupImage(image, disp);
2391 _EGL_FUNC_START(disp, EGL_OBJECT_IMAGE_KHR, img, EGL_FALSE);
2393 _EGL_CHECK_DISPLAY(disp, EGL_FALSE);
2394 assert(disp->Extensions.MESA_image_dma_buf_export);
2397 RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_FALSE);
2399 ret = disp->Driver->ExportDMABUFImageMESA(disp, img, fds, strides, offsets);
2401 RETURN_EGL_EVAL(disp, ret);
2408 _EGLDisplay *disp = NULL;
2424 disp = _eglLockDisplay(dpy);
2425 if (disp == NULL)
2426 RETURN_EGL_ERROR(disp, EGL_BAD_DISPLAY, EGL_BAD_DISPLAY);
2430 RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_BAD_PARAMETER);
2432 disp->Label = label;
2433 RETURN_EGL_EVAL(disp, EGL_SUCCESS);
2451 RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_BAD_PARAMETER);
2454 if (_eglCheckResource(object, type, disp)) {
2458 RETURN_EGL_EVAL(disp, EGL_SUCCESS);
2461 RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_BAD_PARAMETER);
2555 _EGLDisplay *disp = _eglLockDisplay(dpy);
2560 _EGL_CHECK_DISPLAY(disp, EGL_FALSE);
2562 ret = disp->Driver->QueryDmaBufFormatsEXT(disp, max_formats, formats, num_formats);
2564 RETURN_EGL_EVAL(disp, ret);
2572 _EGLDisplay *disp = _eglLockDisplay(dpy);
2577 _EGL_CHECK_DISPLAY(disp, EGL_FALSE);
2579 ret = disp->Driver->QueryDmaBufModifiersEXT(disp, format, max_modifiers, modifiers,
2582 RETURN_EGL_EVAL(disp, ret);
2592 _EGLDisplay *disp = _eglLockDisplay(dpy);
2593 if (!_eglSetFuncName(__func__, disp, EGL_OBJECT_DISPLAY_KHR, NULL)) {
2594 if (disp)
2595 _eglUnlockDisplay(disp);
2599 if (!_eglCheckDisplay(disp, __func__)) {
2600 if (disp)
2601 _eglUnlockDisplay(disp);
2608 _eglUnlockDisplay(disp);
2612 if (disp->BlobCacheSet) {
2615 _eglUnlockDisplay(disp);
2619 disp->BlobCacheSet = set;
2620 disp->BlobCacheGet = get;
2622 disp->Driver->SetBlobCacheFuncsANDROID(disp, set, get);
2624 _eglUnlockDisplay(disp);
2674 _EGLDisplay *disp = _eglLockDisplay(dpy);
2677 _EGL_CHECK_DISPLAY(disp, EGL_FALSE);
2681 *value = (EGLAttrib) disp->Device;
2684 RETURN_EGL_ERROR(disp, EGL_BAD_ATTRIBUTE, EGL_FALSE);
2686 RETURN_EGL_SUCCESS(disp, EGL_TRUE);
2692 _EGLDisplay *disp = _eglLockDisplay(dpy);
2695 _EGL_FUNC_START(disp, EGL_NONE, NULL, NULL);
2696 _EGL_CHECK_DISPLAY(disp, NULL);
2698 assert(disp->Extensions.MESA_query_driver);
2700 ret = disp->Driver->QueryDriverConfig(disp);
2701 RETURN_EGL_EVAL(disp, ret);
2707 _EGLDisplay *disp = _eglLockDisplay(dpy);
2710 _EGL_FUNC_START(disp, EGL_NONE, NULL, NULL);
2711 _EGL_CHECK_DISPLAY(disp, NULL);
2713 assert(disp->Extensions.MESA_query_driver);
2715 ret = disp->Driver->QueryDriverName(disp);
2716 RETURN_EGL_EVAL(disp, ret);
2752 _EGLDisplay **disp, _EGLContext **ctx)
2755 *disp = _eglLockDisplay(dpy);
2756 if (!*disp || !(*disp)->Initialized || !(*disp)->Driver) {
2757 if (*disp)
2758 _eglUnlockDisplay(*disp);
2762 *ctx = _eglLookupContext(context, *disp);
2766 _eglUnlockDisplay(*disp);
2777 _EGLDisplay *disp;
2781 ret = _eglLockDisplayInterop(dpy, context, &disp, &ctx);
2785 if (disp->Driver->GLInteropQueryDeviceInfo)
2786 ret = disp->Driver->GLInteropQueryDeviceInfo(disp, ctx, out);
2790 _eglUnlockDisplay(disp);
2799 _EGLDisplay *disp;
2803 ret = _eglLockDisplayInterop(dpy, context, &disp, &ctx);
2807 if (disp->Driver->GLInteropExportObject)
2808 ret = disp->Driver->GLInteropExportObject(disp, ctx, in, out);
2812 _eglUnlockDisplay(disp);