2 * Mesa 3-D graphics library
4 * Copyright (C) 2010-2011 Chia-I Wu <olvaffe@gmail.com>
5 * Copyright (C) 2010-2011 LunarG Inc.
7 * Based on platform_x11, which has
9 * Copyright © 2011 Intel Corporation
11 * Permission is hereby granted, free of charge, to any person obtaining a
12 * copy of this software and associated documentation files (the "Software"),
13 * to deal in the Software without restriction, including without limitation
14 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
15 * and/or sell copies of the Software, and to permit persons to whom the
16 * Software is furnished to do so, subject to the following conditions:
18 * The above copyright notice and this permission notice shall be included
19 * in all copies or substantial portions of the Software.
21 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
24 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
27 * DEALINGS IN THE SOFTWARE.
34 #if ANDROID_VERSION >= 0x402
35 #include <sync/sync.h>
40 #include "egl_dri2_fallbacks.h"
41 #include "gralloc_drm.h"
44 get_format_bpp(int native
)
49 case HAL_PIXEL_FORMAT_RGBA_8888
:
50 case HAL_PIXEL_FORMAT_RGBX_8888
:
51 case HAL_PIXEL_FORMAT_BGRA_8888
:
54 case HAL_PIXEL_FORMAT_RGB_888
:
57 case HAL_PIXEL_FORMAT_RGB_565
:
68 static int get_format(int format
)
71 case HAL_PIXEL_FORMAT_BGRA_8888
: return __DRI_IMAGE_FORMAT_ARGB8888
;
72 case HAL_PIXEL_FORMAT_RGB_565
: return __DRI_IMAGE_FORMAT_RGB565
;
73 case HAL_PIXEL_FORMAT_RGBA_8888
: return __DRI_IMAGE_FORMAT_ABGR8888
;
74 case HAL_PIXEL_FORMAT_RGBX_8888
: return __DRI_IMAGE_FORMAT_XBGR8888
;
75 case HAL_PIXEL_FORMAT_RGB_888
:
78 _eglLog(_EGL_WARNING
, "unsupported native buffer format 0x%x", format
);
83 get_native_buffer_name(struct ANativeWindowBuffer
*buf
)
85 return gralloc_drm_get_gem_handle(buf
->handle
);
89 droid_window_dequeue_buffer(struct dri2_egl_surface
*dri2_surf
)
91 #if ANDROID_VERSION >= 0x0402
94 if (dri2_surf
->window
->dequeueBuffer(dri2_surf
->window
, &dri2_surf
->buffer
,
98 /* If access to the buffer is controlled by a sync fence, then block on the
101 * It may be more performant to postpone blocking until there is an
102 * immediate need to write to the buffer. But doing so would require adding
103 * hooks to the DRI2 loader.
105 * From the ANativeWindow::dequeueBuffer documentation:
107 * The libsync fence file descriptor returned in the int pointed to by
108 * the fenceFd argument will refer to the fence that must signal
109 * before the dequeued buffer may be written to. A value of -1
110 * indicates that the caller may access the buffer immediately without
111 * waiting on a fence. If a valid file descriptor is returned (i.e.
112 * any value except -1) then the caller is responsible for closing the
116 /* From the SYNC_IOC_WAIT documentation in <linux/sync.h>:
118 * Waits indefinitely if timeout < 0.
121 sync_wait(fence_fd
, timeout
);
125 dri2_surf
->buffer
->common
.incRef(&dri2_surf
->buffer
->common
);
127 if (dri2_surf
->window
->dequeueBuffer(dri2_surf
->window
, &dri2_surf
->buffer
))
130 dri2_surf
->buffer
->common
.incRef(&dri2_surf
->buffer
->common
);
131 dri2_surf
->window
->lockBuffer(dri2_surf
->window
, dri2_surf
->buffer
);
138 droid_window_enqueue_buffer(struct dri2_egl_surface
*dri2_surf
)
140 #if ANDROID_VERSION >= 0x0402
141 /* Queue the buffer without a sync fence. This informs the ANativeWindow
142 * that it may access the buffer immediately.
144 * From ANativeWindow::dequeueBuffer:
146 * The fenceFd argument specifies a libsync fence file descriptor for
147 * a fence that must signal before the buffer can be accessed. If
148 * the buffer can be accessed immediately then a value of -1 should
149 * be used. The caller must not use the file descriptor after it
150 * is passed to queueBuffer, and the ANativeWindow implementation
151 * is responsible for closing it.
154 dri2_surf
->window
->queueBuffer(dri2_surf
->window
, dri2_surf
->buffer
,
157 dri2_surf
->window
->queueBuffer(dri2_surf
->window
, dri2_surf
->buffer
);
160 dri2_surf
->buffer
->common
.decRef(&dri2_surf
->buffer
->common
);
161 dri2_surf
->buffer
= NULL
;
167 droid_window_cancel_buffer(struct dri2_egl_surface
*dri2_surf
)
169 /* no cancel buffer? */
170 droid_window_enqueue_buffer(dri2_surf
);
174 droid_alloc_local_buffer(struct dri2_egl_surface
*dri2_surf
,
175 unsigned int att
, unsigned int format
)
177 struct dri2_egl_display
*dri2_dpy
=
178 dri2_egl_display(dri2_surf
->base
.Resource
.Display
);
180 if (att
>= ARRAY_SIZE(dri2_surf
->local_buffers
))
183 if (!dri2_surf
->local_buffers
[att
]) {
184 dri2_surf
->local_buffers
[att
] =
185 dri2_dpy
->dri2
->allocateBuffer(dri2_dpy
->dri_screen
, att
, format
,
186 dri2_surf
->base
.Width
, dri2_surf
->base
.Height
);
189 return dri2_surf
->local_buffers
[att
];
193 droid_free_local_buffers(struct dri2_egl_surface
*dri2_surf
)
195 struct dri2_egl_display
*dri2_dpy
=
196 dri2_egl_display(dri2_surf
->base
.Resource
.Display
);
199 for (i
= 0; i
< ARRAY_SIZE(dri2_surf
->local_buffers
); i
++) {
200 if (dri2_surf
->local_buffers
[i
]) {
201 dri2_dpy
->dri2
->releaseBuffer(dri2_dpy
->dri_screen
,
202 dri2_surf
->local_buffers
[i
]);
203 dri2_surf
->local_buffers
[i
] = NULL
;
209 droid_create_surface(_EGLDriver
*drv
, _EGLDisplay
*disp
, EGLint type
,
210 _EGLConfig
*conf
, void *native_window
,
211 const EGLint
*attrib_list
)
213 struct dri2_egl_display
*dri2_dpy
= dri2_egl_display(disp
);
214 struct dri2_egl_config
*dri2_conf
= dri2_egl_config(conf
);
215 struct dri2_egl_surface
*dri2_surf
;
216 struct ANativeWindow
*window
= native_window
;
217 const __DRIconfig
*config
;
219 dri2_surf
= calloc(1, sizeof *dri2_surf
);
221 _eglError(EGL_BAD_ALLOC
, "droid_create_surface");
225 if (!_eglInitSurface(&dri2_surf
->base
, disp
, type
, conf
, attrib_list
))
226 goto cleanup_surface
;
228 if (type
== EGL_WINDOW_BIT
) {
231 if (!window
|| window
->common
.magic
!= ANDROID_NATIVE_WINDOW_MAGIC
) {
232 _eglError(EGL_BAD_NATIVE_WINDOW
, "droid_create_surface");
233 goto cleanup_surface
;
235 if (window
->query(window
, NATIVE_WINDOW_FORMAT
, &format
)) {
236 _eglError(EGL_BAD_NATIVE_WINDOW
, "droid_create_surface");
237 goto cleanup_surface
;
240 if (format
!= dri2_conf
->base
.NativeVisualID
) {
241 _eglLog(_EGL_WARNING
, "Native format mismatch: 0x%x != 0x%x",
242 format
, dri2_conf
->base
.NativeVisualID
);
245 window
->query(window
, NATIVE_WINDOW_WIDTH
, &dri2_surf
->base
.Width
);
246 window
->query(window
, NATIVE_WINDOW_HEIGHT
, &dri2_surf
->base
.Height
);
249 config
= dri2_get_dri_config(dri2_conf
, EGL_WINDOW_BIT
,
250 dri2_surf
->base
.GLColorspace
);
252 dri2_surf
->dri_drawable
=
253 (*dri2_dpy
->dri2
->createNewDrawable
)(dri2_dpy
->dri_screen
, config
,
255 if (dri2_surf
->dri_drawable
== NULL
) {
256 _eglError(EGL_BAD_ALLOC
, "dri2->createNewDrawable");
257 goto cleanup_surface
;
261 window
->common
.incRef(&window
->common
);
262 dri2_surf
->window
= window
;
265 return &dri2_surf
->base
;
274 droid_create_window_surface(_EGLDriver
*drv
, _EGLDisplay
*disp
,
275 _EGLConfig
*conf
, void *native_window
,
276 const EGLint
*attrib_list
)
278 return droid_create_surface(drv
, disp
, EGL_WINDOW_BIT
, conf
,
279 native_window
, attrib_list
);
283 droid_create_pbuffer_surface(_EGLDriver
*drv
, _EGLDisplay
*disp
,
284 _EGLConfig
*conf
, const EGLint
*attrib_list
)
286 return droid_create_surface(drv
, disp
, EGL_PBUFFER_BIT
, conf
,
291 droid_destroy_surface(_EGLDriver
*drv
, _EGLDisplay
*disp
, _EGLSurface
*surf
)
293 struct dri2_egl_display
*dri2_dpy
= dri2_egl_display(disp
);
294 struct dri2_egl_surface
*dri2_surf
= dri2_egl_surface(surf
);
296 if (!_eglPutSurface(surf
))
299 droid_free_local_buffers(dri2_surf
);
301 if (dri2_surf
->base
.Type
== EGL_WINDOW_BIT
) {
302 if (dri2_surf
->buffer
)
303 droid_window_cancel_buffer(dri2_surf
);
305 dri2_surf
->window
->common
.decRef(&dri2_surf
->window
->common
);
308 (*dri2_dpy
->core
->destroyDrawable
)(dri2_surf
->dri_drawable
);
316 update_buffers(struct dri2_egl_surface
*dri2_surf
)
318 if (dri2_surf
->base
.Type
!= EGL_WINDOW_BIT
)
321 /* try to dequeue the next back buffer */
322 if (!dri2_surf
->buffer
&& !droid_window_dequeue_buffer(dri2_surf
))
325 /* free outdated buffers and update the surface size */
326 if (dri2_surf
->base
.Width
!= dri2_surf
->buffer
->width
||
327 dri2_surf
->base
.Height
!= dri2_surf
->buffer
->height
) {
328 droid_free_local_buffers(dri2_surf
);
329 dri2_surf
->base
.Width
= dri2_surf
->buffer
->width
;
330 dri2_surf
->base
.Height
= dri2_surf
->buffer
->height
;
337 droid_swap_buffers(_EGLDriver
*drv
, _EGLDisplay
*disp
, _EGLSurface
*draw
)
339 struct dri2_egl_driver
*dri2_drv
= dri2_egl_driver(drv
);
340 struct dri2_egl_display
*dri2_dpy
= dri2_egl_display(disp
);
341 struct dri2_egl_surface
*dri2_surf
= dri2_egl_surface(draw
);
344 if (dri2_surf
->base
.Type
!= EGL_WINDOW_BIT
)
347 if (dri2_drv
->glFlush
) {
348 ctx
= _eglGetCurrentContext();
349 if (ctx
&& ctx
->DrawSurface
== &dri2_surf
->base
)
353 dri2_flush_drawable_for_swapbuffers(disp
, draw
);
355 if (dri2_surf
->buffer
)
356 droid_window_enqueue_buffer(dri2_surf
);
358 (*dri2_dpy
->flush
->invalidate
)(dri2_surf
->dri_drawable
);
364 dri2_create_image_android_native_buffer(_EGLDisplay
*disp
, _EGLContext
*ctx
,
365 struct ANativeWindowBuffer
*buf
)
367 struct dri2_egl_display
*dri2_dpy
= dri2_egl_display(disp
);
368 struct dri2_egl_image
*dri2_img
;
372 /* From the EGL_ANDROID_image_native_buffer spec:
374 * * If <target> is EGL_NATIVE_BUFFER_ANDROID and <ctx> is not
375 * EGL_NO_CONTEXT, the error EGL_BAD_CONTEXT is generated.
377 _eglError(EGL_BAD_CONTEXT
, "eglCreateEGLImageKHR: for "
378 "EGL_NATIVE_BUFFER_ANDROID, the context must be "
383 if (!buf
|| buf
->common
.magic
!= ANDROID_NATIVE_BUFFER_MAGIC
||
384 buf
->common
.version
!= sizeof(*buf
)) {
385 _eglError(EGL_BAD_PARAMETER
, "eglCreateEGLImageKHR");
389 name
= get_native_buffer_name(buf
);
391 _eglError(EGL_BAD_PARAMETER
, "eglCreateEGLImageKHR");
395 dri2_img
= calloc(1, sizeof(*dri2_img
));
397 _eglError(EGL_BAD_ALLOC
, "droid_create_image_mesa_drm");
401 if (!_eglInitImage(&dri2_img
->base
, disp
)) {
406 dri2_img
->dri_image
=
407 dri2_dpy
->image
->createImageFromName(dri2_dpy
->dri_screen
,
410 get_format(buf
->format
),
414 if (!dri2_img
->dri_image
) {
416 _eglError(EGL_BAD_ALLOC
, "droid_create_image_mesa_drm");
420 return &dri2_img
->base
;
424 droid_create_image_khr(_EGLDriver
*drv
, _EGLDisplay
*disp
,
425 _EGLContext
*ctx
, EGLenum target
,
426 EGLClientBuffer buffer
, const EGLint
*attr_list
)
429 case EGL_NATIVE_BUFFER_ANDROID
:
430 return dri2_create_image_android_native_buffer(disp
, ctx
,
431 (struct ANativeWindowBuffer
*) buffer
);
433 return dri2_create_image_khr(drv
, disp
, ctx
, target
, buffer
, attr_list
);
438 droid_flush_front_buffer(__DRIdrawable
* driDrawable
, void *loaderPrivate
)
443 droid_get_buffers_parse_attachments(struct dri2_egl_surface
*dri2_surf
,
444 unsigned int *attachments
, int count
)
446 int num_buffers
= 0, i
;
448 /* fill dri2_surf->buffers */
449 for (i
= 0; i
< count
* 2; i
+= 2) {
450 __DRIbuffer
*buf
, *local
;
452 assert(num_buffers
< ARRAY_SIZE(dri2_surf
->buffers
));
453 buf
= &dri2_surf
->buffers
[num_buffers
];
455 switch (attachments
[i
]) {
456 case __DRI_BUFFER_BACK_LEFT
:
457 if (dri2_surf
->base
.Type
== EGL_WINDOW_BIT
) {
458 buf
->attachment
= attachments
[i
];
459 buf
->name
= get_native_buffer_name(dri2_surf
->buffer
);
460 buf
->cpp
= get_format_bpp(dri2_surf
->buffer
->format
);
461 buf
->pitch
= dri2_surf
->buffer
->stride
* buf
->cpp
;
469 /* fall through for pbuffers */
470 case __DRI_BUFFER_DEPTH
:
471 case __DRI_BUFFER_STENCIL
:
472 case __DRI_BUFFER_ACCUM
:
473 case __DRI_BUFFER_DEPTH_STENCIL
:
474 case __DRI_BUFFER_HIZ
:
475 local
= droid_alloc_local_buffer(dri2_surf
,
476 attachments
[i
], attachments
[i
+ 1]);
483 case __DRI_BUFFER_FRONT_LEFT
:
484 case __DRI_BUFFER_FRONT_RIGHT
:
485 case __DRI_BUFFER_FAKE_FRONT_LEFT
:
486 case __DRI_BUFFER_FAKE_FRONT_RIGHT
:
487 case __DRI_BUFFER_BACK_RIGHT
:
489 /* no front or right buffers */
498 droid_get_buffers_with_format(__DRIdrawable
* driDrawable
,
499 int *width
, int *height
,
500 unsigned int *attachments
, int count
,
501 int *out_count
, void *loaderPrivate
)
503 struct dri2_egl_surface
*dri2_surf
= loaderPrivate
;
504 struct dri2_egl_display
*dri2_dpy
=
505 dri2_egl_display(dri2_surf
->base
.Resource
.Display
);
508 if (update_buffers(dri2_surf
) < 0)
511 dri2_surf
->buffer_count
=
512 droid_get_buffers_parse_attachments(dri2_surf
, attachments
, count
);
515 *width
= dri2_surf
->base
.Width
;
517 *height
= dri2_surf
->base
.Height
;
519 *out_count
= dri2_surf
->buffer_count
;
521 return dri2_surf
->buffers
;
525 droid_add_configs_for_visuals(_EGLDriver
*drv
, _EGLDisplay
*dpy
)
527 struct dri2_egl_display
*dri2_dpy
= dri2_egl_display(dpy
);
530 unsigned int rgba_masks
[4];
532 { HAL_PIXEL_FORMAT_RGBA_8888
, { 0xff, 0xff00, 0xff0000, 0xff000000 } },
533 { HAL_PIXEL_FORMAT_RGBX_8888
, { 0xff, 0xff00, 0xff0000, 0x0 } },
534 { HAL_PIXEL_FORMAT_RGB_888
, { 0xff, 0xff00, 0xff0000, 0x0 } },
535 { HAL_PIXEL_FORMAT_RGB_565
, { 0xf800, 0x7e0, 0x1f, 0x0 } },
536 { HAL_PIXEL_FORMAT_BGRA_8888
, { 0xff0000, 0xff00, 0xff, 0xff000000 } },
537 { 0, { 0, 0, 0, 0 } }
539 EGLint config_attrs
[] = {
540 EGL_NATIVE_VISUAL_ID
, 0,
541 EGL_NATIVE_VISUAL_TYPE
, 0,
542 EGL_FRAMEBUFFER_TARGET_ANDROID
, EGL_TRUE
,
543 EGL_RECORDABLE_ANDROID
, EGL_TRUE
,
549 for (i
= 0; visuals
[i
].format
; i
++) {
550 int format_count
= 0;
552 config_attrs
[1] = visuals
[i
].format
;
553 config_attrs
[3] = visuals
[i
].format
;
555 for (j
= 0; dri2_dpy
->driver_configs
[j
]; j
++) {
556 const EGLint surface_type
= EGL_WINDOW_BIT
| EGL_PBUFFER_BIT
;
557 struct dri2_egl_config
*dri2_conf
;
558 unsigned int double_buffered
= 0;
560 dri2_dpy
->core
->getConfigAttrib(dri2_dpy
->driver_configs
[j
],
561 __DRI_ATTRIB_DOUBLE_BUFFER
, &double_buffered
);
563 /* support only double buffered configs */
564 if (!double_buffered
)
567 dri2_conf
= dri2_add_config(dpy
, dri2_dpy
->driver_configs
[j
],
568 count
+ 1, surface_type
, config_attrs
, visuals
[i
].rgba_masks
);
576 _eglLog(_EGL_DEBUG
, "No DRI config supports native format 0x%x",
581 /* post-process configs */
582 for (i
= 0; i
< dpy
->Configs
->Size
; i
++) {
583 struct dri2_egl_config
*dri2_conf
= dri2_egl_config(dpy
->Configs
->Elements
[i
]);
585 /* there is no front buffer so no OpenGL */
586 dri2_conf
->base
.RenderableType
&= ~EGL_OPENGL_BIT
;
587 dri2_conf
->base
.Conformant
&= ~EGL_OPENGL_BIT
;
594 droid_open_device(void)
596 const hw_module_t
*mod
;
599 err
= hw_get_module(GRALLOC_HARDWARE_MODULE_ID
, &mod
);
601 const gralloc_module_t
*gr
= (gralloc_module_t
*) mod
;
605 err
= gr
->perform(gr
, GRALLOC_MODULE_PERFORM_GET_DRM_FD
, &fd
);
608 _eglLog(_EGL_WARNING
, "fail to get drm fd");
612 return (fd
>= 0) ? dup(fd
) : -1;
615 /* support versions < JellyBean */
627 droid_log(EGLint level
, const char *msg
)
640 LOG_FATAL("%s", msg
);
647 static struct dri2_egl_display_vtbl droid_display_vtbl
= {
648 .authenticate
= NULL
,
649 .create_window_surface
= droid_create_window_surface
,
650 .create_pixmap_surface
= dri2_fallback_create_pixmap_surface
,
651 .create_pbuffer_surface
= droid_create_pbuffer_surface
,
652 .destroy_surface
= droid_destroy_surface
,
653 .create_image
= droid_create_image_khr
,
654 .swap_interval
= dri2_fallback_swap_interval
,
655 .swap_buffers
= droid_swap_buffers
,
656 .swap_buffers_with_damage
= dri2_fallback_swap_buffers_with_damage
,
657 .swap_buffers_region
= dri2_fallback_swap_buffers_region
,
658 .post_sub_buffer
= dri2_fallback_post_sub_buffer
,
659 .copy_buffers
= dri2_fallback_copy_buffers
,
660 .query_buffer_age
= dri2_fallback_query_buffer_age
,
661 .create_wayland_buffer_from_image
= dri2_fallback_create_wayland_buffer_from_image
,
662 .get_sync_values
= dri2_fallback_get_sync_values
,
663 .get_dri_drawable
= dri2_surface_get_dri_drawable
,
667 dri2_initialize_android(_EGLDriver
*drv
, _EGLDisplay
*dpy
)
669 struct dri2_egl_display
*dri2_dpy
;
672 _eglSetLogProc(droid_log
);
674 loader_set_logger(_eglLog
);
676 dri2_dpy
= calloc(1, sizeof(*dri2_dpy
));
678 return _eglError(EGL_BAD_ALLOC
, "eglInitialize");
680 dpy
->DriverData
= (void *) dri2_dpy
;
682 dri2_dpy
->fd
= droid_open_device();
683 if (dri2_dpy
->fd
< 0) {
684 err
= "DRI2: failed to open device";
685 goto cleanup_display
;
688 dri2_dpy
->driver_name
= loader_get_driver_for_fd(dri2_dpy
->fd
, 0);
689 if (dri2_dpy
->driver_name
== NULL
) {
690 err
= "DRI2: failed to get driver name";
694 if (!dri2_load_driver(dpy
)) {
695 err
= "DRI2: failed to load driver";
696 goto cleanup_driver_name
;
699 dri2_dpy
->is_render_node
= drmGetNodeTypeFromFd(dri2_dpy
->fd
) == DRM_NODE_RENDER
;
701 dri2_dpy
->extensions
[0] = &image_lookup_extension
.base
;
702 dri2_dpy
->extensions
[1] = &use_invalidate
.base
;
704 /* render nodes cannot use Gem names, and thus do not support
705 * the __DRI_DRI2_LOADER extension */
706 if (!dri2_dpy
->is_render_node
) {
707 dri2_dpy
->dri2_loader_extension
.base
.name
= __DRI_DRI2_LOADER
;
708 dri2_dpy
->dri2_loader_extension
.base
.version
= 3;
709 dri2_dpy
->dri2_loader_extension
.getBuffers
= NULL
;
710 dri2_dpy
->dri2_loader_extension
.flushFrontBuffer
= droid_flush_front_buffer
;
711 dri2_dpy
->dri2_loader_extension
.getBuffersWithFormat
=
712 droid_get_buffers_with_format
;
713 dri2_dpy
->extensions
[2] = &dri2_dpy
->dri2_loader_extension
.base
;
714 dri2_dpy
->extensions
[3] = NULL
;
716 dri2_dpy
->extensions
[2] = NULL
;
719 if (!dri2_create_screen(dpy
)) {
720 err
= "DRI2: failed to create screen";
724 if (!droid_add_configs_for_visuals(drv
, dpy
)) {
725 err
= "DRI2: failed to add configs";
729 dpy
->Extensions
.ANDROID_framebuffer_target
= EGL_TRUE
;
730 dpy
->Extensions
.ANDROID_image_native_buffer
= EGL_TRUE
;
731 dpy
->Extensions
.ANDROID_recordable
= EGL_TRUE
;
732 dpy
->Extensions
.KHR_image_base
= EGL_TRUE
;
734 /* Fill vtbl last to prevent accidentally calling virtual function during
737 dri2_dpy
->vtbl
= &droid_display_vtbl
;
742 dri2_dpy
->core
->destroyScreen(dri2_dpy
->dri_screen
);
744 dlclose(dri2_dpy
->driver
);
746 free(dri2_dpy
->driver_name
);
752 return _eglError(EGL_NOT_INITIALIZED
, err
);