gpu: Fix partial damage update synchronization in BufferQueue.

BufferQueue maintains tracking for damage in previous frames, and copies
it to the buffer for the current frame for partial swap. But because
the copy happens after generating the ready fence for the
OutputSurface's overlay, this creates a synchronization bug where the
display controller could try to read from this overlay while the GPU is
still writing to it.

Avoid this by notifying the OutputSurface of the damage for the current
frame before the ready fence is generated.

R=piman@chromium.org

Bug: 889530
Change-Id: Ic9e099c0bea7b8c990d1485d581590ee3ce81b77
Reviewed-on: https://chromium-review.googlesource.com/c/1487884
Commit-Queue: Khushal <khushalsagar@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Reviewed-by: Daniele Castagna <dcastagna@chromium.org>
Cr-Commit-Position: refs/heads/master@{#635873}
14 files changed