summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/RegionSamplingThread.cpp
diff options
context:
space:
mode:
author Alec Mouri <alecmouri@google.com> 2021-02-12 11:16:54 -0800
committer Alec Mouri <alecmouri@google.com> 2021-02-12 11:32:58 -0800
commit7013b6f31163d9850fffec36f9dfc1ea61877a42 (patch)
tree69804a26549039836f316755038b4b34e5a5c4d9 /services/surfaceflinger/RegionSamplingThread.cpp
parente06403fa179494d6c5cafd0b4ffce767413eb14c (diff)
Check status codes of GraphicBuffers on allocation
We're getting reports of buffers transiently missing usage bits when allocated from SurfaceFlinger causing strange issues. Fatal logging when there is an allocation error will hopefully aid in triaging future bug reports. Bug: 157562905 Bug: 179786581 Test: build, boots Change-Id: I715295c0b6b3450e71181d93391dd99616f89d26
Diffstat (limited to 'services/surfaceflinger/RegionSamplingThread.cpp')
-rw-r--r--services/surfaceflinger/RegionSamplingThread.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/services/surfaceflinger/RegionSamplingThread.cpp b/services/surfaceflinger/RegionSamplingThread.cpp
index 9186538c0a..09615f920d 100644
--- a/services/surfaceflinger/RegionSamplingThread.cpp
+++ b/services/surfaceflinger/RegionSamplingThread.cpp
@@ -447,6 +447,9 @@ void RegionSamplingThread::captureSample() {
GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_TEXTURE;
buffer = new GraphicBuffer(sampledBounds.getWidth(), sampledBounds.getHeight(),
PIXEL_FORMAT_RGBA_8888, 1, usage, "RegionSamplingThread");
+ const status_t bufferStatus = buffer->initCheck();
+ LOG_ALWAYS_FATAL_IF(bufferStatus != OK, "captureSample: Buffer failed to allocate: %d",
+ bufferStatus);
}
const sp<SyncScreenCaptureListener> captureListener = new SyncScreenCaptureListener();