Lines Matching refs:slot

50 status_t BufferQueueProducer::requestBuffer(int slot, sp<GraphicBuffer>* buf) {
52 BQ_LOGV("requestBuffer: slot %d", slot);
60 if (slot < 0 || slot >= BufferQueueDefs::NUM_BUFFER_SLOTS) {
61 BQ_LOGE("requestBuffer: slot index %d out of range [0, %d)",
62 slot, BufferQueueDefs::NUM_BUFFER_SLOTS);
64 } else if (mSlots[slot].mBufferState != BufferSlot::DEQUEUED) {
65 BQ_LOGE("requestBuffer: slot %d is not owned by the producer "
66 "(state = %d)", slot, mSlots[slot].mBufferState);
70 mSlots[slot].mRequestBufferCalled = true;
71 *buf = mSlots[slot].mGraphicBuffer;
329 "slot=%d w=%d h=%d format=%u",
342 BQ_LOGV("dequeueBuffer: allocating a new buffer for slot %d", *outSlot);
382 BQ_LOGV("dequeueBuffer: returning slot=%d/%" PRIu64 " buf=%p flags=%#x",
390 status_t BufferQueueProducer::detachBuffer(int slot) {
392 ATRACE_BUFFER_INDEX(slot);
393 BQ_LOGV("detachBuffer(P): slot %d", slot);
401 if (slot < 0 || slot >= BufferQueueDefs::NUM_BUFFER_SLOTS) {
402 BQ_LOGE("detachBuffer(P): slot index %d out of range [0, %d)",
403 slot, BufferQueueDefs::NUM_BUFFER_SLOTS);
405 } else if (mSlots[slot].mBufferState != BufferSlot::DEQUEUED) {
406 BQ_LOGE("detachBuffer(P): slot %d is not owned by the producer "
407 "(state = %d)", slot, mSlots[slot].mBufferState);
409 } else if (!mSlots[slot].mRequestBufferCalled) {
410 BQ_LOGE("detachBuffer(P): buffer in slot %d has not been requested",
411 slot);
415 mCore->freeBufferLocked(slot);
441 // Find the oldest valid slot
457 BQ_LOGV("detachNextBuffer detached slot %d", found);
500 BQ_LOGV("attachBuffer(P): returning slot %d flags=%#x",
512 status_t BufferQueueProducer::queueBuffer(int slot,
515 ATRACE_BUFFER_INDEX(slot);
568 if (slot < 0 || slot >= maxBufferCount) {
569 BQ_LOGE("queueBuffer: slot index %d out of range [0, %d)",
570 slot, maxBufferCount);
572 } else if (mSlots[slot].mBufferState != BufferSlot::DEQUEUED) {
573 BQ_LOGE("queueBuffer: slot %d is not owned by the producer "
574 "(state = %d)", slot, mSlots[slot].mBufferState);
576 } else if (!mSlots[slot].mRequestBufferCalled) {
577 BQ_LOGE("queueBuffer: slot %d was queued without requesting "
578 "a buffer", slot);
582 BQ_LOGV("queueBuffer: slot=%d/%" PRIu64 " time=%" PRIu64
584 slot, mCore->mFrameCounter + 1, timestamp,
588 const sp<GraphicBuffer>& graphicBuffer(mSlots[slot].mGraphicBuffer);
594 "buffer in slot %d", slot);
598 mSlots[slot].mFence = fence;
599 mSlots[slot].mBufferState = BufferSlot::QUEUED;
601 mSlots[slot].mFrameNumber = mCore->mFrameCounter;
603 item.mAcquireCalled = mSlots[slot].mAcquireCalled;
604 item.mGraphicBuffer = mSlots[slot].mGraphicBuffer;
613 item.mSlot = slot;
668 // the slot number, since the consumer shouldn't need it
693 void BufferQueueProducer::cancelBuffer(int slot, const sp<Fence>& fence) {
695 BQ_LOGV("cancelBuffer: slot %d", slot);
703 if (slot < 0 || slot >= BufferQueueDefs::NUM_BUFFER_SLOTS) {
704 BQ_LOGE("cancelBuffer: slot index %d out of range [0, %d)",
705 slot, BufferQueueDefs::NUM_BUFFER_SLOTS);
707 } else if (mSlots[slot].mBufferState != BufferSlot::DEQUEUED) {
708 BQ_LOGE("cancelBuffer: slot %d is not owned by the producer "
709 "(state = %d)", slot, mSlots[slot].mBufferState);
716 mSlots[slot].mBufferState = BufferSlot::FREE;
717 mSlots[slot].mFrameNumber = 0;
718 mSlots[slot].mFence = fence;
921 for (int slot = 0; slot < BufferQueueDefs::NUM_BUFFER_SLOTS; ++slot) {
922 if (mSlots[slot].mGraphicBuffer != NULL) {
925 if (mSlots[slot].mBufferState != BufferSlot::FREE) {
926 BQ_LOGE("allocateBuffers: slot %d without buffer is not FREE",
927 slot);
931 freeSlots.push_back(slot);
985 int slot = freeSlots[i];
986 if (mSlots[slot].mBufferState != BufferSlot::FREE) {
987 // A consumer allocated the FREE slot with attachBuffer. Discard the buffer we
989 BQ_LOGV("allocateBuffers: slot %d was acquired while allocating. "
990 "Dropping allocated buffer.", slot);
993 mCore->freeBufferLocked(slot); // Clean up the slot first
994 mSlots[slot].mGraphicBuffer = buffers[i];
995 mSlots[slot].mFrameNumber = 0;
996 mSlots[slot].mFence = Fence::NO_FENCE;
997 BQ_LOGV("allocateBuffers: allocated a new buffer in slot %d", slot);