diff options
author | Mark Salyzyn <salyzyn@google.com> | 2014-11-19 08:38:54 -0800 |
---|---|---|
committer | Mark Salyzyn <salyzyn@google.com> | 2014-11-19 09:16:50 -0800 |
commit | 492a2506b49ab9dfd574ab354ef6edcfd7ba6a68 (patch) | |
tree | 9a50c70d2d989d863b449414c0123409f5641ccc /libcamera2 | |
parent | d1fb36a4395f15f2be77f0af3844169c7a95ebb5 (diff) | |
download | exynos5-492a2506b49ab9dfd574ab354ef6edcfd7ba6a68.tar.gz |
manta: libcamera2: drain requests on empty request queue
Bug: 18118823
Bug: 17771002
Bug: 17660746
Bug: 13921808
Bug: 13358648
Bug: 13299991
Change-Id: Ib81b7d8b76470eebcd434a20b46d6235f5381f8b
Diffstat (limited to 'libcamera2')
-rw-r--r-- | libcamera2/ExynosCameraHWInterface2.cpp | 21 | ||||
-rw-r--r-- | libcamera2/ExynosCameraHWInterface2.h | 2 |
2 files changed, 16 insertions, 7 deletions
diff --git a/libcamera2/ExynosCameraHWInterface2.cpp b/libcamera2/ExynosCameraHWInterface2.cpp index 8fce907..cab01b4 100644 --- a/libcamera2/ExynosCameraHWInterface2.cpp +++ b/libcamera2/ExynosCameraHWInterface2.cpp @@ -615,10 +615,15 @@ void RequestManager::ApplyDynamicMetadata(struct camera2_shot_ext *shot_ext) ALOGV("DEBUG(%s): frameCnt(%d)", __FUNCTION__, shot_ext->shot.ctl.request.frameCount); for (i = 0 ; i < NUM_MAX_REQUEST_MGR_ENTRY ; i++) { - if((entries[i].internal_shot.shot.ctl.request.frameCount == shot_ext->shot.ctl.request.frameCount) - && (entries[i].status == CAPTURED)){ - entries[i].status = METADONE; - break; + if (entries[i].internal_shot.shot.ctl.request.frameCount + == shot_ext->shot.ctl.request.frameCount) { + if (entries[i].status == CAPTURED) { + entries[i].status = METADONE; + break; + } + if (entries[i].status == METADONE) { + return; + } } } @@ -861,9 +866,10 @@ camera2_shot_ext * RequestManager::GetInternalShotExt(int index) return ¤tEntry->internal_shot; } -int RequestManager::FindFrameCnt(struct camera2_shot_ext * shot_ext) +int RequestManager::FindFrameCnt(struct camera2_shot_ext * shot_ext, bool drain) { Mutex::Autolock lock(m_requestMutex); + Mutex::Autolock lock2(m_numOfEntriesLock); int i; if (m_numOfEntries == 0) { @@ -879,6 +885,9 @@ int RequestManager::FindFrameCnt(struct camera2_shot_ext * shot_ext) entries[i].status = CAPTURED; return entries[i].internal_shot.shot.ctl.request.frameCount; } + if (drain && (entries[i].status >= CAPTURED)) { + return entries[i].internal_shot.shot.ctl.request.frameCount; + } CAM_LOGE("ERR(%s): frameCount(%d), index(%d), status(%d)", __FUNCTION__, shot_ext->shot.ctl.request.frameCount, i, entries[i].status); } @@ -3154,7 +3163,7 @@ void ExynosCameraHWInterface2::m_sensorThreadFunc(SignalDrivenThread * self) matchedFrameCnt = m_ctlInfo.flash.m_flashFrameCount; ALOGV("Skip frame, request is fixed at %d", matchedFrameCnt); } else { - matchedFrameCnt = m_requestManager->FindFrameCnt(shot_ext); + matchedFrameCnt = m_requestManager->FindFrameCnt(shot_ext, m_isRequestQueueNull); } if (matchedFrameCnt == -1 && m_vdisBubbleCnt > 0) { diff --git a/libcamera2/ExynosCameraHWInterface2.h b/libcamera2/ExynosCameraHWInterface2.h index a8e3348..927eace 100644 --- a/libcamera2/ExynosCameraHWInterface2.h +++ b/libcamera2/ExynosCameraHWInterface2.h @@ -283,7 +283,7 @@ public: uint8_t GetOutputStream(int index); camera2_shot_ext * GetInternalShotExtByFrameCnt(int frameCnt); camera2_shot_ext * GetInternalShotExt(int index); - int FindFrameCnt(struct camera2_shot_ext * shot_ext); + int FindFrameCnt(struct camera2_shot_ext * shot_ext, bool drain); bool IsVdisEnable(void); int FindEntryIndexByFrameCnt(int frameCnt); void Dump(void); |