blob: 82c963be7ba819e4ef2d441d48220f47e357060e [file] [log] [blame]
Robert Carr78c25dd2019-08-15 14:10:33 -07001/*
2 * Copyright (C) 2019 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Valerie Haud3b90d22019-11-06 09:37:31 -080017#undef LOG_TAG
18#define LOG_TAG "BLASTBufferQueue"
19
Valerie Haua32c5522019-12-09 10:11:08 -080020#define ATRACE_TAG ATRACE_TAG_GRAPHICS
Vishnu Naire1a42322020-10-02 17:42:04 -070021//#define LOG_NDEBUG 0
Valerie Haua32c5522019-12-09 10:11:08 -080022
Robert Carr78c25dd2019-08-15 14:10:33 -070023#include <gui/BLASTBufferQueue.h>
24#include <gui/BufferItemConsumer.h>
Valerie Hau45e4b3b2019-12-03 10:49:17 -080025#include <gui/GLConsumer.h>
Robert Carr05086b22020-10-13 18:22:51 -070026#include <gui/Surface.h>
Robert Carr78c25dd2019-08-15 14:10:33 -070027
Valerie Haua32c5522019-12-09 10:11:08 -080028#include <utils/Trace.h>
29
Robert Carr78c25dd2019-08-15 14:10:33 -070030#include <chrono>
31
32using namespace std::chrono_literals;
33
Vishnu Nairdab94092020-09-29 16:09:04 -070034namespace {
35inline const char* toString(bool b) {
36 return b ? "true" : "false";
37}
38} // namespace
39
Robert Carr78c25dd2019-08-15 14:10:33 -070040namespace android {
41
Vishnu Nairdab94092020-09-29 16:09:04 -070042// Macros to include adapter info in log messages
43#define BQA_LOGV(x, ...) \
44 ALOGV("[%s](f:%u,a:%u) " x, mName.c_str(), mNumFrameAvailable, mNumAcquired, ##__VA_ARGS__)
45#define BQA_LOGE(x, ...) \
46 ALOGE("[%s](f:%u,a:%u) " x, mName.c_str(), mNumFrameAvailable, mNumAcquired, ##__VA_ARGS__)
47
Valerie Hau871d6352020-01-29 08:44:02 -080048void BLASTBufferItemConsumer::onDisconnect() {
49 Mutex::Autolock lock(mFrameEventHistoryMutex);
50 mPreviouslyConnected = mCurrentlyConnected;
51 mCurrentlyConnected = false;
52 if (mPreviouslyConnected) {
53 mDisconnectEvents.push(mCurrentFrameNumber);
54 }
55 mFrameEventHistory.onDisconnect();
56}
57
58void BLASTBufferItemConsumer::addAndGetFrameTimestamps(const NewFrameEventsEntry* newTimestamps,
59 FrameEventHistoryDelta* outDelta) {
60 Mutex::Autolock lock(mFrameEventHistoryMutex);
61 if (newTimestamps) {
62 // BufferQueueProducer only adds a new timestamp on
63 // queueBuffer
64 mCurrentFrameNumber = newTimestamps->frameNumber;
65 mFrameEventHistory.addQueue(*newTimestamps);
66 }
67 if (outDelta) {
68 // frame event histories will be processed
69 // only after the producer connects and requests
70 // deltas for the first time. Forward this intent
71 // to SF-side to turn event processing back on
72 mPreviouslyConnected = mCurrentlyConnected;
73 mCurrentlyConnected = true;
74 mFrameEventHistory.getAndResetDelta(outDelta);
75 }
76}
77
78void BLASTBufferItemConsumer::updateFrameTimestamps(uint64_t frameNumber, nsecs_t refreshStartTime,
79 const sp<Fence>& glDoneFence,
80 const sp<Fence>& presentFence,
81 const sp<Fence>& prevReleaseFence,
82 CompositorTiming compositorTiming,
83 nsecs_t latchTime, nsecs_t dequeueReadyTime) {
84 Mutex::Autolock lock(mFrameEventHistoryMutex);
85
86 // if the producer is not connected, don't bother updating,
87 // the next producer that connects won't access this frame event
88 if (!mCurrentlyConnected) return;
89 std::shared_ptr<FenceTime> glDoneFenceTime = std::make_shared<FenceTime>(glDoneFence);
90 std::shared_ptr<FenceTime> presentFenceTime = std::make_shared<FenceTime>(presentFence);
91 std::shared_ptr<FenceTime> releaseFenceTime = std::make_shared<FenceTime>(prevReleaseFence);
92
93 mFrameEventHistory.addLatch(frameNumber, latchTime);
94 mFrameEventHistory.addRelease(frameNumber, dequeueReadyTime, std::move(releaseFenceTime));
95 mFrameEventHistory.addPreComposition(frameNumber, refreshStartTime);
96 mFrameEventHistory.addPostComposition(frameNumber, glDoneFenceTime, presentFenceTime,
97 compositorTiming);
98}
99
100void BLASTBufferItemConsumer::getConnectionEvents(uint64_t frameNumber, bool* needsDisconnect) {
101 bool disconnect = false;
102 Mutex::Autolock lock(mFrameEventHistoryMutex);
103 while (!mDisconnectEvents.empty() && mDisconnectEvents.front() <= frameNumber) {
104 disconnect = true;
105 mDisconnectEvents.pop();
106 }
107 if (needsDisconnect != nullptr) *needsDisconnect = disconnect;
108}
109
Vishnu Nairdab94092020-09-29 16:09:04 -0700110BLASTBufferQueue::BLASTBufferQueue(const std::string& name, const sp<SurfaceControl>& surface,
111 int width, int height, bool enableTripleBuffering)
112 : mName(name),
113 mSurfaceControl(surface),
Valerie Haud3b90d22019-11-06 09:37:31 -0800114 mWidth(width),
115 mHeight(height),
116 mNextTransaction(nullptr) {
Robert Carr78c25dd2019-08-15 14:10:33 -0700117 BufferQueue::createBufferQueue(&mProducer, &mConsumer);
Valerie Hau0889c622020-02-19 15:04:47 -0800118 // since the adapter is in the client process, set dequeue timeout
119 // explicitly so that dequeueBuffer will block
120 mProducer->setDequeueTimeout(std::numeric_limits<int64_t>::max());
Valerie Hau65b8e872020-02-13 09:45:14 -0800121
Robert Carrcedef052020-04-22 15:58:23 -0700122 if (enableTripleBuffering) {
Valerie Hau65b8e872020-02-13 09:45:14 -0800123 mProducer->setMaxDequeuedBufferCount(2);
124 }
Robert Carr78c25dd2019-08-15 14:10:33 -0700125 mBufferItemConsumer =
Robert Carr5b2ae912020-04-01 15:40:40 -0700126 new BLASTBufferItemConsumer(mConsumer, GraphicBuffer::USAGE_HW_COMPOSER, 1, true);
Valerie Haua32c5522019-12-09 10:11:08 -0800127 static int32_t id = 0;
Vishnu Nairdab94092020-09-29 16:09:04 -0700128 auto consumerName = mName + "(BLAST Consumer)" + std::to_string(id);
Valerie Haua32c5522019-12-09 10:11:08 -0800129 id++;
Vishnu Nairdab94092020-09-29 16:09:04 -0700130 mBufferItemConsumer->setName(String8(consumerName.c_str()));
Robert Carr78c25dd2019-08-15 14:10:33 -0700131 mBufferItemConsumer->setFrameAvailableListener(this);
132 mBufferItemConsumer->setBufferFreedListener(this);
133 mBufferItemConsumer->setDefaultBufferSize(mWidth, mHeight);
134 mBufferItemConsumer->setDefaultBufferFormat(PIXEL_FORMAT_RGBA_8888);
Robert Carr9f133d72020-04-01 15:51:46 -0700135
Valerie Hau2882e982020-01-23 13:33:10 -0800136 mTransformHint = mSurfaceControl->getTransformHint();
Robert Carr9f133d72020-04-01 15:51:46 -0700137 mBufferItemConsumer->setTransformHint(mTransformHint);
Valerie Haud3b90d22019-11-06 09:37:31 -0800138
Valerie Haua32c5522019-12-09 10:11:08 -0800139 mNumAcquired = 0;
140 mNumFrameAvailable = 0;
141 mPendingReleaseItem.item = BufferItem();
142 mPendingReleaseItem.releaseFence = nullptr;
Robert Carr78c25dd2019-08-15 14:10:33 -0700143}
144
Vishnu Nairdab94092020-09-29 16:09:04 -0700145void BLASTBufferQueue::update(const sp<SurfaceControl>& surface, uint32_t width, uint32_t height) {
Robert Carr78c25dd2019-08-15 14:10:33 -0700146 std::unique_lock _lock{mMutex};
147 mSurfaceControl = surface;
Robert Carrfc416512020-04-02 12:32:44 -0700148
149 if (mWidth != width || mHeight != height) {
150 mWidth = width;
151 mHeight = height;
152 mBufferItemConsumer->setDefaultBufferSize(mWidth, mHeight);
153 }
Robert Carr78c25dd2019-08-15 14:10:33 -0700154}
155
156static void transactionCallbackThunk(void* context, nsecs_t latchTime,
157 const sp<Fence>& presentFence,
158 const std::vector<SurfaceControlStats>& stats) {
159 if (context == nullptr) {
160 return;
161 }
162 BLASTBufferQueue* bq = static_cast<BLASTBufferQueue*>(context);
163 bq->transactionCallback(latchTime, presentFence, stats);
164}
165
166void BLASTBufferQueue::transactionCallback(nsecs_t /*latchTime*/, const sp<Fence>& /*presentFence*/,
167 const std::vector<SurfaceControlStats>& stats) {
168 std::unique_lock _lock{mMutex};
Valerie Haua32c5522019-12-09 10:11:08 -0800169 ATRACE_CALL();
Vishnu Nairdab94092020-09-29 16:09:04 -0700170 BQA_LOGV("transactionCallback");
Vishnu Nair670b3f72020-09-29 17:52:18 -0700171 mInitialCallbackReceived = true;
Vishnu Nairdab94092020-09-29 16:09:04 -0700172
Valerie Hau871d6352020-01-29 08:44:02 -0800173 if (!stats.empty()) {
174 mTransformHint = stats[0].transformHint;
175 mBufferItemConsumer->setTransformHint(mTransformHint);
176 mBufferItemConsumer->updateFrameTimestamps(stats[0].frameEventStats.frameNumber,
177 stats[0].frameEventStats.refreshStartTime,
178 stats[0].frameEventStats.gpuCompositionDoneFence,
179 stats[0].presentFence,
180 stats[0].previousReleaseFence,
181 stats[0].frameEventStats.compositorTiming,
182 stats[0].latchTime,
183 stats[0].frameEventStats.dequeueReadyTime);
184 }
Valerie Haua32c5522019-12-09 10:11:08 -0800185 if (mPendingReleaseItem.item.mGraphicBuffer != nullptr) {
Valerie Hau871d6352020-01-29 08:44:02 -0800186 if (!stats.empty()) {
Valerie Haua32c5522019-12-09 10:11:08 -0800187 mPendingReleaseItem.releaseFence = stats[0].previousReleaseFence;
Valerie Haua32c5522019-12-09 10:11:08 -0800188 } else {
Vishnu Nair670b3f72020-09-29 17:52:18 -0700189 BQA_LOGE("Warning: no SurfaceControlStats returned in BLASTBufferQueue callback");
Valerie Haua32c5522019-12-09 10:11:08 -0800190 mPendingReleaseItem.releaseFence = nullptr;
191 }
192 mBufferItemConsumer->releaseBuffer(mPendingReleaseItem.item,
193 mPendingReleaseItem.releaseFence
194 ? mPendingReleaseItem.releaseFence
Robert Carr78c25dd2019-08-15 14:10:33 -0700195 : Fence::NO_FENCE);
Valerie Haua32c5522019-12-09 10:11:08 -0800196 mNumAcquired--;
197 mPendingReleaseItem.item = BufferItem();
198 mPendingReleaseItem.releaseFence = nullptr;
Robert Carr78c25dd2019-08-15 14:10:33 -0700199 }
Valerie Haua32c5522019-12-09 10:11:08 -0800200
201 if (mSubmitted.empty()) {
Vishnu Nair670b3f72020-09-29 17:52:18 -0700202 BQA_LOGE("ERROR: callback with no corresponding submitted buffer item");
Valerie Haua32c5522019-12-09 10:11:08 -0800203 }
204 mPendingReleaseItem.item = std::move(mSubmitted.front());
205 mSubmitted.pop();
Robert Carre4943eb2020-02-15 18:34:59 -0800206
Robert Carr255acdc2020-04-17 14:08:55 -0700207 processNextBufferLocked(false);
Robert Carre4943eb2020-02-15 18:34:59 -0800208
Valerie Haud3b90d22019-11-06 09:37:31 -0800209 mCallbackCV.notify_all();
Robert Carr78c25dd2019-08-15 14:10:33 -0700210 decStrong((void*)transactionCallbackThunk);
211}
212
Robert Carr255acdc2020-04-17 14:08:55 -0700213void BLASTBufferQueue::processNextBufferLocked(bool useNextTransaction) {
Valerie Haua32c5522019-12-09 10:11:08 -0800214 ATRACE_CALL();
Vishnu Nairdab94092020-09-29 16:09:04 -0700215 BQA_LOGV("processNextBufferLocked useNextTransaction=%s", toString(useNextTransaction));
216
Vishnu Nairbf255772020-10-16 10:54:41 -0700217 // Wait to acquire a buffer if there are no frames available or we have acquired the max
Vishnu Nair670b3f72020-09-29 17:52:18 -0700218 // number of buffers.
Vishnu Nairbf255772020-10-16 10:54:41 -0700219 if (mNumFrameAvailable == 0 || maxBuffersAcquired()) {
Vishnu Nair670b3f72020-09-29 17:52:18 -0700220 BQA_LOGV("processNextBufferLocked waiting for frame available or callback");
Valerie Haud3b90d22019-11-06 09:37:31 -0800221 return;
222 }
223
Valerie Haua32c5522019-12-09 10:11:08 -0800224 if (mSurfaceControl == nullptr) {
Vishnu Nair670b3f72020-09-29 17:52:18 -0700225 BQA_LOGE("ERROR : surface control is null");
Valerie Haud3b90d22019-11-06 09:37:31 -0800226 return;
227 }
228
Robert Carr78c25dd2019-08-15 14:10:33 -0700229 SurfaceComposerClient::Transaction localTransaction;
230 bool applyTransaction = true;
231 SurfaceComposerClient::Transaction* t = &localTransaction;
Robert Carr255acdc2020-04-17 14:08:55 -0700232 if (mNextTransaction != nullptr && useNextTransaction) {
Robert Carr78c25dd2019-08-15 14:10:33 -0700233 t = mNextTransaction;
234 mNextTransaction = nullptr;
235 applyTransaction = false;
236 }
237
Valerie Haua32c5522019-12-09 10:11:08 -0800238 BufferItem bufferItem;
Valerie Haud3b90d22019-11-06 09:37:31 -0800239
Valerie Haua32c5522019-12-09 10:11:08 -0800240 status_t status = mBufferItemConsumer->acquireBuffer(&bufferItem, -1, false);
Robert Carr78c25dd2019-08-15 14:10:33 -0700241 if (status != OK) {
Vishnu Nairbf255772020-10-16 10:54:41 -0700242 BQA_LOGE("Failed to acquire a buffer, err=%s", statusToString(status).c_str());
Robert Carr78c25dd2019-08-15 14:10:33 -0700243 return;
244 }
Valerie Haua32c5522019-12-09 10:11:08 -0800245 auto buffer = bufferItem.mGraphicBuffer;
246 mNumFrameAvailable--;
247
248 if (buffer == nullptr) {
249 mBufferItemConsumer->releaseBuffer(bufferItem, Fence::NO_FENCE);
Vishnu Nairbf255772020-10-16 10:54:41 -0700250 BQA_LOGE("Buffer was empty");
Valerie Haua32c5522019-12-09 10:11:08 -0800251 return;
252 }
253
Vishnu Nair670b3f72020-09-29 17:52:18 -0700254 if (rejectBuffer(bufferItem)) {
Vishnu Naire1a42322020-10-02 17:42:04 -0700255 BQA_LOGE("rejecting buffer:configured size=%dx%d, buffer{size=%dx%d transform=%d}", mWidth,
256 mHeight, buffer->getWidth(), buffer->getHeight(), bufferItem.mTransform);
Vishnu Nair7eb670a2020-10-15 12:16:10 -0700257 // TODO(b/168917217) temporarily don't reject buffers until we can synchronize buffer size
258 // changes from ViewRootImpl.
Vishnu Nair670b3f72020-09-29 17:52:18 -0700259 }
260
Valerie Haua32c5522019-12-09 10:11:08 -0800261 mNumAcquired++;
262 mSubmitted.push(bufferItem);
Robert Carr78c25dd2019-08-15 14:10:33 -0700263
Valerie Hau871d6352020-01-29 08:44:02 -0800264 bool needsDisconnect = false;
265 mBufferItemConsumer->getConnectionEvents(bufferItem.mFrameNumber, &needsDisconnect);
266
267 // if producer disconnected before, notify SurfaceFlinger
268 if (needsDisconnect) {
269 t->notifyProducerDisconnect(mSurfaceControl);
270 }
271
Robert Carr78c25dd2019-08-15 14:10:33 -0700272 // Ensure BLASTBufferQueue stays alive until we receive the transaction complete callback.
273 incStrong((void*)transactionCallbackThunk);
274
275 t->setBuffer(mSurfaceControl, buffer);
276 t->setAcquireFence(mSurfaceControl,
Valerie Haua32c5522019-12-09 10:11:08 -0800277 bufferItem.mFence ? new Fence(bufferItem.mFence->dup()) : Fence::NO_FENCE);
Robert Carr78c25dd2019-08-15 14:10:33 -0700278 t->addTransactionCompletedCallback(transactionCallbackThunk, static_cast<void*>(this));
279
Vishnu Nairdab94092020-09-29 16:09:04 -0700280 t->setFrame(mSurfaceControl,
281 {0, 0, static_cast<int32_t>(mWidth), static_cast<int32_t>(mHeight)});
Valerie Haua32c5522019-12-09 10:11:08 -0800282 t->setCrop(mSurfaceControl, computeCrop(bufferItem));
283 t->setTransform(mSurfaceControl, bufferItem.mTransform);
Valerie Hau2882e982020-01-23 13:33:10 -0800284 t->setTransformToDisplayInverse(mSurfaceControl, bufferItem.mTransformToDisplayInverse);
Valerie Hau181abd32020-01-27 14:18:28 -0800285 t->setDesiredPresentTime(bufferItem.mTimestamp);
Vishnu Nair6b7c5c92020-09-29 17:27:05 -0700286 t->setFrameNumber(mSurfaceControl, bufferItem.mFrameNumber);
Robert Carr78c25dd2019-08-15 14:10:33 -0700287
288 if (applyTransaction) {
Robert Carr78c25dd2019-08-15 14:10:33 -0700289 t->apply();
Robert Carr78c25dd2019-08-15 14:10:33 -0700290 }
Vishnu Nairdab94092020-09-29 16:09:04 -0700291
292 BQA_LOGV("processNextBufferLocked size=%dx%d mFrameNumber=%" PRIu64
293 " applyTransaction=%s mTimestamp=%" PRId64,
294 mWidth, mHeight, bufferItem.mFrameNumber, toString(applyTransaction),
295 bufferItem.mTimestamp);
Robert Carr78c25dd2019-08-15 14:10:33 -0700296}
297
Valerie Hau45e4b3b2019-12-03 10:49:17 -0800298Rect BLASTBufferQueue::computeCrop(const BufferItem& item) {
299 if (item.mScalingMode == NATIVE_WINDOW_SCALING_MODE_SCALE_CROP) {
300 return GLConsumer::scaleDownCrop(item.mCrop, mWidth, mHeight);
301 }
302 return item.mCrop;
303}
304
Valerie Haua32c5522019-12-09 10:11:08 -0800305void BLASTBufferQueue::onFrameAvailable(const BufferItem& /*item*/) {
306 ATRACE_CALL();
Valerie Hau0188adf2020-02-13 08:29:20 -0800307 std::unique_lock _lock{mMutex};
Valerie Haud3b90d22019-11-06 09:37:31 -0800308
Vishnu Nairdab94092020-09-29 16:09:04 -0700309 const bool nextTransactionSet = mNextTransaction != nullptr;
Vishnu Nair7eb670a2020-10-15 12:16:10 -0700310 BQA_LOGV("onFrameAvailable nextTransactionSet=%s mFlushShadowQueue=%s",
311 toString(nextTransactionSet), toString(mFlushShadowQueue));
Vishnu Nairdab94092020-09-29 16:09:04 -0700312
Vishnu Nair7eb670a2020-10-15 12:16:10 -0700313 if (nextTransactionSet || mFlushShadowQueue) {
Vishnu Nairbf255772020-10-16 10:54:41 -0700314 while (mNumFrameAvailable > 0 || maxBuffersAcquired()) {
Vishnu Nair7eb670a2020-10-15 12:16:10 -0700315 BQA_LOGV("waiting in onFrameAvailable...");
Valerie Hau0188adf2020-02-13 08:29:20 -0800316 mCallbackCV.wait(_lock);
317 }
318 }
Vishnu Nair7eb670a2020-10-15 12:16:10 -0700319 mFlushShadowQueue = false;
Valerie Haud3b90d22019-11-06 09:37:31 -0800320 // add to shadow queue
Valerie Haua32c5522019-12-09 10:11:08 -0800321 mNumFrameAvailable++;
Robert Carr255acdc2020-04-17 14:08:55 -0700322 processNextBufferLocked(true);
Valerie Haud3b90d22019-11-06 09:37:31 -0800323}
324
Robert Carr78c25dd2019-08-15 14:10:33 -0700325void BLASTBufferQueue::setNextTransaction(SurfaceComposerClient::Transaction* t) {
Valerie Haud3b90d22019-11-06 09:37:31 -0800326 std::lock_guard _lock{mMutex};
Robert Carr78c25dd2019-08-15 14:10:33 -0700327 mNextTransaction = t;
328}
329
Vishnu Nair670b3f72020-09-29 17:52:18 -0700330bool BLASTBufferQueue::rejectBuffer(const BufferItem& item) const {
331 if (item.mScalingMode != NATIVE_WINDOW_SCALING_MODE_FREEZE) {
332 // Only reject buffers if scaling mode is freeze.
333 return false;
334 }
335
Vishnu Naire1a42322020-10-02 17:42:04 -0700336 uint32_t bufWidth = item.mGraphicBuffer->getWidth();
337 uint32_t bufHeight = item.mGraphicBuffer->getHeight();
338
339 // Take the buffer's orientation into account
340 if (item.mTransform & ui::Transform::ROT_90) {
341 std::swap(bufWidth, bufHeight);
342 }
343
Vishnu Nair670b3f72020-09-29 17:52:18 -0700344 // reject buffers if the buffer size doesn't match.
Vishnu Naire1a42322020-10-02 17:42:04 -0700345 return bufWidth != mWidth || bufHeight != mHeight;
Vishnu Nair670b3f72020-09-29 17:52:18 -0700346}
Vishnu Nairbf255772020-10-16 10:54:41 -0700347
348// Check if we have acquired the maximum number of buffers.
349// As a special case, we wait for the first callback before acquiring the second buffer so we
350// can ensure the first buffer is presented if multiple buffers are queued in succession.
351bool BLASTBufferQueue::maxBuffersAcquired() const {
352 return mNumAcquired == MAX_ACQUIRED_BUFFERS + 1 ||
353 (!mInitialCallbackReceived && mNumAcquired == 1);
354}
355
Robert Carr05086b22020-10-13 18:22:51 -0700356class BBQSurface : public Surface {
357public:
358 BBQSurface(const sp<IGraphicBufferProducer>& igbp, bool controlledByApp) :
359 Surface(igbp, controlledByApp) {
360 }
361 void allocateBuffers() override {
362 uint32_t reqWidth = mReqWidth ? mReqWidth : mUserWidth;
363 uint32_t reqHeight = mReqHeight ? mReqHeight : mUserHeight;
364 auto gbp = getIGraphicBufferProducer();
365 std::thread ([reqWidth, reqHeight, gbp=getIGraphicBufferProducer(),
366 reqFormat=mReqFormat, reqUsage=mReqUsage] () {
367 gbp->allocateBuffers(reqWidth, reqHeight,
368 reqFormat, reqUsage);
369
370 }).detach();
371 }
372};
373
374sp<Surface> BLASTBufferQueue::getSurface() {
375 return new BBQSurface(mProducer, true);
376}
377
Robert Carr78c25dd2019-08-15 14:10:33 -0700378} // namespace android