diff options
author | Greg Daniel <egdaniel@google.com> | 2021-06-08 14:24:06 -0400 |
---|---|---|
committer | Greg Daniel <egdaniel@google.com> | 2021-06-08 14:30:24 -0400 |
commit | ffc50c689fe8e577fd9ed1e6ecf828e27b4344e3 (patch) | |
tree | 4f1ae9a7afbd5ad3b6425c9e24e1719499f1d77a /libs/hwui/renderthread/VulkanSurface.cpp | |
parent | 209f21d2aebed64af8aa6b917af309596ac0b268 (diff) |
Reset buffer tracking state in VulkanSurface.
When we fail to create an SkSurface from a dequeued
buffer we then call cancelBuffer on that buffer. However,
we don't update our tracking to say the buffer is no
longer dequeued with and doesn't own the fence any more.
I don't think this is the main issue causing the crash in
the attached bug because I don't think we're seeing the
error in the logs for this chunk of code. However this
possibly related issue was found while tracking down our
use of the dequeue_fence fd.
Test: manual building and running of phone
Bug: 187240173
Change-Id: Icb4099eeea5be6aedd5376e07a6e3454f5d1d1e3
Diffstat (limited to 'libs/hwui/renderthread/VulkanSurface.cpp')
-rw-r--r-- | libs/hwui/renderthread/VulkanSurface.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libs/hwui/renderthread/VulkanSurface.cpp b/libs/hwui/renderthread/VulkanSurface.cpp index 01a2ec5116df..fe9a30a59870 100644 --- a/libs/hwui/renderthread/VulkanSurface.cpp +++ b/libs/hwui/renderthread/VulkanSurface.cpp @@ -429,7 +429,9 @@ VulkanSurface::NativeBufferInfo* VulkanSurface::dequeueNativeBuffer() { kTopLeft_GrSurfaceOrigin, mWindowInfo.colorspace, nullptr); if (bufferInfo->skSurface.get() == nullptr) { ALOGE("SkSurface::MakeFromAHardwareBuffer failed"); - mNativeWindow->cancelBuffer(mNativeWindow.get(), buffer, fence_fd.release()); + mNativeWindow->cancelBuffer(mNativeWindow.get(), buffer, + mNativeBuffers[idx].dequeue_fence.release()); + mNativeBuffers[idx].dequeued = false; return nullptr; } } |