diff options
author | 2017-05-21 22:21:13 +0000 | |
---|---|---|
committer | 2017-05-21 22:21:13 +0000 | |
commit | 1671de0068de40f57288628d4b757a1c84962a62 (patch) | |
tree | a85bb3071a1156a735de48621b9d1f3e91402629 /libs/gui/BufferQueueProducer.cpp | |
parent | 175d98757d7d9003d4f64756cf4c2b366ba77e97 (diff) |
Revert "use 64-bits usage bits almost everywhere"
Bug: 38466700
This reverts commit 175d98757d7d9003d4f64756cf4c2b366ba77e97.
Change-Id: I5f08a4ca91511775cd52250d10a0220b258b8368
Diffstat (limited to 'libs/gui/BufferQueueProducer.cpp')
-rw-r--r-- | libs/gui/BufferQueueProducer.cpp | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/libs/gui/BufferQueueProducer.cpp b/libs/gui/BufferQueueProducer.cpp index a9629a43b9..b76e2c68b5 100644 --- a/libs/gui/BufferQueueProducer.cpp +++ b/libs/gui/BufferQueueProducer.cpp @@ -349,7 +349,7 @@ status_t BufferQueueProducer::waitForFreeSlotThenRelock(FreeSlotCaller caller, status_t BufferQueueProducer::dequeueBuffer(int *outSlot, sp<android::Fence> *outFence, uint32_t width, uint32_t height, - PixelFormat format, uint64_t usage, + PixelFormat format, uint32_t usage, FrameEventHistoryDelta* outTimestamps) { ATRACE_CALL(); { // Autolock scope @@ -367,7 +367,8 @@ status_t BufferQueueProducer::dequeueBuffer(int *outSlot, } } // Autolock scope - BQ_LOGV("dequeueBuffer: w=%u h=%u format=%#x, usage=%#" PRIx64, width, height, format, usage); + BQ_LOGV("dequeueBuffer: w=%u h=%u format=%#x, usage=%#x", width, height, + format, usage); if ((width && !height) || (!width && height)) { BQ_LOGE("dequeueBuffer: invalid size: w=%u h=%u", width, height); @@ -417,9 +418,11 @@ status_t BufferQueueProducer::dequeueBuffer(int *outSlot, // buffer. If this buffer would require reallocation to meet the // requested attributes, we free it and attempt to get another one. if (!mCore->mAllowAllocation) { - if (buffer->needsReallocation(width, height, format, BQ_LAYER_COUNT, usage)) { + if (buffer->needsReallocation(width, height, format, + BQ_LAYER_COUNT, usage)) { if (mCore->mSharedBufferSlot == found) { - BQ_LOGE("dequeueBuffer: cannot re-allocate a sharedbuffer"); + BQ_LOGE("dequeueBuffer: cannot re-allocate a shared" + "buffer"); return BAD_VALUE; } mCore->mFreeSlots.insert(found); @@ -432,7 +435,8 @@ status_t BufferQueueProducer::dequeueBuffer(int *outSlot, const sp<GraphicBuffer>& buffer(mSlots[found].mGraphicBuffer); if (mCore->mSharedBufferSlot == found && - buffer->needsReallocation(width, height, format, BQ_LAYER_COUNT, usage)) { + buffer->needsReallocation(width, height, format, + BQ_LAYER_COUNT, usage)) { BQ_LOGE("dequeueBuffer: cannot re-allocate a shared" "buffer"); @@ -466,7 +470,8 @@ status_t BufferQueueProducer::dequeueBuffer(int *outSlot, } else { // We add 1 because that will be the frame number when this buffer // is queued - mCore->mBufferAge = mCore->mFrameCounter + 1 - mSlots[found].mFrameNumber; + mCore->mBufferAge = + mCore->mFrameCounter + 1 - mSlots[found].mFrameNumber; } BQ_LOGV("dequeueBuffer: setting buffer age to %" PRIu64, @@ -1308,14 +1313,14 @@ status_t BufferQueueProducer::setSidebandStream(const sp<NativeHandle>& stream) } void BufferQueueProducer::allocateBuffers(uint32_t width, uint32_t height, - PixelFormat format, uint64_t usage) { + PixelFormat format, uint32_t usage) { ATRACE_CALL(); while (true) { size_t newBufferCount = 0; uint32_t allocWidth = 0; uint32_t allocHeight = 0; PixelFormat allocFormat = PIXEL_FORMAT_UNKNOWN; - uint64_t allocUsage = 0; + uint32_t allocUsage = 0; { // Autolock scope Mutex::Autolock lock(mCore->mMutex); mCore->waitWhileAllocatingLocked(); @@ -1349,7 +1354,7 @@ void BufferQueueProducer::allocateBuffers(uint32_t width, uint32_t height, if (result != NO_ERROR) { BQ_LOGE("allocateBuffers: failed to allocate buffer (%u x %u, format" - " %u, usage %#" PRIx64 ")", width, height, format, usage); + " %u, usage %u)", width, height, format, usage); Mutex::Autolock lock(mCore->mMutex); mCore->mIsAllocating = false; mCore->mIsAllocatingCondition.broadcast(); @@ -1364,7 +1369,7 @@ void BufferQueueProducer::allocateBuffers(uint32_t width, uint32_t height, uint32_t checkHeight = height > 0 ? height : mCore->mDefaultHeight; PixelFormat checkFormat = format != 0 ? format : mCore->mDefaultBufferFormat; - uint64_t checkUsage = usage | mCore->mConsumerUsageBits; + uint32_t checkUsage = usage | mCore->mConsumerUsageBits; if (checkWidth != allocWidth || checkHeight != allocHeight || checkFormat != allocFormat || checkUsage != allocUsage) { // Something changed while we released the lock. Retry. |