Re: [Mesa-dev] [PATCH v2] egl/android: Implement the eglSwapinterval for Android.
Hi Emil: Thanks very much. Yes, the previous patches (V1) is superseded now. -Original Message- From: Emil Velikov [mailto:emil.l.veli...@gmail.com] Sent: Friday, March 16, 2018 22:14 To: Wu, ZhongminCc: Tomasz Figa ; ML mesa-dev ; Rob Herring ; Liu, Zhiquan ; Long, Zhifang ; Kondapally, Kalyan ; Palli, Tapani ; Xu, Randy ; Eric Engestrom ; Bhardwaj, MunishX ; Kps, Harish Krupo ; Chad Versace Subject: Re: [PATCH v2] egl/android: Implement the eglSwapinterval for Android. On 16 March 2018 at 08:51, Wu, Zhongmin wrote: > Thanks very much Tomasz. > > So, who can help to commit such patch. > Fixed with s/dpy/disp/ (otherwise it won't even build) and pushed. Please go through the patches list and update it. I believe that all of those are superseded, do check them over. https://patchwork.freedesktop.org/project/mesa/patches/?submitter=17018 Thanks Emil ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH v2] egl/android: Implement the eglSwapinterval for Android.
On 16 March 2018 at 08:51, Wu, Zhongminwrote: > Thanks very much Tomasz. > > So, who can help to commit such patch. > Fixed with s/dpy/disp/ (otherwise it won't even build) and pushed. Please go through the patches list and update it. I believe that all of those are superseded, do check them over. https://patchwork.freedesktop.org/project/mesa/patches/?submitter=17018 Thanks Emil ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH v2] egl/android: Implement the eglSwapinterval for Android.
Thanks very much Tomasz. So, who can help to commit such patch. -Original Message- From: Tomasz Figa [mailto:tf...@chromium.org] Sent: Thursday, March 15, 2018 16:07 To: Wu, ZhongminCc: ML mesa-dev ; Rob Herring ; Emil Velikov ; Liu, Zhiquan ; Long, Zhifang ; Kondapally, Kalyan ; Palli, Tapani ; Xu, Randy ; Eric Engestrom ; Bhardwaj, MunishX ; Kps, Harish Krupo ; Chad Versace Subject: Re: [PATCH v2] egl/android: Implement the eglSwapinterval for Android. On Thu, Jan 18, 2018 at 4:39 PM, Zhongmin Wu 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 > --- > 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 Best regards, Tomasz ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH v2] egl/android: Implement the eglSwapinterval for Android.
On Thu, Jan 18, 2018 at 4:39 PM, Zhongmin Wuwrote: > 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 > --- > 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 Best regards, Tomasz ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH v2] egl/android: Implement the eglSwapinterval for Android.
Friendly ping -Original Message- From: Wu, Zhongmin Sent: Wednesday, March 7, 2018 9:16 To: Eric Engestrom; Emil Velikov Cc: ML mesa-dev ; Tomasz Figa ; Rob Herring ; Liu, Zhiquan ; Long, Zhifang ; Kondapally, Kalyan ; Palli, Tapani ; Xu, Randy ; Bhardwaj, MunishX ; Kps, Harish Krupo ; Chad Versace Subject: RE: [PATCH v2] egl/android: Implement the eglSwapinterval for Android. Hi Eric: Sorry, but what is the status about this patch. I saw you said you was going to help to modify the comments and push it in the last mail. Is this patch merged in to lasts codes ? Or do I miss something? -Original Message- From: Eric Engestrom [mailto:e...@engestrom.ch] Sent: Friday, January 19, 2018 3:46 To: Emil Velikov Cc: Wu, Zhongmin ; ML mesa-dev ; Tomasz Figa ; Rob Herring ; Liu, Zhiquan ; Long, Zhifang ; Kondapally, Kalyan ; Palli, Tapani ; Xu, Randy ; Bhardwaj, MunishX ; Kps, Harish Krupo ; Chad Versace Subject: Re: [PATCH v2] egl/android: Implement the eglSwapinterval for Android. On Thursday, 2018-01-18 19:07:06 +, Emil Velikov wrote: > On 18 January 2018 at 17:43, Eric Engestrom wrote: > > On Thursday, 2018-01-18 07:52:42 +, Zhongmin Wu 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 > >> --- > >> 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. > >> + */ > >> + dri2_setup_swap_interval(dpy, 1); > > > > My C<->C++ interaction skills are more than rusty, but is it > > possible to use `ANativeWindow.maxSwapInterval` or something like this? > > > > Given that the dEQP tests all pass, whether with the current comment > > or the class field directly used in the code, this patch is: > > Reviewed-by: Eric Engestrom > > > > I'll push it for you in a couple days if no one objects :) > > > My current checkout shows the struct is nicely separated for inclusion > in both C and C++ sources. > The C++ vfuncs are wrapped in a ifdef _cplusplus block, so the ABI > should be identical across both. > > I'm suspecting that maxSwapInterval > 1 will require additional > changes, so I'd keep it as-is That's actually a good point; this should indeed stay hard coded, with this comment. > (nit the comment style and adding dEQP stats in the commit message). I was going to do this before pushing, but you're right to point it out :) > Reviewed-by: Emil Velikov >
Re: [Mesa-dev] [PATCH v2] egl/android: Implement the eglSwapinterval for Android.
Hi Eric: Sorry, but what is the status about this patch. I saw you said you was going to help to modify the comments and push it in the last mail. Is this patch merged in to lasts codes ? Or do I miss something? -Original Message- From: Eric Engestrom [mailto:e...@engestrom.ch] Sent: Friday, January 19, 2018 3:46 To: Emil VelikovCc: Wu, Zhongmin ; ML mesa-dev ; Tomasz Figa ; Rob Herring ; Liu, Zhiquan ; Long, Zhifang ; Kondapally, Kalyan ; Palli, Tapani ; Xu, Randy ; Bhardwaj, MunishX ; Kps, Harish Krupo ; Chad Versace Subject: Re: [PATCH v2] egl/android: Implement the eglSwapinterval for Android. On Thursday, 2018-01-18 19:07:06 +, Emil Velikov wrote: > On 18 January 2018 at 17:43, Eric Engestrom wrote: > > On Thursday, 2018-01-18 07:52:42 +, Zhongmin Wu 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 > >> --- > >> 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. > >> + */ > >> + dri2_setup_swap_interval(dpy, 1); > > > > My C<->C++ interaction skills are more than rusty, but is it > > possible to use `ANativeWindow.maxSwapInterval` or something like this? > > > > Given that the dEQP tests all pass, whether with the current comment > > or the class field directly used in the code, this patch is: > > Reviewed-by: Eric Engestrom > > > > I'll push it for you in a couple days if no one objects :) > > > My current checkout shows the struct is nicely separated for inclusion > in both C and C++ sources. > The C++ vfuncs are wrapped in a ifdef _cplusplus block, so the ABI > should be identical across both. > > I'm suspecting that maxSwapInterval > 1 will require additional > changes, so I'd keep it as-is That's actually a good point; this should indeed stay hard coded, with this comment. > (nit the comment style and adding dEQP stats in the commit message). I was going to do this before pushing, but you're right to point it out :) > Reviewed-by: Emil Velikov > > -Emil ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH v2] egl/android: Implement the eglSwapinterval for Android.
On Thursday, 2018-01-18 19:07:06 +, Emil Velikov wrote: > On 18 January 2018 at 17:43, Eric Engestromwrote: > > On Thursday, 2018-01-18 07:52:42 +, Zhongmin Wu 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 > >> --- > >> 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. > >> + */ > >> + dri2_setup_swap_interval(dpy, 1); > > > > My C<->C++ interaction skills are more than rusty, but is it possible to > > use `ANativeWindow.maxSwapInterval` or something like this? > > > > Given that the dEQP tests all pass, whether with the current comment or > > the class field directly used in the code, this patch is: > > Reviewed-by: Eric Engestrom > > > > I'll push it for you in a couple days if no one objects :) > > > My current checkout shows the struct is nicely separated for inclusion > in both C and C++ sources. > The C++ vfuncs are wrapped in a ifdef _cplusplus block, so the ABI > should be identical across both. > > I'm suspecting that maxSwapInterval > 1 will require additional > changes, so I'd keep it as-is That's actually a good point; this should indeed stay hard coded, with this comment. > (nit the comment style and adding dEQP stats in the commit message). I was going to do this before pushing, but you're right to point it out :) > Reviewed-by: Emil Velikov > > -Emil ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH v2] egl/android: Implement the eglSwapinterval for Android.
On 18 January 2018 at 17:43, Eric Engestromwrote: > On Thursday, 2018-01-18 07:52:42 +, Zhongmin Wu 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 >> --- >> 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. >> + */ >> + dri2_setup_swap_interval(dpy, 1); > > My C<->C++ interaction skills are more than rusty, but is it possible to > use `ANativeWindow.maxSwapInterval` or something like this? > > Given that the dEQP tests all pass, whether with the current comment or > the class field directly used in the code, this patch is: > Reviewed-by: Eric Engestrom > > I'll push it for you in a couple days if no one objects :) > My current checkout shows the struct is nicely separated for inclusion in both C and C++ sources. The C++ vfuncs are wrapped in a ifdef _cplusplus block, so the ABI should be identical across both. I'm suspecting that maxSwapInterval > 1 will require additional changes, so I'd keep it as-is (nit the comment style and adding dEQP stats in the commit message). Reviewed-by: Emil Velikov -Emil ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH v2] egl/android: Implement the eglSwapinterval for Android.
On Thursday, 2018-01-18 07:52:42 +, Zhongmin Wu 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> --- > 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. > + */ > + dri2_setup_swap_interval(dpy, 1); My C<->C++ interaction skills are more than rusty, but is it possible to use `ANativeWindow.maxSwapInterval` or something like this? Given that the dEQP tests all pass, whether with the current comment or the class field directly used in the code, this patch is: Reviewed-by: Eric Engestrom I'll push it for you in a couple days if no one objects :) > + > 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
[Mesa-dev] [PATCH v2] egl/android: Implement the eglSwapinterval for Android.
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--- 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. + */ + 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
Re: [Mesa-dev] [PATCH v2] egl/android: Implement the eglSwapinterval for Android.
Below is the dEQP result for all the dEQP-EGL.*swap_interval tests 11-11 18:22:44.164 12737 12737 I dEQP: Device has at least 832.00 MiB total system memory per Android CDD 11-11 18:22:44.164 12737 12737 I dEQP: Writing test log into /sdcard/dEQP-Log.qpa 11-11 18:22:44.165 12737 12737 I dEQP: dEQP Core unknown (0xcafebabe) starting.. 11-11 18:22:44.165 12737 12737 I dEQP: target implementation = 'android' 11-11 18:22:44.329 12737 12760 I dEQP: 11-11 18:22:44.329 12737 12760 I dEQP: Test case 'dEQP-EGL.functional.query_config.get_config_attrib.max_swap_interval'.. 11-11 18:22:44.391 12737 12760 I dEQP: Pass (Pass) 11-11 18:22:44.392 12737 12760 I dEQP: 11-11 18:22:44.392 12737 12760 I dEQP: Test case 'dEQP-EGL.functional.query_config.get_config_attrib.min_swap_interval'.. 11-11 18:22:44.421 12737 12760 I dEQP: Pass (Pass) 11-11 18:22:44.421 12737 12760 I dEQP: 11-11 18:22:44.421 12737 12760 I dEQP: Test case 'dEQP-EGL.functional.choose_config.simple.selection_only.max_swap_interval'.. 11-11 18:22:44.429 12737 12760 I dEQP: Pass (Pass) 11-11 18:22:44.429 12737 12760 I dEQP: 11-11 18:22:44.429 12737 12760 I dEQP: Test case 'dEQP-EGL.functional.choose_config.simple.selection_only.min_swap_interval'.. 11-11 18:22:44.437 12737 12760 I dEQP: Pass (Pass) 11-11 18:22:44.437 12737 12760 I dEQP: 11-11 18:22:44.437 12737 12760 I dEQP: Test case 'dEQP-EGL.functional.choose_config.simple.selection_and_sort.max_swap_interval'.. 11-11 18:22:44.444 12737 12760 I dEQP: Pass (Pass) 11-11 18:22:44.444 12737 12760 I dEQP: 11-11 18:22:44.444 12737 12760 I dEQP: Test case 'dEQP-EGL.functional.choose_config.simple.selection_and_sort.min_swap_interval'.. 11-11 18:22:44.451 12737 12760 I dEQP: Pass (Pass) 11-11 18:22:44.618 12737 12760 I dEQP: 11-11 18:22:44.618 12737 12760 I dEQP: Test case 'dEQP-EGL.functional.negative_api.swap_interval'.. 11-11 18:22:44.621 12737 12760 I dEQP: Pass (Pass) 11-11 18:22:44.645 12737 12760 I dEQP: 11-11 18:22:44.645 12737 12760 I dEQP: DONE! 11-11 18:22:44.645 12737 12760 I dEQP: 11-11 18:22:44.645 12737 12760 I dEQP: Test run totals: 11-11 18:22:44.645 12737 12760 I dEQP: Passed:7/7 (100.0%) 11-11 18:22:44.645 12737 12760 I dEQP: Failed:0/7 (0.0%) 11-11 18:22:44.645 12737 12760 I dEQP: Not supported: 0/7 (0.0%) 11-11 18:22:44.645 12737 12760 I dEQP: Warnings: 0/7 (0.0%) 11-11 18:22:45.097 12737 12737 I dEQP: Done, killing process -Original Message- From: Wu, Zhongmin Sent: Thursday, January 18, 2018 15:39 To: mesa-dev@lists.freedesktop.org Cc: tf...@chromium.org; r...@kernel.org; emil.l.veli...@gmail.com; Liu, Zhiquan; Long, Zhifang ; Kondapally, Kalyan ; Palli, Tapani ; Xu, Randy ; Wu, Zhongmin ; Eric Engestrom ; Bhardwaj, MunishX ; Kps, Harish Krupo ; Chad Versace Subject: [PATCH v2] egl/android: Implement the eglSwapinterval for Android. 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 --- 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