Revert "FROMLIST: egl/android: Dequeue buffers inside EGL calls"

This reverts commit 9c9bdb6e72fc523d8077e8745558702d963aa208.

Reason for revert: It looks like the new behavior violates some
undocumented assumptions in SurfaceFlinger and introduces new failures.
See b/37406655 and b/37649533 for more details.

Original change's description:
> FROMLIST: egl/android: Dequeue buffers inside EGL calls
>
> Android buffer queues can be abandoned, which results in failing to
> dequeue next buffer. Currently this would fail somewhere deep within
> the DRI stack calling loader's getBuffers*(), without any error
> reporting to the client app. However Android framework code relies on
> proper signaling of this event, so we move buffer dequeue to
> createWindowSurface() and swapBuffers() call, which can generate proper
> EGL errors. To keep the performance benefits of delayed buffer handling,
> if any, fence wait and DRI image creation is kept delayed until
> getBuffers*() is called by the DRI driver.
>
> Signed-off-by: Tomasz Figa <tfiga@chromium.org>
> (backport from https://patchwork.freedesktop.org/patch/147320/)
>
> BUG=b:36063477
> TEST=cts run --module CtsCameraTest -t android.hardware.camera2.cts.RobustnessTest#testAbandonRepeatingRequestSurface on caroline
> TEST=cts run --module CtsDeqpTestCases on reef
> TEST=cts run --module CtsOpenGLTestCases on reef
> TEST=cts run --module CtsTextureViewTestCases on reef
>
> Change-Id: Iae0518c3af47070b0dbc40f557d5dd8b03dc9171
> Reviewed-on: https://chromium-review.googlesource.com/461705
> Commit-Ready: Tomasz Figa <tfiga@chromium.org>
> Tested-by: Tomasz Figa <tfiga@chromium.org>
> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
>

BUG=b:36063477
BUG=b:37406655
BUG=b:37649533

Change-Id: Ia34ebd9648c7c52d9727c016adf5136c2bb99667
Reviewed-on: https://chromium-review.googlesource.com/487556
Commit-Ready: Tomasz Figa <tfiga@chromium.org>
Tested-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
(cherry picked from commit a936595064b40c17bf91ced06f6d3010b913fa5e)
Reviewed-on: https://chromium-review.googlesource.com/489001
Commit-Queue: Tomasz Figa <tfiga@chromium.org>
Trybot-Ready: Tomasz Figa <tfiga@chromium.org>
2 files changed