summaryrefslogtreecommitdiff
path: root/libs/gui/Surface.cpp
diff options
context:
space:
mode:
author Pablo Ceballos <pceballos@google.com> 2015-08-26 18:59:08 -0700
committer Pablo Ceballos <pceballos@google.com> 2015-09-24 15:22:42 -0700
commit567dbbb6dd42be5013fcde0dadb3316d85f2fa0d (patch)
tree5072cd29a7d0dc5be17f5a27f805c42c12ebcdbb /libs/gui/Surface.cpp
parent1ec0f48cbd44a56c360d075849655ab2c3f36476 (diff)
BQ: get rid of async in producer interface
- Get rid of the async flag in dequeueBuffer, allocateBuffers, waitForFreeSlotThenRelock, and QueueBufferInput. - Instead use the persistent flags mDequeueBufferCannotBlock and mAsyncMode to determine whether to use the async behavior. Bug 13174928 Change-Id: Ie6f7b9e46ee3844ee77b102003c84dddf1bcafdd
Diffstat (limited to 'libs/gui/Surface.cpp')
-rw-r--r--libs/gui/Surface.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/libs/gui/Surface.cpp b/libs/gui/Surface.cpp
index de5c2750e0..a31876bcc9 100644
--- a/libs/gui/Surface.cpp
+++ b/libs/gui/Surface.cpp
@@ -99,8 +99,8 @@ void Surface::setSidebandStream(const sp<NativeHandle>& stream) {
void Surface::allocateBuffers() {
uint32_t reqWidth = mReqWidth ? mReqWidth : mUserWidth;
uint32_t reqHeight = mReqHeight ? mReqHeight : mUserHeight;
- mGraphicBufferProducer->allocateBuffers(mSwapIntervalZero, reqWidth,
- reqHeight, mReqFormat, mReqUsage);
+ mGraphicBufferProducer->allocateBuffers(reqWidth, reqHeight,
+ mReqFormat, mReqUsage);
}
status_t Surface::setGenerationNumber(uint32_t generation) {
@@ -202,6 +202,7 @@ int Surface::setSwapInterval(int interval) {
interval = maxSwapInterval;
mSwapIntervalZero = (interval == 0);
+ mGraphicBufferProducer->setAsyncMode(mSwapIntervalZero);
return NO_ERROR;
}
@@ -212,7 +213,6 @@ int Surface::dequeueBuffer(android_native_buffer_t** buffer, int* fenceFd) {
uint32_t reqWidth;
uint32_t reqHeight;
- bool swapIntervalZero;
PixelFormat reqFormat;
uint32_t reqUsage;
@@ -222,20 +222,19 @@ int Surface::dequeueBuffer(android_native_buffer_t** buffer, int* fenceFd) {
reqWidth = mReqWidth ? mReqWidth : mUserWidth;
reqHeight = mReqHeight ? mReqHeight : mUserHeight;
- swapIntervalZero = mSwapIntervalZero;
reqFormat = mReqFormat;
reqUsage = mReqUsage;
} // Drop the lock so that we can still touch the Surface while blocking in IGBP::dequeueBuffer
int buf = -1;
sp<Fence> fence;
- status_t result = mGraphicBufferProducer->dequeueBuffer(&buf, &fence, swapIntervalZero,
+ status_t result = mGraphicBufferProducer->dequeueBuffer(&buf, &fence,
reqWidth, reqHeight, reqFormat, reqUsage);
if (result < 0) {
- ALOGV("dequeueBuffer: IGraphicBufferProducer::dequeueBuffer(%d, %d, %d, %d, %d)"
- "failed: %d", swapIntervalZero, reqWidth, reqHeight, reqFormat,
- reqUsage, result);
+ ALOGV("dequeueBuffer: IGraphicBufferProducer::dequeueBuffer"
+ "(%d, %d, %d, %d) failed: %d", reqWidth, reqHeight, reqFormat,
+ reqUsage, result);
return result;
}
@@ -341,7 +340,7 @@ int Surface::queueBuffer(android_native_buffer_t* buffer, int fenceFd) {
IGraphicBufferProducer::QueueBufferOutput output;
IGraphicBufferProducer::QueueBufferInput input(timestamp, isAutoTimestamp,
mDataSpace, crop, mScalingMode, mTransform ^ mStickyTransform,
- mSwapIntervalZero, fence, mStickyTransform);
+ fence, mStickyTransform);
if (mConnectedToCpu || mDirtyRegion.bounds() == Rect::INVALID_RECT) {
input.setSurfaceDamage(Region::INVALID_REGION);