Loading services/surfaceflinger/SurfaceFlinger.cpp +7 −9 Original line number Diff line number Diff line Loading @@ -1123,7 +1123,7 @@ void SurfaceFlinger::setDesiredActiveMode(const ActiveModeInfo& info) { } } status_t SurfaceFlinger::setActiveMode(const sp<IBinder>& displayToken, int modeId) { status_t SurfaceFlinger::setActiveModeFromBackdoor(const sp<IBinder>& displayToken, int modeId) { ATRACE_CALL(); if (!displayToken) { Loading Loading @@ -1164,7 +1164,7 @@ status_t SurfaceFlinger::setActiveMode(const sp<IBinder>& displayToken, int mode return future.get(); } void SurfaceFlinger::setActiveModeInternal() { void SurfaceFlinger::updateInternalStateWithChangedMode() { ATRACE_CALL(); const auto display = getDefaultDisplayDeviceLocked(); Loading Loading @@ -1219,9 +1219,8 @@ void SurfaceFlinger::desiredActiveModeChangeDone(const sp<DisplayDevice>& displa updatePhaseConfiguration(refreshRate); } void SurfaceFlinger::performSetActiveMode() { void SurfaceFlinger::setActiveModeInHwcIfNeeded() { ATRACE_CALL(); ALOGV("%s", __FUNCTION__); for (const auto& iter : mDisplays) { const auto& display = iter.second; Loading Loading @@ -1256,8 +1255,7 @@ void SurfaceFlinger::performSetActiveMode() { to_string(display->getId()).c_str()); if (display->getActiveMode()->getId() == desiredActiveMode->mode->getId()) { // display is not valid or we are already in the requested mode // on both cases there is nothing left to do // we are already in the requested mode, there is nothing left to do desiredActiveModeChangeDone(display); continue; } Loading Loading @@ -1956,7 +1954,7 @@ bool SurfaceFlinger::commit(nsecs_t frameTime, int64_t vsyncId, nsecs_t expected // We received the present fence from the HWC, so we assume it successfully updated // the mode, hence we update SF. mSetActiveModePending = false; ON_MAIN_THREAD(setActiveModeInternal()); ON_MAIN_THREAD(updateInternalStateWithChangedMode()); } if (framePending) { Loading Loading @@ -2023,7 +2021,7 @@ bool SurfaceFlinger::commit(nsecs_t frameTime, int64_t vsyncId, nsecs_t expected mScheduler->chooseRefreshRateForContent(); } ON_MAIN_THREAD(performSetActiveMode()); ON_MAIN_THREAD(setActiveModeInHwcIfNeeded()); updateCursorAsync(); updateInputFlinger(); Loading Loading @@ -5632,7 +5630,7 @@ status_t SurfaceFlinger::onTransact(uint32_t code, const Parcel& data, Parcel* r }(); mDebugDisplayModeSetByBackdoor = false; const status_t result = setActiveMode(display, modeId); const status_t result = setActiveModeFromBackdoor(display, modeId); mDebugDisplayModeSetByBackdoor = result == NO_ERROR; return result; } Loading services/surfaceflinger/SurfaceFlinger.h +3 −3 Original line number Diff line number Diff line Loading @@ -659,13 +659,13 @@ private: void onInitializeDisplays() REQUIRES(mStateLock); // Sets the desired active mode bit. It obtains the lock, and sets mDesiredActiveMode. void setDesiredActiveMode(const ActiveModeInfo& info) REQUIRES(mStateLock); status_t setActiveMode(const sp<IBinder>& displayToken, int id); status_t setActiveModeFromBackdoor(const sp<IBinder>& displayToken, int id); // Once HWC has returned the present fence, this sets the active mode and a new refresh // rate in SF. void setActiveModeInternal() REQUIRES(mStateLock); void updateInternalStateWithChangedMode() REQUIRES(mStateLock); // Calls to setActiveMode on the main thread if there is a pending mode change // that needs to be applied. void performSetActiveMode() REQUIRES(mStateLock); void setActiveModeInHwcIfNeeded() REQUIRES(mStateLock); void clearDesiredActiveModeState(const sp<DisplayDevice>&) REQUIRES(mStateLock); // Called when active mode is no longer is progress void desiredActiveModeChangeDone(const sp<DisplayDevice>&) REQUIRES(mStateLock); Loading Loading
services/surfaceflinger/SurfaceFlinger.cpp +7 −9 Original line number Diff line number Diff line Loading @@ -1123,7 +1123,7 @@ void SurfaceFlinger::setDesiredActiveMode(const ActiveModeInfo& info) { } } status_t SurfaceFlinger::setActiveMode(const sp<IBinder>& displayToken, int modeId) { status_t SurfaceFlinger::setActiveModeFromBackdoor(const sp<IBinder>& displayToken, int modeId) { ATRACE_CALL(); if (!displayToken) { Loading Loading @@ -1164,7 +1164,7 @@ status_t SurfaceFlinger::setActiveMode(const sp<IBinder>& displayToken, int mode return future.get(); } void SurfaceFlinger::setActiveModeInternal() { void SurfaceFlinger::updateInternalStateWithChangedMode() { ATRACE_CALL(); const auto display = getDefaultDisplayDeviceLocked(); Loading Loading @@ -1219,9 +1219,8 @@ void SurfaceFlinger::desiredActiveModeChangeDone(const sp<DisplayDevice>& displa updatePhaseConfiguration(refreshRate); } void SurfaceFlinger::performSetActiveMode() { void SurfaceFlinger::setActiveModeInHwcIfNeeded() { ATRACE_CALL(); ALOGV("%s", __FUNCTION__); for (const auto& iter : mDisplays) { const auto& display = iter.second; Loading Loading @@ -1256,8 +1255,7 @@ void SurfaceFlinger::performSetActiveMode() { to_string(display->getId()).c_str()); if (display->getActiveMode()->getId() == desiredActiveMode->mode->getId()) { // display is not valid or we are already in the requested mode // on both cases there is nothing left to do // we are already in the requested mode, there is nothing left to do desiredActiveModeChangeDone(display); continue; } Loading Loading @@ -1956,7 +1954,7 @@ bool SurfaceFlinger::commit(nsecs_t frameTime, int64_t vsyncId, nsecs_t expected // We received the present fence from the HWC, so we assume it successfully updated // the mode, hence we update SF. mSetActiveModePending = false; ON_MAIN_THREAD(setActiveModeInternal()); ON_MAIN_THREAD(updateInternalStateWithChangedMode()); } if (framePending) { Loading Loading @@ -2023,7 +2021,7 @@ bool SurfaceFlinger::commit(nsecs_t frameTime, int64_t vsyncId, nsecs_t expected mScheduler->chooseRefreshRateForContent(); } ON_MAIN_THREAD(performSetActiveMode()); ON_MAIN_THREAD(setActiveModeInHwcIfNeeded()); updateCursorAsync(); updateInputFlinger(); Loading Loading @@ -5632,7 +5630,7 @@ status_t SurfaceFlinger::onTransact(uint32_t code, const Parcel& data, Parcel* r }(); mDebugDisplayModeSetByBackdoor = false; const status_t result = setActiveMode(display, modeId); const status_t result = setActiveModeFromBackdoor(display, modeId); mDebugDisplayModeSetByBackdoor = result == NO_ERROR; return result; } Loading
services/surfaceflinger/SurfaceFlinger.h +3 −3 Original line number Diff line number Diff line Loading @@ -659,13 +659,13 @@ private: void onInitializeDisplays() REQUIRES(mStateLock); // Sets the desired active mode bit. It obtains the lock, and sets mDesiredActiveMode. void setDesiredActiveMode(const ActiveModeInfo& info) REQUIRES(mStateLock); status_t setActiveMode(const sp<IBinder>& displayToken, int id); status_t setActiveModeFromBackdoor(const sp<IBinder>& displayToken, int id); // Once HWC has returned the present fence, this sets the active mode and a new refresh // rate in SF. void setActiveModeInternal() REQUIRES(mStateLock); void updateInternalStateWithChangedMode() REQUIRES(mStateLock); // Calls to setActiveMode on the main thread if there is a pending mode change // that needs to be applied. void performSetActiveMode() REQUIRES(mStateLock); void setActiveModeInHwcIfNeeded() REQUIRES(mStateLock); void clearDesiredActiveModeState(const sp<DisplayDevice>&) REQUIRES(mStateLock); // Called when active mode is no longer is progress void desiredActiveModeChangeDone(const sp<DisplayDevice>&) REQUIRES(mStateLock); Loading