Merge commit 'origin/gallium-master-merge'
[mesa.git] / src / egl / main / eglapi.c
1 /**
2 * Public EGL API entrypoints
3 *
4 * Generally, we use the EGLDisplay parameter as a key to lookup the
5 * appropriate device driver handle, then jump though the driver's
6 * dispatch table to handle the function.
7 *
8 * That allows us the option of supporting multiple, simultaneous,
9 * heterogeneous hardware devices in the future.
10 *
11 * The EGLDisplay, EGLConfig, EGLContext and EGLSurface types are
12 * opaque handles implemented with 32-bit unsigned integers.
13 * It's up to the driver function or fallback function to look up the
14 * handle and get an object.
15 * By using opaque handles, we leave open the possibility of having
16 * indirect rendering in the future, like GLX.
17 *
18 *
19 * Notes on naming conventions:
20 *
21 * eglFooBar - public EGL function
22 * EGL_FOO_BAR - public EGL token
23 * EGLDatatype - public EGL datatype
24 *
25 * _eglFooBar - private EGL function
26 * _EGLDatatype - private EGL datatype, typedef'd struct
27 * _egl_struct - private EGL struct, non-typedef'd
28 *
29 */
30
31
32
33 #include <stdio.h>
34 #include <stdlib.h>
35 #include <string.h>
36 #include "eglcontext.h"
37 #include "egldisplay.h"
38 #include "egltypedefs.h"
39 #include "eglglobals.h"
40 #include "egldriver.h"
41 #include "eglsurface.h"
42
43
44
45 /**
46 * This is typically the first EGL function that an application calls.
47 * We initialize our global vars and create a private _EGLDisplay object.
48 */
49 EGLDisplay EGLAPIENTRY
50 eglGetDisplay(NativeDisplayType nativeDisplay)
51 {
52 _EGLDisplay *dpy;
53 _eglInitGlobals();
54 dpy = _eglNewDisplay(nativeDisplay);
55 return _eglGetDisplayHandle(dpy);
56 }
57
58
59 /**
60 * This is typically the second EGL function that an application calls.
61 * Here we load/initialize the actual hardware driver.
62 */
63 EGLBoolean EGLAPIENTRY
64 eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor)
65 {
66 EGLint major_int, minor_int;
67
68 if (dpy) {
69 EGLBoolean retVal;
70 _EGLDisplay *dpyPriv = _eglLookupDisplay(dpy);
71 if (!dpyPriv) {
72 return EGL_FALSE;
73 }
74 dpyPriv->Driver = _eglOpenDriver(dpyPriv,
75 dpyPriv->DriverName,
76 dpyPriv->DriverArgs);
77 if (!dpyPriv->Driver) {
78 return EGL_FALSE;
79 }
80 /* Initialize the particular driver now */
81 retVal = dpyPriv->Driver->API.Initialize(dpyPriv->Driver, dpy,
82 &major_int, &minor_int);
83
84 dpyPriv->Driver->APImajor = major_int;
85 dpyPriv->Driver->APIminor = minor_int;
86 snprintf(dpyPriv->Driver->Version, sizeof(dpyPriv->Driver->Version),
87 "%d.%d (%s)", major_int, minor_int, dpyPriv->Driver->Name);
88
89 /* Update applications version of major and minor if not NULL */
90 if((major != NULL) && (minor != NULL))
91 {
92 *major = major_int;
93 *minor = minor_int;
94 }
95
96 return retVal;
97 }
98 return EGL_FALSE;
99 }
100
101
102 EGLBoolean EGLAPIENTRY
103 eglTerminate(EGLDisplay dpy)
104 {
105 _EGLDriver *drv = _eglLookupDriver(dpy);
106 if (drv)
107 return _eglCloseDriver(drv, dpy);
108 else
109 return EGL_FALSE;
110 }
111
112
113 const char * EGLAPIENTRY
114 eglQueryString(EGLDisplay dpy, EGLint name)
115 {
116 _EGLDriver *drv = _eglLookupDriver(dpy);
117 if (drv)
118 return drv->API.QueryString(drv, dpy, name);
119 else
120 return NULL;
121 }
122
123
124 EGLBoolean EGLAPIENTRY
125 eglGetConfigs(EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config)
126 {
127 _EGLDriver *drv = _eglLookupDriver(dpy);
128 /* XXX check drv for null in remaining functions */
129 return drv->API.GetConfigs(drv, dpy, configs, config_size, num_config);
130 }
131
132
133 EGLBoolean EGLAPIENTRY
134 eglChooseConfig(EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config)
135 {
136 _EGLDriver *drv = _eglLookupDriver(dpy);
137 return drv->API.ChooseConfig(drv, dpy, attrib_list, configs, config_size, num_config);
138 }
139
140
141 EGLBoolean EGLAPIENTRY
142 eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value)
143 {
144 _EGLDriver *drv = _eglLookupDriver(dpy);
145 return drv->API.GetConfigAttrib(drv, dpy, config, attribute, value);
146 }
147
148
149 EGLContext EGLAPIENTRY
150 eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_list, const EGLint *attrib_list)
151 {
152 _EGLDriver *drv = _eglLookupDriver(dpy);
153 return drv->API.CreateContext(drv, dpy, config, share_list, attrib_list);
154 }
155
156
157 EGLBoolean EGLAPIENTRY
158 eglDestroyContext(EGLDisplay dpy, EGLContext ctx)
159 {
160 _EGLDriver *drv = _eglLookupDriver(dpy);
161 return drv->API.DestroyContext(drv, dpy, ctx);
162 }
163
164
165 EGLBoolean EGLAPIENTRY
166 eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx)
167 {
168 _EGLDriver *drv = _eglLookupDriver(dpy);
169 return drv->API.MakeCurrent(drv, dpy, draw, read, ctx);
170 }
171
172
173 EGLBoolean EGLAPIENTRY
174 eglQueryContext(EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value)
175 {
176 _EGLDriver *drv = _eglLookupDriver(dpy);
177 return drv->API.QueryContext(drv, dpy, ctx, attribute, value);
178 }
179
180
181 EGLSurface EGLAPIENTRY
182 eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, NativeWindowType window, const EGLint *attrib_list)
183 {
184 _EGLDriver *drv = _eglLookupDriver(dpy);
185 return drv->API.CreateWindowSurface(drv, dpy, config, window, attrib_list);
186 }
187
188
189 EGLSurface EGLAPIENTRY
190 eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig config, NativePixmapType pixmap, const EGLint *attrib_list)
191 {
192 _EGLDriver *drv = _eglLookupDriver(dpy);
193 return drv->API.CreatePixmapSurface(drv, dpy, config, pixmap, attrib_list);
194 }
195
196
197 EGLSurface EGLAPIENTRY
198 eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list)
199 {
200 _EGLDriver *drv = _eglLookupDriver(dpy);
201 return drv->API.CreatePbufferSurface(drv, dpy, config, attrib_list);
202 }
203
204
205 EGLBoolean EGLAPIENTRY
206 eglDestroySurface(EGLDisplay dpy, EGLSurface surface)
207 {
208 _EGLDriver *drv = _eglLookupDriver(dpy);
209 return drv->API.DestroySurface(drv, dpy, surface);
210 }
211
212
213 EGLBoolean EGLAPIENTRY
214 eglQuerySurface(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value)
215 {
216 _EGLDriver *drv = _eglLookupDriver(dpy);
217 return drv->API.QuerySurface(drv, dpy, surface, attribute, value);
218 }
219
220
221 EGLBoolean EGLAPIENTRY
222 eglSurfaceAttrib(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value)
223 {
224 _EGLDriver *drv = _eglLookupDriver(dpy);
225 return drv->API.SurfaceAttrib(drv, dpy, surface, attribute, value);
226 }
227
228
229 EGLBoolean EGLAPIENTRY
230 eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer)
231 {
232 _EGLDriver *drv = _eglLookupDriver(dpy);
233 return drv->API.BindTexImage(drv, dpy, surface, buffer);
234 }
235
236
237 EGLBoolean EGLAPIENTRY
238 eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer)
239 {
240 _EGLDriver *drv = _eglLookupDriver(dpy);
241 return drv->API.ReleaseTexImage(drv, dpy, surface, buffer);
242 }
243
244
245 EGLBoolean EGLAPIENTRY
246 eglSwapInterval(EGLDisplay dpy, EGLint interval)
247 {
248 _EGLDriver *drv = _eglLookupDriver(dpy);
249 return drv->API.SwapInterval(drv, dpy, interval);
250 }
251
252
253 EGLBoolean EGLAPIENTRY
254 eglSwapBuffers(EGLDisplay dpy, EGLSurface draw)
255 {
256 _EGLDriver *drv = _eglLookupDriver(dpy);
257 return drv->API.SwapBuffers(drv, dpy, draw);
258 }
259
260
261 EGLBoolean EGLAPIENTRY
262 eglCopyBuffers(EGLDisplay dpy, EGLSurface surface, NativePixmapType target)
263 {
264 _EGLDriver *drv = _eglLookupDriver(dpy);
265 return drv->API.CopyBuffers(drv, dpy, surface, target);
266 }
267
268
269 EGLBoolean EGLAPIENTRY
270 eglWaitGL(void)
271 {
272 EGLDisplay dpy = eglGetCurrentDisplay();
273 if (dpy != EGL_NO_DISPLAY) {
274 _EGLDriver *drv = _eglLookupDriver(dpy);
275 return drv->API.WaitGL(drv, dpy);
276 }
277 else
278 return EGL_FALSE;
279 }
280
281
282 EGLBoolean EGLAPIENTRY
283 eglWaitNative(EGLint engine)
284 {
285 EGLDisplay dpy = eglGetCurrentDisplay();
286 if (dpy != EGL_NO_DISPLAY) {
287 _EGLDriver *drv = _eglLookupDriver(dpy);
288 return drv->API.WaitNative(drv, dpy, engine);
289 }
290 else
291 return EGL_FALSE;
292 }
293
294
295 EGLDisplay EGLAPIENTRY
296 eglGetCurrentDisplay(void)
297 {
298 _EGLDisplay *dpy = _eglGetCurrentDisplay();
299 return _eglGetDisplayHandle(dpy);
300 }
301
302
303 EGLContext EGLAPIENTRY
304 eglGetCurrentContext(void)
305 {
306 _EGLContext *ctx = _eglGetCurrentContext();
307 return _eglGetContextHandle(ctx);
308 }
309
310
311 EGLSurface EGLAPIENTRY
312 eglGetCurrentSurface(EGLint readdraw)
313 {
314 _EGLSurface *s = _eglGetCurrentSurface(readdraw);
315 return _eglGetSurfaceHandle(s);
316 }
317
318
319 EGLint EGLAPIENTRY
320 eglGetError(void)
321 {
322 _EGLThreadInfo *t = _eglGetCurrentThread();
323 EGLint e = t->LastError;
324 t->LastError = EGL_SUCCESS;
325 return e;
326 }
327
328
329 void (* EGLAPIENTRY eglGetProcAddress(const char *procname))()
330 {
331 typedef void (*genericFunc)();
332 struct name_function {
333 const char *name;
334 _EGLProc function;
335 };
336 static struct name_function egl_functions[] = {
337 /* alphabetical order */
338 { "eglBindTexImage", (_EGLProc) eglBindTexImage },
339 { "eglChooseConfig", (_EGLProc) eglChooseConfig },
340 { "eglCopyBuffers", (_EGLProc) eglCopyBuffers },
341 { "eglCreateContext", (_EGLProc) eglCreateContext },
342 { "eglCreatePbufferSurface", (_EGLProc) eglCreatePbufferSurface },
343 { "eglCreatePixmapSurface", (_EGLProc) eglCreatePixmapSurface },
344 { "eglCreateWindowSurface", (_EGLProc) eglCreateWindowSurface },
345 { "eglDestroyContext", (_EGLProc) eglDestroyContext },
346 { "eglDestroySurface", (_EGLProc) eglDestroySurface },
347 { "eglGetConfigAttrib", (_EGLProc) eglGetConfigAttrib },
348 { "eglGetConfigs", (_EGLProc) eglGetConfigs },
349 { "eglGetCurrentContext", (_EGLProc) eglGetCurrentContext },
350 { "eglGetCurrentDisplay", (_EGLProc) eglGetCurrentDisplay },
351 { "eglGetCurrentSurface", (_EGLProc) eglGetCurrentSurface },
352 { "eglGetDisplay", (_EGLProc) eglGetDisplay },
353 { "eglGetError", (_EGLProc) eglGetError },
354 { "eglGetProcAddress", (_EGLProc) eglGetProcAddress },
355 { "eglInitialize", (_EGLProc) eglInitialize },
356 { "eglMakeCurrent", (_EGLProc) eglMakeCurrent },
357 { "eglQueryContext", (_EGLProc) eglQueryContext },
358 { "eglQueryString", (_EGLProc) eglQueryString },
359 { "eglQuerySurface", (_EGLProc) eglQuerySurface },
360 { "eglReleaseTexImage", (_EGLProc) eglReleaseTexImage },
361 { "eglSurfaceAttrib", (_EGLProc) eglSurfaceAttrib },
362 { "eglSwapBuffers", (_EGLProc) eglSwapBuffers },
363 { "eglSwapInterval", (_EGLProc) eglSwapInterval },
364 { "eglTerminate", (_EGLProc) eglTerminate },
365 { "eglWaitGL", (_EGLProc) eglWaitGL },
366 { "eglWaitNative", (_EGLProc) eglWaitNative },
367 /* Extensions */
368 #ifdef EGL_MESA_screen_surface
369 { "eglChooseModeMESA", (_EGLProc) eglChooseModeMESA },
370 { "eglGetModesMESA", (_EGLProc) eglGetModesMESA },
371 { "eglGetModeAttribMESA", (_EGLProc) eglGetModeAttribMESA },
372 { "eglCopyContextMESA", (_EGLProc) eglCopyContextMESA },
373 { "eglGetScreensMESA", (_EGLProc) eglGetScreensMESA },
374 { "eglCreateScreenSurfaceMESA", (_EGLProc) eglCreateScreenSurfaceMESA },
375 { "eglShowScreenSurfaceMESA", (_EGLProc) eglShowScreenSurfaceMESA },
376 { "eglScreenPositionMESA", (_EGLProc) eglScreenPositionMESA },
377 { "eglQueryScreenMESA", (_EGLProc) eglQueryScreenMESA },
378 { "eglQueryScreenSurfaceMESA", (_EGLProc) eglQueryScreenSurfaceMESA },
379 { "eglQueryScreenModeMESA", (_EGLProc) eglQueryScreenModeMESA },
380 { "eglQueryModeStringMESA", (_EGLProc) eglQueryModeStringMESA },
381 #endif /* EGL_MESA_screen_surface */
382 #ifdef EGL_VERSION_1_2
383 { "eglBindAPI", (_EGLProc) eglBindAPI },
384 { "eglCreatePbufferFromClientBuffer", (_EGLProc) eglCreatePbufferFromClientBuffer },
385 { "eglQueryAPI", (_EGLProc) eglQueryAPI },
386 { "eglReleaseThread", (_EGLProc) eglReleaseThread },
387 { "eglWaitClient", (_EGLProc) eglWaitClient },
388 #endif /* EGL_VERSION_1_2 */
389 { NULL, NULL }
390 };
391 EGLint i;
392 for (i = 0; egl_functions[i].name; i++) {
393 if (strcmp(egl_functions[i].name, procname) == 0) {
394 return (genericFunc) egl_functions[i].function;
395 }
396 }
397
398 /* now loop over drivers to query their procs */
399 for (i = 0; i < _eglGlobal.NumDrivers; i++) {
400 _EGLProc p = _eglGlobal.Drivers[i]->API.GetProcAddress(procname);
401 if (p)
402 return p;
403 }
404
405 return NULL;
406 }
407
408
409 /*
410 * EGL_MESA_screen extension
411 */
412
413 EGLBoolean EGLAPIENTRY
414 eglChooseModeMESA(EGLDisplay dpy, EGLScreenMESA screen,
415 const EGLint *attrib_list, EGLModeMESA *modes,
416 EGLint modes_size, EGLint *num_modes)
417 {
418 _EGLDriver *drv = _eglLookupDriver(dpy);
419 if (drv)
420 return drv->API.ChooseModeMESA(drv, dpy, screen, attrib_list, modes, modes_size, num_modes);
421 else
422 return EGL_FALSE;
423 }
424
425
426 EGLBoolean EGLAPIENTRY
427 eglGetModesMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *modes, EGLint mode_size, EGLint *num_mode)
428 {
429 _EGLDriver *drv = _eglLookupDriver(dpy);
430 if (drv)
431 return drv->API.GetModesMESA(drv, dpy, screen, modes, mode_size, num_mode);
432 else
433 return EGL_FALSE;
434 }
435
436
437 EGLBoolean EGLAPIENTRY
438 eglGetModeAttribMESA(EGLDisplay dpy, EGLModeMESA mode, EGLint attribute, EGLint *value)
439 {
440 _EGLDriver *drv = _eglLookupDriver(dpy);
441 if (drv)
442 return drv->API.GetModeAttribMESA(drv, dpy, mode, attribute, value);
443 else
444 return EGL_FALSE;
445 }
446
447
448 EGLBoolean EGLAPIENTRY
449 eglCopyContextMESA(EGLDisplay dpy, EGLContext source, EGLContext dest, EGLint mask)
450 {
451 _EGLDriver *drv = _eglLookupDriver(dpy);
452 if (drv)
453 return drv->API.CopyContextMESA(drv, dpy, source, dest, mask);
454 else
455 return EGL_FALSE;
456 }
457
458
459 EGLBoolean
460 eglGetScreensMESA(EGLDisplay dpy, EGLScreenMESA *screens, EGLint max_screens, EGLint *num_screens)
461 {
462 _EGLDriver *drv = _eglLookupDriver(dpy);
463 if (drv)
464 return drv->API.GetScreensMESA(drv, dpy, screens, max_screens, num_screens);
465 else
466 return EGL_FALSE;
467 }
468
469
470 EGLSurface
471 eglCreateScreenSurfaceMESA(EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list)
472 {
473 _EGLDriver *drv = _eglLookupDriver(dpy);
474 return drv->API.CreateScreenSurfaceMESA(drv, dpy, config, attrib_list);
475 }
476
477
478 EGLBoolean
479 eglShowScreenSurfaceMESA(EGLDisplay dpy, EGLint screen, EGLSurface surface, EGLModeMESA mode)
480 {
481 _EGLDriver *drv = _eglLookupDriver(dpy);
482 return drv->API.ShowScreenSurfaceMESA(drv, dpy, screen, surface, mode);
483 }
484
485
486 EGLBoolean
487 eglScreenPositionMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLint x, EGLint y)
488 {
489 _EGLDriver *drv = _eglLookupDriver(dpy);
490 return drv->API.ScreenPositionMESA(drv, dpy, screen, x, y);
491 }
492
493
494 EGLBoolean
495 eglQueryScreenMESA( EGLDisplay dpy, EGLScreenMESA screen, EGLint attribute, EGLint *value)
496 {
497 _EGLDriver *drv = _eglLookupDriver(dpy);
498 return drv->API.QueryScreenMESA(drv, dpy, screen, attribute, value);
499 }
500
501
502 EGLBoolean
503 eglQueryScreenSurfaceMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLSurface *surface)
504 {
505 _EGLDriver *drv = _eglLookupDriver(dpy);
506 return drv->API.QueryScreenSurfaceMESA(drv, dpy, screen, surface);
507 }
508
509
510 EGLBoolean
511 eglQueryScreenModeMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *mode)
512 {
513 _EGLDriver *drv = _eglLookupDriver(dpy);
514 return drv->API.QueryScreenModeMESA(drv, dpy, screen, mode);
515 }
516
517
518 const char *
519 eglQueryModeStringMESA(EGLDisplay dpy, EGLModeMESA mode)
520 {
521 _EGLDriver *drv = _eglLookupDriver(dpy);
522 return drv->API.QueryModeStringMESA(drv, dpy, mode);
523 }
524
525
526 /**
527 ** EGL 1.2
528 **/
529
530 #ifdef EGL_VERSION_1_2
531
532
533 /**
534 * Specify the client API to use for subsequent calls including:
535 * eglCreateContext()
536 * eglGetCurrentContext()
537 * eglGetCurrentDisplay()
538 * eglGetCurrentSurface()
539 * eglMakeCurrent(when the ctx parameter is EGL NO CONTEXT)
540 * eglWaitClient()
541 * eglWaitNative()
542 * See section 3.7 "Rendering Context" in the EGL specification for details.
543 */
544 EGLBoolean
545 eglBindAPI(EGLenum api)
546 {
547 _EGLThreadInfo *t = _eglGetCurrentThread();
548
549 switch (api) {
550 #ifdef EGL_VERSION_1_4
551 case EGL_OPENGL_API:
552 if (_eglGlobal.ClientAPIsMask & EGL_OPENGL_BIT) {
553 t->CurrentAPI = api;
554 return EGL_TRUE;
555 }
556 _eglError(EGL_BAD_PARAMETER, "eglBindAPI");
557 return EGL_FALSE;
558 #endif
559 case EGL_OPENGL_ES_API:
560 if (_eglGlobal.ClientAPIsMask & (EGL_OPENGL_ES_BIT | EGL_OPENGL_ES2_BIT)) {
561 t->CurrentAPI = api;
562 return EGL_TRUE;
563 }
564 _eglError(EGL_BAD_PARAMETER, "eglBindAPI");
565 return EGL_FALSE;
566 case EGL_OPENVG_API:
567 if (_eglGlobal.ClientAPIsMask & EGL_OPENVG_BIT) {
568 t->CurrentAPI = api;
569 return EGL_TRUE;
570 }
571 _eglError(EGL_BAD_PARAMETER, "eglBindAPI");
572 return EGL_FALSE;
573 default:
574 return EGL_FALSE;
575 }
576 return EGL_TRUE;
577 }
578
579
580 /**
581 * Return the last value set with eglBindAPI().
582 */
583 EGLenum
584 eglQueryAPI(void)
585 {
586 /* returns one of EGL_OPENGL_API, EGL_OPENGL_ES_API or EGL_OPENVG_API */
587 _EGLThreadInfo *t = _eglGetCurrentThread();
588 return t->CurrentAPI;
589 }
590
591
592 EGLSurface
593 eglCreatePbufferFromClientBuffer(EGLDisplay dpy, EGLenum buftype,
594 EGLClientBuffer buffer, EGLConfig config,
595 const EGLint *attrib_list)
596 {
597 _EGLDriver *drv = _eglLookupDriver(dpy);
598 return drv->API.CreatePbufferFromClientBuffer(drv, dpy, buftype, buffer,
599 config, attrib_list);
600 }
601
602
603 EGLBoolean
604 eglReleaseThread(void)
605 {
606 _EGLThreadInfo *t = _eglGetCurrentThread();
607 EGLDisplay dpy = eglGetCurrentDisplay();
608 if (dpy) {
609 _EGLDriver *drv = _eglLookupDriver(dpy);
610 /* unbind context */
611 (void) drv->API.MakeCurrent(drv, dpy, EGL_NO_SURFACE,
612 EGL_NO_SURFACE, EGL_NO_CONTEXT);
613 }
614 _eglDeleteThreadData(t);
615 return EGL_TRUE;
616 }
617
618
619 EGLBoolean
620 eglWaitClient(void)
621 {
622 EGLDisplay dpy = eglGetCurrentDisplay();
623 if (dpy != EGL_NO_DISPLAY) {
624 _EGLDriver *drv = _eglLookupDriver(dpy);
625 return drv->API.WaitClient(drv, dpy);
626 }
627 else
628 return EGL_FALSE;
629 }
630
631 #endif /* EGL_VERSION_1_2 */