summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Macnak <natsu@google.com>2021-09-23 13:41:24 -0700
committerJason Macnak <natsu@google.com>2021-09-24 15:19:58 -0700
commitfe16e9267d8dec34c94d3ea4183033b92cca2905 (patch)
tree0c16d62467abaaf70e413199f2c5e92f266b0928
parenta2d5be3e8b46d680e15ca676090af2f1a8be70ef (diff)
downloadvulkan-cereal-fe16e9267d8dec34c94d3ea4183033b92cca2905.tar.gz
Add waitSync to ColorBuffer readixels[YUV]() methods
... to ensure that composition has completed before readPixels() occurs when gralloc->lock()'ing the composition target buffer. Bug: b/200983559 Bug: b/200056720 Test: launch_cvd --gpu_mode=gfxstream and observe no tearing Change-Id: I67c7d1d9a444b79cfc350ea337299c98cc09c14a
-rw-r--r--stream-servers/ColorBuffer.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/stream-servers/ColorBuffer.cpp b/stream-servers/ColorBuffer.cpp
index a01002f6..100aad6a 100644
--- a/stream-servers/ColorBuffer.cpp
+++ b/stream-servers/ColorBuffer.cpp
@@ -371,6 +371,7 @@ void ColorBuffer::readPixels(int x,
}
p_format = sGetUnsizedColorBufferFormat(p_format);
touch();
+ waitSync();
if (bindFbo(&m_fbo, m_tex)) {
GLint prevAlignment = 0;
@@ -394,6 +395,7 @@ void ColorBuffer::readPixelsScaled(int width,
}
p_format = sGetUnsizedColorBufferFormat(p_format);
touch();
+ waitSync();
GLuint tex = m_resizer->update(m_tex, width, height, rotation);
if (bindFbo(&m_scaleRotationFbo, tex)) {
GLint prevAlignment = 0;
@@ -417,6 +419,7 @@ void ColorBuffer::readPixelsYUVCached(int x,
}
touch();
+ waitSync();
#if DEBUG_CB_FBO
fprintf(stderr, "%s %d request width %d height %d\n", __func__, __LINE__,