[Mesa-dev] [PATCH v2] egl/android: Implement the eglSwapinterval for Android.

Wu, Zhongmin zhongmin.wu at intel.com
Fri Mar 16 08:51:29 UTC 2018


Thanks very much Tomasz.

So, who can help to commit such patch.

-----Original Message-----
From: Tomasz Figa [mailto:tfiga at chromium.org] 
Sent: Thursday, March 15, 2018 16:07 
To: Wu, Zhongmin <zhongmin.wu at intel.com>
Cc: ML mesa-dev <mesa-dev at lists.freedesktop.org>; Rob Herring <robh at kernel.org>; Emil Velikov <emil.l.velikov at gmail.com>; Liu, Zhiquan <zhiquan.liu at intel.com>; Long, Zhifang <zhifang.long at intel.com>; Kondapally, Kalyan <kalyan.kondapally at intel.com>; Palli, Tapani <tapani.palli at intel.com>; Xu, Randy <randy.xu at intel.com>; Eric Engestrom <eric at engestrom.ch>; Bhardwaj, MunishX <munishx.bhardwaj at intel.com>; Kps, Harish Krupo <harish.krupo.kps at intel.com>; Chad Versace <chadversary at chromium.org>
Subject: Re: [PATCH v2] egl/android: Implement the eglSwapinterval for Android.

On Thu, Jan 18, 2018 at 4:39 PM, Zhongmin Wu <zhongmin.wu at intel.com> wrote:
> Implement the eglSwapinterval for Android platform to enable the async 
> mode for some GFX benchmarks such as Daimler C217, CityBench.
>
> Signed-off-by: Zhongmin Wu <zhongmin.wu at intel.com>
> ---
>  src/egl/drivers/dri2/platform_android.c | 21 +++++++++++++++++++++
>  1 file changed, 21 insertions(+)
>
> diff --git a/src/egl/drivers/dri2/platform_android.c 
> b/src/egl/drivers/dri2/platform_android.c
> index f6a24cd..3a64689 100644
> --- a/src/egl/drivers/dri2/platform_android.c
> +++ b/src/egl/drivers/dri2/platform_android.c
> @@ -476,6 +476,20 @@ 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 
> +1314,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 
> +1458,12 @@ dri2_initialize_android(_EGLDriver *drv, _EGLDisplay *dpy)
>
>     dri2_setup_screen(dpy);
>
> +   /* we set the maximum swap interval as 1 for Android platform, Since
> +   it is the maximum value supported by Android according to the
> +   value of ANativeWindow::maxSwapInterval.
> +   */

nit: Please use comment style consistent with rest of the file. Also, please fix up typography issues, as below:

/* We set the maximum swap interval as 1 for Android platform, since it is
 * the maximum value supported by Android according to the value of
 * ANativeWindow::maxSwapInterval.
 */

I guess whoever committing this patch could just fix this up without a resend.

With the above:

Reviewed-by: Tomasz Figa <tfiga at chromium.org>

Best regards,
Tomasz


More information about the mesa-dev mailing list