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

Emil Velikov emil.l.velikov at gmail.com
Mon Oct 24 15:57:31 UTC 2016


On 21 October 2016 at 22:07, Rob Herring <robh at kernel.org> wrote:
> 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.
>
Thanks for tracking this down Rob !

So both meta-EGL and users are busted, making a simple genuine patch
break things :-(

> 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);
> +}
> +
Can we implement dri2_fallback_swap_buffers_with_damage as a wrapper
around .swap_buffers(). This way things will just work everywhere ?

Thanks
Emil


More information about the mesa-dev mailing list