egl/android: Cancel any outstanding ANativeBuffer in surface destructor
authorChad Versace <chadversary@chromium.org>
Fri, 5 May 2017 00:46:33 +0000 (17:46 -0700)
committerChad Versace <chadversary@chromium.org>
Fri, 5 May 2017 00:46:33 +0000 (17:46 -0700)
commit0212db350407e1331ff23f04136684cf2b7396cf
treea911ca95caf7f4f8ee823f19d2bf8807623f2a41
parent23c86c74cc450a23848b85cfe914376caede1cdf
egl/android: Cancel any outstanding ANativeBuffer in surface destructor

That is, call ANativeWindow::cancelBuffer in droid_destroy_surface().

This should prevent application deadlock when the app destroys the
EGLSurface after EGL has acquired a buffer from SurfaceFlinger
(ANativeWindow::dequeueBuffer) but before EGL has released it
(ANativeWindow::enqueueBuffer).

This patch is part of a series for fixing
android.hardware.camera2.cts.RobustnessTest#testAbandonRepeatingRequestSurface
on Chrome OS x86 devices.

Cc: mesa-stable@lists.freedesktop.org
Cc: Tomasz Figa <tfiga@chromium.org>
Cc: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
src/egl/drivers/dri2/platform_android.c