diff options
author | 2016-08-24 12:17:29 -0700 | |
---|---|---|
committer | 2016-08-24 12:17:29 -0700 | |
commit | 024e9313ce69ced1f853d737de680ef9f50ed26d (patch) | |
tree | 0973985deb030d81a76bd123c8e21f3d5c23b7b8 /libs/gui/BufferQueueProducer.cpp | |
parent | ce730f66e2d3745b77ecb212c28771b42e8abf52 (diff) |
Add requestor name to GraphicBuffer alloc metadata
Adds a requestor name (usually the BufferQueue consumer's name) to the
metadata that GraphicBufferAllocator stores on allocation so that
`dumpsys SurfaceFlinger` can attempt to attribute buffer usage to the
correct client.
Bug: 30776557
Change-Id: I6e0f346584c871bb3b9d5481f82b697b0475a916
Diffstat (limited to 'libs/gui/BufferQueueProducer.cpp')
-rw-r--r-- | libs/gui/BufferQueueProducer.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libs/gui/BufferQueueProducer.cpp b/libs/gui/BufferQueueProducer.cpp index 3411dcaafe..30b6c334a3 100644 --- a/libs/gui/BufferQueueProducer.cpp +++ b/libs/gui/BufferQueueProducer.cpp @@ -499,7 +499,8 @@ status_t BufferQueueProducer::dequeueBuffer(int *outSlot, status_t error; BQ_LOGV("dequeueBuffer: allocating a new buffer for slot %d", *outSlot); sp<GraphicBuffer> graphicBuffer(mCore->mAllocator->createGraphicBuffer( - width, height, format, usage, &error)); + width, height, format, usage, + {mConsumerName.string(), mConsumerName.size()}, &error)); { // Autolock scope Mutex::Autolock lock(mCore->mMutex); @@ -1270,7 +1271,8 @@ void BufferQueueProducer::allocateBuffers(uint32_t width, uint32_t height, for (size_t i = 0; i < newBufferCount; ++i) { status_t result = NO_ERROR; sp<GraphicBuffer> graphicBuffer(mCore->mAllocator->createGraphicBuffer( - allocWidth, allocHeight, allocFormat, allocUsage, &result)); + allocWidth, allocHeight, allocFormat, allocUsage, + {mConsumerName.string(), mConsumerName.size()}, &result)); if (result != NO_ERROR) { BQ_LOGE("allocateBuffers: failed to allocate buffer (%u x %u, format" " %u, usage %u)", width, height, format, usage); |