Lines Matching refs:index
106 int QCamera3Memory::cacheOpsInternal(uint32_t index, unsigned int cmd, void *vaddr) in cacheOpsInternal() argument
115 if (MM_CAMERA_MAX_NUM_FRAMES <= index) { in cacheOpsInternal()
117 index, MM_CAMERA_MAX_NUM_FRAMES); in cacheOpsInternal()
121 if (0 == mMemInfo[index].handle) { in cacheOpsInternal()
122 LOGE("Buffer at %d not registered", index); in cacheOpsInternal()
129 cache_inv_data.fd = mMemInfo[index].fd; in cacheOpsInternal()
130 cache_inv_data.handle = mMemInfo[index].handle; in cacheOpsInternal()
131 cache_inv_data.length = (unsigned int)mMemInfo[index].size; in cacheOpsInternal()
156 int QCamera3Memory::getFd(uint32_t index) in getFd() argument
160 if (MM_CAMERA_MAX_NUM_FRAMES <= index) { in getFd()
164 if (0 == mMemInfo[index].handle) { in getFd()
168 return mMemInfo[index].fd; in getFd()
181 ssize_t QCamera3Memory::getSize(uint32_t index) in getSize() argument
185 if (MM_CAMERA_MAX_NUM_FRAMES <= index) { in getSize()
189 if (0 == mMemInfo[index].handle) { in getSize()
193 return (ssize_t)mMemInfo[index].size; in getSize()
228 mm_camera_buf_def_t &bufDef, uint32_t index, bool virtualAddr) in getBufDef() argument
237 bufDef.fd = mMemInfo[index].fd; in getBufDef()
238 bufDef.frame_len = mMemInfo[index].size; in getBufDef()
240 bufDef.buffer = virtualAddr ? getPtrLocked(index) : nullptr; in getBufDef()
242 bufDef.buf_idx = (uint8_t)index; in getBufDef()
246 bufDef.planes_buf.planes[0].m.userptr = (long unsigned int)mMemInfo[index].fd; in getBufDef()
394 void *QCamera3HeapMemory::getPtrLocked(uint32_t index) in getPtrLocked() argument
396 if (index >= mBufferCount) { in getPtrLocked()
400 return mPtr[index]; in getPtrLocked()
419 int32_t QCamera3HeapMemory::markFrameNumber(uint32_t index, uint32_t frameNumber) in markFrameNumber() argument
423 if (index >= mBufferCount) { in markFrameNumber()
425 index, mBufferCount); in markFrameNumber()
429 if (0 == mMemInfo[index].handle) { in markFrameNumber()
430 LOGE("Buffer at %d not allocated", index); in markFrameNumber()
434 mCurrentFrameNumbers[index] = (int32_t)frameNumber; in markFrameNumber()
454 int32_t QCamera3HeapMemory::getFrameNumber(uint32_t index) in getFrameNumber() argument
458 if (index >= mBufferCount) { in getFrameNumber()
460 index, mBufferCount); in getFrameNumber()
464 if (0 == mMemInfo[index].handle) { in getFrameNumber()
465 LOGE("Buffer at %d not registered", index); in getFrameNumber()
469 return mCurrentFrameNumbers[index]; in getFrameNumber()
492 for (uint32_t index = 0; in getOldestFrameNumber() local
493 index < mBufferCount; index++) { in getOldestFrameNumber()
494 if (mMemInfo[index].handle) { in getOldestFrameNumber()
495 if ((empty) || (!empty && oldest > mCurrentFrameNumbers[index] in getOldestFrameNumber()
496 && mCurrentFrameNumbers[index] != -1)) { in getOldestFrameNumber()
497 oldest = mCurrentFrameNumbers[index]; in getOldestFrameNumber()
498 bufIndex = index; in getOldestFrameNumber()
527 for (uint32_t index = 0; in getBufferIndex() local
528 index < mBufferCount; index++) { in getBufferIndex()
529 if (mMemInfo[index].handle && in getBufferIndex()
530 mCurrentFrameNumbers[index] == (int32_t)frameNumber) in getBufferIndex()
531 return (int32_t)index; in getBufferIndex()
546 void *QCamera3HeapMemory::getPtr(uint32_t index) in getPtr() argument
548 return getPtrLocked(index); in getPtr()
693 int QCamera3HeapMemory::cacheOps(uint32_t index, unsigned int cmd) in cacheOps() argument
695 if (index >= mBufferCount) in cacheOps()
697 return cacheOpsInternal(index, cmd, mPtr[index]); in cacheOps()
969 int32_t QCamera3GrallocMemory::markFrameNumber(uint32_t index, uint32_t frameNumber) in markFrameNumber() argument
973 if (index >= MM_CAMERA_MAX_NUM_FRAMES) { in markFrameNumber()
977 if (index < mStartIdx) { in markFrameNumber()
979 index, mStartIdx); in markFrameNumber()
983 if (0 == mMemInfo[index].handle) { in markFrameNumber()
984 LOGE("Buffer at %d not registered", index); in markFrameNumber()
988 mCurrentFrameNumbers[index] = (int32_t)frameNumber; in markFrameNumber()
1007 int32_t QCamera3GrallocMemory::getFrameNumber(uint32_t index) in getFrameNumber() argument
1011 if (index >= MM_CAMERA_MAX_NUM_FRAMES) { in getFrameNumber()
1015 if (index < mStartIdx) { in getFrameNumber()
1017 index, mStartIdx); in getFrameNumber()
1021 if (0 == mMemInfo[index].handle) { in getFrameNumber()
1022 LOGE("Buffer at %d not registered", index); in getFrameNumber()
1026 return mCurrentFrameNumbers[index]; in getFrameNumber()
1045 for (uint32_t index = mStartIdx; in getOldestFrameNumber() local
1046 index < MM_CAMERA_MAX_NUM_FRAMES; index++) { in getOldestFrameNumber()
1047 if (mMemInfo[index].handle) { in getOldestFrameNumber()
1049 (!empty && oldest > mCurrentFrameNumbers[index] in getOldestFrameNumber()
1050 && mCurrentFrameNumbers[index] != -1)) { in getOldestFrameNumber()
1051 oldest = mCurrentFrameNumbers[index]; in getOldestFrameNumber()
1052 bufIndex = index; in getOldestFrameNumber()
1079 for (uint32_t index = mStartIdx; in getBufferIndex() local
1080 index < MM_CAMERA_MAX_NUM_FRAMES; index++) { in getBufferIndex()
1081 if (mMemInfo[index].handle && in getBufferIndex()
1082 mCurrentFrameNumbers[index] == (int32_t)frameNumber) in getBufferIndex()
1083 return (int32_t)index; in getBufferIndex()
1101 int QCamera3GrallocMemory::cacheOps(uint32_t index, unsigned int cmd) in cacheOps() argument
1106 privateHandle = mPrivateHandle[index]; in cacheOps()
1115 if (index >= MM_CAMERA_MAX_NUM_FRAMES) { in cacheOps()
1119 if (index < mStartIdx) { in cacheOps()
1121 index, mStartIdx); in cacheOps()
1125 LOGD("needToInvalidate %d buf idx %d", needToInvalidate, index); in cacheOps()
1128 rc = cacheOpsInternal(index, cmd, mPtr[index]); in cacheOps()
1131 rc = cacheOpsInternal(index, cmd, mPtr[index]); in cacheOps()
1151 int index = -1; in getMatchBufIndex() local
1158 index = (int)i; in getMatchBufIndex()
1163 return index; in getMatchBufIndex()
1179 int index = -1; in getFreeIndexLocked() local
1184 return index; in getFreeIndexLocked()
1189 index = i; in getFreeIndexLocked()
1194 return index; in getFreeIndexLocked()
1208 void *QCamera3GrallocMemory::getPtrLocked(uint32_t index) in getPtrLocked() argument
1210 if (MM_CAMERA_MAX_NUM_FRAMES <= index) { in getPtrLocked()
1212 index, MM_CAMERA_MAX_NUM_FRAMES); in getPtrLocked()
1215 if (index < mStartIdx) { in getPtrLocked()
1217 index, mStartIdx); in getPtrLocked()
1222 if (0 == mMemInfo[index].handle) { in getPtrLocked()
1223 LOGE("Buffer at %d not registered", index); in getPtrLocked()
1227 if (mPtr[index] == nullptr) { in getPtrLocked()
1230 mMemInfo[index].size, in getPtrLocked()
1233 mMemInfo[index].fd, 0); in getPtrLocked()
1237 index, mMemInfo[index].size, strerror(errno), errno); in getPtrLocked()
1240 mPtr[index] = vaddr; in getPtrLocked()
1244 return mPtr[index]; in getPtrLocked()
1257 void *QCamera3GrallocMemory::getPtr(uint32_t index) in getPtr() argument
1260 return getPtrLocked(index); in getPtr()
1274 void *QCamera3GrallocMemory::getBufferHandle(uint32_t index) in getBufferHandle() argument
1278 if (MM_CAMERA_MAX_NUM_FRAMES <= index) { in getBufferHandle()
1280 index, MM_CAMERA_MAX_NUM_FRAMES); in getBufferHandle()
1283 if (index < mStartIdx) { in getBufferHandle()
1285 index, mStartIdx); in getBufferHandle()
1289 if (0 == mMemInfo[index].handle) { in getBufferHandle()
1290 LOGE("Buffer at %d not registered", index); in getBufferHandle()
1294 return mBufferHandle[index]; in getBufferHandle()