Lines Matching refs:slot

32 status_t BufferHubQueueProducer::requestBuffer(int slot,
34 ALOGD_IF(TRACE, "requestBuffer: slot=%d", slot);
43 if (slot < 0 || slot >= max_buffer_count_) {
44 ALOGE("requestBuffer: slot index %d out of range [0, %d)", slot,
47 } else if (!buffers_[slot].mBufferState.isDequeued()) {
48 ALOGE("requestBuffer: slot %d is not owned by the producer (state = %s)",
49 slot, buffers_[slot].mBufferState.string());
51 } else if (buffers_[slot].mGraphicBuffer != nullptr) {
52 ALOGE("requestBuffer: slot %d is not empty.", slot);
54 } else if (buffers_[slot].mBufferProducer == nullptr) {
55 ALOGE("requestBuffer: slot %d is not dequeued.", slot);
59 const auto& buffer_producer = buffers_[slot].mBufferProducer;
62 buffers_[slot].mGraphicBuffer = graphic_buffer;
63 buffers_[slot].mRequestBufferCalled = true;
155 size_t slot;
160 auto buffer_status = queue_->Dequeue(dequeue_timeout_ms_, &slot, &fence);
177 "from the buffer returned at slot: %zu (w=%u, h=%u, format=%u). Need "
179 width, height, format, slot, buffer_producer->width(),
181 // Mark the slot as reallocating, so that later we can set
183 buffers_[slot].mIsReallocating = true;
187 RemoveBuffer(slot);
198 // With the BufferHub backed solution. Buffer slot returned from
205 LOG_ALWAYS_FATAL_IF((!buffers_[slot].mBufferState.isFree() &&
206 !buffers_[slot].mBufferState.isQueued()),
207 "dequeueBuffer: slot %zu is not free or queued.", slot);
209 buffers_[slot].mBufferState.freeQueued();
210 buffers_[slot].mBufferState.dequeue();
211 ALOGD_IF(TRACE, "dequeueBuffer: slot=%zu", slot);
216 *out_slot = slot;
219 if (buffers_[slot].mIsReallocating) {
221 buffers_[slot].mIsReallocating = false;
227 status_t BufferHubQueueProducer::detachBuffer(int /* slot */) {
247 status_t BufferHubQueueProducer::queueBuffer(int slot,
250 ALOGD_IF(TRACE, "queueBuffer: slot %d", slot);
293 if (slot < 0 || slot >= max_buffer_count_) {
294 ALOGE("queueBuffer: slot index %d out of range [0, %d)", slot,
297 } else if (!buffers_[slot].mBufferState.isDequeued()) {
298 ALOGE("queueBuffer: slot %d is not owned by the producer (state = %s)",
299 slot, buffers_[slot].mBufferState.string());
301 } else if ((!buffers_[slot].mRequestBufferCalled ||
302 buffers_[slot].mGraphicBuffer == nullptr)) {
304 "queueBuffer: slot %d is not requested (mRequestBufferCalled=%d, "
306 slot, buffers_[slot].mRequestBufferCalled,
307 buffers_[slot].mGraphicBuffer.get());
312 const auto& buffer_producer = buffers_[slot].mBufferProducer;
319 ALOGE("queueBuffer: slot %d has out-of-boundary crop.", slot);
337 buffers_[slot].mBufferState.queue();
356 status_t BufferHubQueueProducer::cancelBuffer(int slot,
367 if (slot < 0 || slot >= max_buffer_count_) {
368 ALOGE("cancelBuffer: slot index %d out of range [0, %d)", slot,
371 } else if (!buffers_[slot].mBufferState.isDequeued()) {
372 ALOGE("cancelBuffer: slot %d is not owned by the producer (state = %s)",
373 slot, buffers_[slot].mBufferState.string());
380 auto buffer_producer = buffers_[slot].mBufferProducer;
381 queue_->Enqueue(buffer_producer, slot);
382 buffers_[slot].mBufferState.cancel();
383 buffers_[slot].mFence = fence;
384 ALOGD_IF(TRACE, "cancelBuffer: slot %d", slot);
609 size_t slot;
611 if (queue_->AllocateBuffer(width, height, layer_count, format, usage, &slot) <
617 auto buffer_producer = queue_->GetBuffer(slot);
620 "Failed to get buffer producer at slot: %zu", slot);
622 buffers_[slot].mBufferProducer = buffer_producer;
627 status_t BufferHubQueueProducer::RemoveBuffer(size_t slot) {
628 int ret = queue_->DetachBuffer(slot);
636 buffers_[slot].mBufferProducer = nullptr;
637 buffers_[slot].mGraphicBuffer = nullptr;
638 buffers_[slot].mBufferState.detachProducer();