Re: [Mesa-dev] [PATCH 3/3] egl/android: Mark surface as lost when dequeueBuffer fails
On Thu, May 4, 2017, at 05:42 AM, Emil Velikov wrote: > Hi Chad, > > On 4 May 2017 at 00:47, Chad Versacewrote: > > From: Chad Versace > > > > This ensures that future calls to eglSwapBuffers and eglMakeCurrent emit > > an error. > > > > This patch is part of a series for fixing > > android.hardware.camera2.cts.RobustnessTest#testAbandonRepeatingRequestSurface > > on Chrome OS x86 devices. > > > Barring checking the wrong error as mentioned in 1/3 the issue should > now be resolved, shouldn't it? Yes, I've confirmed that the bug is now fixed. > Thinking out loud: perhaps it's worth having a similar test in dEQP? dEQP actually has a TODO for this. You can find it by grepping for EGL_BAD_CURRENT_SURFACE. I don't know how difficult it would be to write a dEQP for this. I suspect you would need to essentially write a different test for each platform because, to reliably lose the surface, the test would need to act on the native window between two eglSwapBuffers. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 3/3] egl/android: Mark surface as lost when dequeueBuffer fails
On Thu 04 May 2017, Emil Velikov wrote: > Hi Chad, > > On 4 May 2017 at 00:47, Chad Versacewrote: > > From: Chad Versace > > > > This ensures that future calls to eglSwapBuffers and eglMakeCurrent emit > > an error. > > > > This patch is part of a series for fixing > > android.hardware.camera2.cts.RobustnessTest#testAbandonRepeatingRequestSurface > > on Chrome OS x86 devices. > > > Barring checking the wrong error as mentioned in 1/3 the issue should > now be resolved, shouldn't it? > Thinking out loud: perhaps it's worth having a similar test in dEQP? > > > Cc: Tomasz Figa > > Cc: Nicolas Boichat > > Cc: Tapani Pälli > IMHO your interpretation of the spec is spot on and the series look great. > Other platforms can also make use of ::Lost (to varying extend) but > that can follow at a later point. > > For the lot > Cc: mesa-sta...@lists.freedesktop.org > Reviewed-by: Emil Velikov Thanks for the quick review. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 3/3] egl/android: Mark surface as lost when dequeueBuffer fails
Hi Chad, On 4 May 2017 at 00:47, Chad Versacewrote: > From: Chad Versace > > This ensures that future calls to eglSwapBuffers and eglMakeCurrent emit > an error. > > This patch is part of a series for fixing > android.hardware.camera2.cts.RobustnessTest#testAbandonRepeatingRequestSurface > on Chrome OS x86 devices. > Barring checking the wrong error as mentioned in 1/3 the issue should now be resolved, shouldn't it? Thinking out loud: perhaps it's worth having a similar test in dEQP? > Cc: Tomasz Figa > Cc: Nicolas Boichat > Cc: Tapani Pälli IMHO your interpretation of the spec is spot on and the series look great. Other platforms can also make use of ::Lost (to varying extend) but that can follow at a later point. For the lot Cc: mesa-sta...@lists.freedesktop.org Reviewed-by: Emil Velikov -Emil ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 3/3] egl/android: Mark surface as lost when dequeueBuffer fails
From: Chad VersaceThis ensures that future calls to eglSwapBuffers and eglMakeCurrent emit an error. This patch is part of a series for fixing android.hardware.camera2.cts.RobustnessTest#testAbandonRepeatingRequestSurface on Chrome OS x86 devices. Cc: Tomasz Figa Cc: Nicolas Boichat Cc: Tapani Pälli --- src/egl/drivers/dri2/platform_android.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c index f45fcdf4ff..2450d9de47 100644 --- a/src/egl/drivers/dri2/platform_android.c +++ b/src/egl/drivers/dri2/platform_android.c @@ -431,12 +431,16 @@ droid_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf) static int update_buffers(struct dri2_egl_surface *dri2_surf) { + if (dri2_surf->base.Lost) + return -1; + if (dri2_surf->base.Type != EGL_WINDOW_BIT) return 0; /* try to dequeue the next back buffer */ if (!dri2_surf->buffer && !droid_window_dequeue_buffer(dri2_surf)) { _eglLog(_EGL_WARNING, "Could not dequeue buffer from native window"); + dri2_surf->base.Lost = true; return -1; } @@ -628,6 +632,12 @@ droid_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw) dri2_flush_drawable_for_swapbuffers(disp, draw); + /* dri2_surf->buffer can be null even when no error has occured. For +* example, if the user has called no GL rendering commands since the +* previous eglSwapBuffers, then the driver may have not triggered +* a callback to ANativeWindow::dequeueBuffer, in which case +* dri2_surf->buffer remains null. +*/ if (dri2_surf->buffer) droid_window_enqueue_buffer(disp, dri2_surf); -- 2.12.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev