[Mesa-dev] [PATCH] egl/android: implement minimal swap_buffers_with_damage

Rob Herring robh at kernel.org
Fri Oct 21 21:07:07 UTC 2016


Since commit 0a606a400fe3 ("egl: add eglSwapBuffersWithDamageKHR"),
Android has been broken because the function eglSwapBuffersWithDamageKHR
is provided regardless of the extension being present. Also, the Android
meta-EGL always advertises the extension regardless of the underlying
EGL implementation. As there doesn't seem to be a simple way
conditionally make the EGL function ptr NULL, just implement a brain
dead version for Android EGL.

Cc: Rob Clark <robdclark at gmail.com>
Cc: Eric Engestrom <eric.engestrom at imgtec.com>
Cc: Emil Velikov <emil.velikov at collabora.com>
Signed-off-by: Rob Herring <robh at kernel.org>
---
 src/egl/drivers/dri2/platform_android.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c
index 142ef05bd1ea..2a6527a34407 100644
--- a/src/egl/drivers/dri2/platform_android.c
+++ b/src/egl/drivers/dri2/platform_android.c
@@ -483,6 +483,14 @@ droid_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
    return EGL_TRUE;
 }
 
+static EGLBoolean
+droid_swap_buffers_with_damage(_EGLDriver *drv, _EGLDisplay *disp,
+                               _EGLSurface *draw, const EGLint *rects,
+                               EGLint n_rects)
+{
+   return droid_swap_buffers(drv, disp, draw);
+}
+
 static _EGLImage *
 droid_create_image_from_prime_fd(_EGLDisplay *disp, _EGLContext *ctx,
                                  struct ANativeWindowBuffer *buf, int fd)
@@ -876,7 +884,7 @@ static struct dri2_egl_display_vtbl droid_display_vtbl = {
    .create_image = droid_create_image_khr,
    .swap_interval = dri2_fallback_swap_interval,
    .swap_buffers = droid_swap_buffers,
-   .swap_buffers_with_damage = dri2_fallback_swap_buffers_with_damage,
+   .swap_buffers_with_damage = droid_swap_buffers_with_damage,
    .swap_buffers_region = dri2_fallback_swap_buffers_region,
    .post_sub_buffer = dri2_fallback_post_sub_buffer,
    .copy_buffers = dri2_fallback_copy_buffers,
-- 
2.10.1



More information about the mesa-dev mailing list