Loading services/camera/libcameraservice/device3/StatusTracker.cpp +11 −0 Original line number Original line Diff line number Diff line Loading @@ -172,6 +172,7 @@ bool StatusTracker::threadLoop() { } } } } bool waitForIdleFence = false; // After new pending states appear, or timeout, check if we're idle. Even // After new pending states appear, or timeout, check if we're idle. Even // with timeout, need to check to account for fences that may still be // with timeout, need to check to account for fences that may still be // clearing out // clearing out Loading @@ -196,6 +197,7 @@ bool StatusTracker::threadLoop() { ssize_t idx = mStates.indexOfKey(newState.id); ssize_t idx = mStates.indexOfKey(newState.id); // Ignore notices for unknown components // Ignore notices for unknown components if (idx >= 0) { if (idx >= 0) { bool validFence = newState.fence != Fence::NO_FENCE; // Update single component state // Update single component state mStates.replaceValueAt(idx, newState.state); mStates.replaceValueAt(idx, newState.state); mIdleFence = Fence::merge(String8("idleFence"), mIdleFence = Fence::merge(String8("idleFence"), Loading @@ -204,6 +206,8 @@ bool StatusTracker::threadLoop() { ComponentState newState = getDeviceStateLocked(); ComponentState newState = getDeviceStateLocked(); if (newState != prevState) { if (newState != prevState) { mStateTransitions.add(newState); mStateTransitions.add(newState); } else if (validFence && !waitForIdleFence) { waitForIdleFence = true; } } prevState = newState; prevState = newState; } } Loading @@ -227,6 +231,13 @@ bool StatusTracker::threadLoop() { } } mStateTransitions.clear(); mStateTransitions.clear(); if (waitForIdleFence) { auto ret = mIdleFence->wait(kWaitDuration); if (ret == NO_ERROR) { mComponentsChanged = true; } } return true; return true; } } Loading Loading
services/camera/libcameraservice/device3/StatusTracker.cpp +11 −0 Original line number Original line Diff line number Diff line Loading @@ -172,6 +172,7 @@ bool StatusTracker::threadLoop() { } } } } bool waitForIdleFence = false; // After new pending states appear, or timeout, check if we're idle. Even // After new pending states appear, or timeout, check if we're idle. Even // with timeout, need to check to account for fences that may still be // with timeout, need to check to account for fences that may still be // clearing out // clearing out Loading @@ -196,6 +197,7 @@ bool StatusTracker::threadLoop() { ssize_t idx = mStates.indexOfKey(newState.id); ssize_t idx = mStates.indexOfKey(newState.id); // Ignore notices for unknown components // Ignore notices for unknown components if (idx >= 0) { if (idx >= 0) { bool validFence = newState.fence != Fence::NO_FENCE; // Update single component state // Update single component state mStates.replaceValueAt(idx, newState.state); mStates.replaceValueAt(idx, newState.state); mIdleFence = Fence::merge(String8("idleFence"), mIdleFence = Fence::merge(String8("idleFence"), Loading @@ -204,6 +206,8 @@ bool StatusTracker::threadLoop() { ComponentState newState = getDeviceStateLocked(); ComponentState newState = getDeviceStateLocked(); if (newState != prevState) { if (newState != prevState) { mStateTransitions.add(newState); mStateTransitions.add(newState); } else if (validFence && !waitForIdleFence) { waitForIdleFence = true; } } prevState = newState; prevState = newState; } } Loading @@ -227,6 +231,13 @@ bool StatusTracker::threadLoop() { } } mStateTransitions.clear(); mStateTransitions.clear(); if (waitForIdleFence) { auto ret = mIdleFence->wait(kWaitDuration); if (ret == NO_ERROR) { mComponentsChanged = true; } } return true; return true; } } Loading