summaryrefslogtreecommitdiffstats
path: root/src/egl/drivers/dri2/egl_dri2.c
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2011-08-05 14:39:18 +0900
committerChia-I Wu <[email protected]>2011-08-28 21:56:23 +0800
commit9779f6f5c143506d71420d78bb51b2fa7c995378 (patch)
treea2e1fe1c5f410341daa38c85120921c56a1f3730 /src/egl/drivers/dri2/egl_dri2.c
parent58911b86a15676f116c693e84ea6b9ebabb906ed (diff)
egl_dri2: add support for Android
Add platform_android.c that supports _EGL_PLAFORM_ANDROID. It works with drm_gralloc, where back buffers of windows are backed by GEM objects. In Android a native window has a queue of back buffers allocated by the server, through drm_gralloc. For each frame, EGL needs to dequeue the next back buffer render to the buffer enqueue the buffer After enqueuing, the buffer is no longer valid to EGL. A window has no depth buffer or other aux buffers. They need to be allocated locally by EGL. Reviewed-by: Benjamin Franzke <[email protected]> Reviewed-by: Chad Versace <[email protected]> [olv: with assorted minor changes, mostly suggested during the review]
Diffstat (limited to 'src/egl/drivers/dri2/egl_dri2.c')
-rw-r--r--src/egl/drivers/dri2/egl_dri2.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index ba728a1583b..4aa1df056cf 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -577,6 +577,12 @@ dri2_initialize(_EGLDriver *drv, _EGLDisplay *disp)
return dri2_initialize_wayland(drv, disp);
#endif
#endif
+#ifdef HAVE_ANDROID_PLATFORM
+ case _EGL_PLATFORM_ANDROID:
+ if (disp->Options.TestOnly)
+ return EGL_TRUE;
+ return dri2_initialize_android(drv, disp);
+#endif
default:
return EGL_FALSE;
@@ -1323,7 +1329,11 @@ dri2_load(_EGLDriver *drv)
{
struct dri2_egl_driver *dri2_drv = dri2_egl_driver(drv);
#ifdef HAVE_SHARED_GLAPI
+#ifdef HAVE_ANDROID_PLATFORM
+ const char *libname = "libglapi.so";
+#else
const char *libname = "libglapi.so.0";
+#endif
#else
/*
* Both libGL.so and libglapi.so are glapi providers. There is no way to