On Tuesday, 2018-01-16 07:56:53 +0000, Zhongmin Wu wrote:
> Implement the eglSwapinterval for Android platform to
> enable the async mode for some GFX benchmarks.
> 
> Signed-off-by: Zhongmin Wu <zhongmin...@intel.com>

Like Tomasz, I thought this was a mistake, given the recall email.

I have now looked at it, and it looks good to me.

As Tomasz mentioned, can you just run it past dEQP to make sure there's
no regression? Specifically, make sure you run all the
dEQP-EGL.*swap_interval tests. I don't think there's anything dEQP could
detect here anyway, the only thing is that we need to store the interval
in surf->SwapInterval to return it later, which is done here, so
I expect it should all pass.

With a 7/7 pass on those, and with the comments from Emil addressed, the
patch is:
Reviewed-by: Eric Engestrom <e...@engestrom.ch>

> ---
>  src/egl/drivers/dri2/platform_android.c | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 
> diff --git a/src/egl/drivers/dri2/platform_android.c 
> b/src/egl/drivers/dri2/platform_android.c
> index f6a24cd..09f1159 100644
> --- a/src/egl/drivers/dri2/platform_android.c
> +++ b/src/egl/drivers/dri2/platform_android.c
> @@ -476,6 +476,19 @@ droid_destroy_surface(_EGLDriver *drv, _EGLDisplay 
> *disp, _EGLSurface *surf)
>     return EGL_TRUE;
>  }
>  
> +static EGLBoolean
> +droid_swap_interval(_EGLDriver *drv, _EGLDisplay *dpy,
> +                   _EGLSurface *surf, EGLint interval)
> +{
> +   struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf);
> +   struct ANativeWindow *window = dri2_surf->window;
> +   if (window->setSwapInterval(window, interval)) {
> +      return EGL_FALSE;
> +   }
> +   surf->SwapInterval = interval;
> +   return EGL_TRUE;
> +}
> +
>  static int
>  update_buffers(struct dri2_egl_surface *dri2_surf)
>  {
> @@ -1300,6 +1313,7 @@ static const struct dri2_egl_display_vtbl 
> droid_display_vtbl = {
>     .swap_buffers = droid_swap_buffers,
>     .swap_buffers_with_damage = dri2_fallback_swap_buffers_with_damage, /* 
> Android implements the function */
>     .swap_buffers_region = dri2_fallback_swap_buffers_region,
> +   .swap_interval = droid_swap_interval,
>  #if ANDROID_API_LEVEL >= 23
>     .set_damage_region = droid_set_damage_region,
>  #else
> @@ -1443,6 +1457,8 @@ dri2_initialize_android(_EGLDriver *drv, _EGLDisplay 
> *dpy)
>  
>     dri2_setup_screen(dpy);
>  
> +   dri2_setup_swap_interval(dpy, 1);
> +
>     if (!droid_add_configs_for_visuals(drv, dpy)) {
>        err = "DRI2: failed to add configs";
>        goto cleanup;
> -- 
> 2.7.4
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to