Loading services/surfaceflinger/SurfaceFlinger.cpp +8 −9 Original line number Diff line number Diff line Loading @@ -1567,7 +1567,7 @@ void SurfaceFlinger::signalRefresh() { mEventQueue->refresh(); } nsecs_t SurfaceFlinger::getVsyncPeriod() const { nsecs_t SurfaceFlinger::getVsyncPeriodFromHWC() const { const auto displayId = getInternalDisplayIdLocked(); if (!displayId || !getHwComposer().isConnected(*displayId)) { return 0; Loading Loading @@ -1774,7 +1774,7 @@ void SurfaceFlinger::updateVrFlinger() { setPowerModeInternal(display, currentDisplayPowerMode); // Reset the timing values to account for the period of the swapped in HWC const nsecs_t vsyncPeriod = getVsyncPeriod(); const nsecs_t vsyncPeriod = mRefreshRateConfigs->getCurrentRefreshRate().getVsyncPeriod(); mAnimFrameTracker.setDisplayRefreshPeriod(vsyncPeriod); // The present fences returned from vr_hwc are not an accurate Loading Loading @@ -4208,8 +4208,7 @@ void SurfaceFlinger::onInitializeDisplays() { {}); setPowerModeInternal(display, hal::PowerMode::ON); const nsecs_t vsyncPeriod = getVsyncPeriod(); const nsecs_t vsyncPeriod = mRefreshRateConfigs->getCurrentRefreshRate().getVsyncPeriod(); mAnimFrameTracker.setDisplayRefreshPeriod(vsyncPeriod); // Use phase of 0 since phase is not known. Loading Loading @@ -4244,7 +4243,7 @@ void SurfaceFlinger::setPowerModeInternal(const sp<DisplayDevice>& display, hal: if (mInterceptor->isEnabled()) { mInterceptor->savePowerModeUpdate(display->getSequenceId(), static_cast<int32_t>(mode)); } const auto vsyncPeriod = mRefreshRateConfigs->getCurrentRefreshRate().getVsyncPeriod(); if (currentMode == hal::PowerMode::OFF) { if (SurfaceFlinger::setSchedFifo(true) != NO_ERROR) { ALOGW("Couldn't set SCHED_FIFO on display on: %s\n", strerror(errno)); Loading @@ -4253,7 +4252,7 @@ void SurfaceFlinger::setPowerModeInternal(const sp<DisplayDevice>& display, hal: if (display->isPrimary() && mode != hal::PowerMode::DOZE_SUSPEND) { getHwComposer().setVsyncEnabled(*displayId, mHWCVsyncPendingState); mScheduler->onScreenAcquired(mAppConnectionHandle); mScheduler->resyncToHardwareVsync(true, getVsyncPeriod()); mScheduler->resyncToHardwareVsync(true, vsyncPeriod); } mVisibleRegionsDirty = true; Loading @@ -4280,7 +4279,7 @@ void SurfaceFlinger::setPowerModeInternal(const sp<DisplayDevice>& display, hal: getHwComposer().setPowerMode(*displayId, mode); if (display->isPrimary() && currentMode == hal::PowerMode::DOZE_SUSPEND) { mScheduler->onScreenAcquired(mAppConnectionHandle); mScheduler->resyncToHardwareVsync(true, getVsyncPeriod()); mScheduler->resyncToHardwareVsync(true, vsyncPeriod); } } else if (mode == hal::PowerMode::DOZE_SUSPEND) { // Leave display going to doze Loading Loading @@ -4393,7 +4392,7 @@ void SurfaceFlinger::listLayersLocked(std::string& result) const { } void SurfaceFlinger::dumpStatsLocked(const DumpArgs& args, std::string& result) const { StringAppendF(&result, "%" PRId64 "\n", getVsyncPeriod()); StringAppendF(&result, "%" PRId64 "\n", getVsyncPeriodFromHWC()); if (args.size() > 1) { const auto name = String8(args[1]); Loading Loading @@ -4458,7 +4457,7 @@ void SurfaceFlinger::dumpVSync(std::string& result) const { mPhaseConfiguration->dump(result); StringAppendF(&result, " present offset: %9" PRId64 " ns\t VSYNC period: %9" PRId64 " ns\n\n", dispSyncPresentTimeOffset, getVsyncPeriod()); dispSyncPresentTimeOffset, getVsyncPeriodFromHWC()); scheduler::RefreshRateConfigs::Policy policy = mRefreshRateConfigs->getDisplayManagerPolicy(); StringAppendF(&result, Loading services/surfaceflinger/SurfaceFlinger.h +1 −1 Original line number Diff line number Diff line Loading @@ -856,7 +856,7 @@ private: /* ------------------------------------------------------------------------ * VSync */ nsecs_t getVsyncPeriod() const REQUIRES(mStateLock); nsecs_t getVsyncPeriodFromHWC() const REQUIRES(mStateLock); // Sets the refresh rate by switching active configs, if they are available for // the desired refresh rate. Loading services/surfaceflinger/tests/unittests/DisplayTransactionTest.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -88,7 +88,7 @@ using FakeHwcDisplayInjector = TestableSurfaceFlinger::FakeHwcDisplayInjector; using HotplugEvent = TestableSurfaceFlinger::HotplugEvent; using HWC2Display = TestableSurfaceFlinger::HWC2Display; constexpr int32_t DEFAULT_REFRESH_RATE = 16'666'666; constexpr int32_t DEFAULT_REFRESH_RATE = 16'666'667; constexpr int32_t DEFAULT_DPI = 320; constexpr int DEFAULT_VIRTUAL_DISPLAY_SURFACE_FORMAT = HAL_PIXEL_FORMAT_RGB_565; Loading Loading
services/surfaceflinger/SurfaceFlinger.cpp +8 −9 Original line number Diff line number Diff line Loading @@ -1567,7 +1567,7 @@ void SurfaceFlinger::signalRefresh() { mEventQueue->refresh(); } nsecs_t SurfaceFlinger::getVsyncPeriod() const { nsecs_t SurfaceFlinger::getVsyncPeriodFromHWC() const { const auto displayId = getInternalDisplayIdLocked(); if (!displayId || !getHwComposer().isConnected(*displayId)) { return 0; Loading Loading @@ -1774,7 +1774,7 @@ void SurfaceFlinger::updateVrFlinger() { setPowerModeInternal(display, currentDisplayPowerMode); // Reset the timing values to account for the period of the swapped in HWC const nsecs_t vsyncPeriod = getVsyncPeriod(); const nsecs_t vsyncPeriod = mRefreshRateConfigs->getCurrentRefreshRate().getVsyncPeriod(); mAnimFrameTracker.setDisplayRefreshPeriod(vsyncPeriod); // The present fences returned from vr_hwc are not an accurate Loading Loading @@ -4208,8 +4208,7 @@ void SurfaceFlinger::onInitializeDisplays() { {}); setPowerModeInternal(display, hal::PowerMode::ON); const nsecs_t vsyncPeriod = getVsyncPeriod(); const nsecs_t vsyncPeriod = mRefreshRateConfigs->getCurrentRefreshRate().getVsyncPeriod(); mAnimFrameTracker.setDisplayRefreshPeriod(vsyncPeriod); // Use phase of 0 since phase is not known. Loading Loading @@ -4244,7 +4243,7 @@ void SurfaceFlinger::setPowerModeInternal(const sp<DisplayDevice>& display, hal: if (mInterceptor->isEnabled()) { mInterceptor->savePowerModeUpdate(display->getSequenceId(), static_cast<int32_t>(mode)); } const auto vsyncPeriod = mRefreshRateConfigs->getCurrentRefreshRate().getVsyncPeriod(); if (currentMode == hal::PowerMode::OFF) { if (SurfaceFlinger::setSchedFifo(true) != NO_ERROR) { ALOGW("Couldn't set SCHED_FIFO on display on: %s\n", strerror(errno)); Loading @@ -4253,7 +4252,7 @@ void SurfaceFlinger::setPowerModeInternal(const sp<DisplayDevice>& display, hal: if (display->isPrimary() && mode != hal::PowerMode::DOZE_SUSPEND) { getHwComposer().setVsyncEnabled(*displayId, mHWCVsyncPendingState); mScheduler->onScreenAcquired(mAppConnectionHandle); mScheduler->resyncToHardwareVsync(true, getVsyncPeriod()); mScheduler->resyncToHardwareVsync(true, vsyncPeriod); } mVisibleRegionsDirty = true; Loading @@ -4280,7 +4279,7 @@ void SurfaceFlinger::setPowerModeInternal(const sp<DisplayDevice>& display, hal: getHwComposer().setPowerMode(*displayId, mode); if (display->isPrimary() && currentMode == hal::PowerMode::DOZE_SUSPEND) { mScheduler->onScreenAcquired(mAppConnectionHandle); mScheduler->resyncToHardwareVsync(true, getVsyncPeriod()); mScheduler->resyncToHardwareVsync(true, vsyncPeriod); } } else if (mode == hal::PowerMode::DOZE_SUSPEND) { // Leave display going to doze Loading Loading @@ -4393,7 +4392,7 @@ void SurfaceFlinger::listLayersLocked(std::string& result) const { } void SurfaceFlinger::dumpStatsLocked(const DumpArgs& args, std::string& result) const { StringAppendF(&result, "%" PRId64 "\n", getVsyncPeriod()); StringAppendF(&result, "%" PRId64 "\n", getVsyncPeriodFromHWC()); if (args.size() > 1) { const auto name = String8(args[1]); Loading Loading @@ -4458,7 +4457,7 @@ void SurfaceFlinger::dumpVSync(std::string& result) const { mPhaseConfiguration->dump(result); StringAppendF(&result, " present offset: %9" PRId64 " ns\t VSYNC period: %9" PRId64 " ns\n\n", dispSyncPresentTimeOffset, getVsyncPeriod()); dispSyncPresentTimeOffset, getVsyncPeriodFromHWC()); scheduler::RefreshRateConfigs::Policy policy = mRefreshRateConfigs->getDisplayManagerPolicy(); StringAppendF(&result, Loading
services/surfaceflinger/SurfaceFlinger.h +1 −1 Original line number Diff line number Diff line Loading @@ -856,7 +856,7 @@ private: /* ------------------------------------------------------------------------ * VSync */ nsecs_t getVsyncPeriod() const REQUIRES(mStateLock); nsecs_t getVsyncPeriodFromHWC() const REQUIRES(mStateLock); // Sets the refresh rate by switching active configs, if they are available for // the desired refresh rate. Loading
services/surfaceflinger/tests/unittests/DisplayTransactionTest.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -88,7 +88,7 @@ using FakeHwcDisplayInjector = TestableSurfaceFlinger::FakeHwcDisplayInjector; using HotplugEvent = TestableSurfaceFlinger::HotplugEvent; using HWC2Display = TestableSurfaceFlinger::HWC2Display; constexpr int32_t DEFAULT_REFRESH_RATE = 16'666'666; constexpr int32_t DEFAULT_REFRESH_RATE = 16'666'667; constexpr int32_t DEFAULT_DPI = 320; constexpr int DEFAULT_VIRTUAL_DISPLAY_SURFACE_FORMAT = HAL_PIXEL_FORMAT_RGB_565; Loading