Loading services/surfaceflinger/DisplayDevice.cpp +0 −13 Original line number Diff line number Diff line Loading @@ -201,19 +201,6 @@ bool DisplayDevice::isPoweredOn() const { return mPowerMode != hal::PowerMode::OFF; } nsecs_t DisplayDevice::getVsyncPeriodFromHWC() const { const auto physicalId = getPhysicalId(); if (!mHwComposer.isConnected(physicalId)) { return 0; } if (const auto vsyncPeriodOpt = mHwComposer.getDisplayVsyncPeriod(physicalId).value_opt()) { return *vsyncPeriodOpt; } return refreshRateSelector().getActiveMode().modePtr->getVsyncRate().getPeriodNsecs(); } ui::Dataspace DisplayDevice::getCompositionDataSpace() const { return mCompositionDisplay->getState().dataspace; } Loading services/surfaceflinger/DisplayDevice.h +0 −2 Original line number Diff line number Diff line Loading @@ -203,8 +203,6 @@ public: void updateHdrSdrRatioOverlayRatio(float currentHdrSdrRatio); bool isHdrSdrRatioOverlayEnabled() const { return mHdrSdrRatioOverlay != nullptr; } nsecs_t getVsyncPeriodFromHWC() const; Fps getAdjustedRefreshRate() const { return mAdjustedRefreshRate; } // Round the requested refresh rate to match a divisor of the pacesetter Loading services/surfaceflinger/Layer.cpp +8 −2 Original line number Diff line number Diff line Loading @@ -3792,7 +3792,8 @@ void Layer::onCompositionPresented(const DisplayDevice* display, } if (display) { const Fps refreshRate = display->refreshRateSelector().getActiveMode().fps; const auto activeMode = display->refreshRateSelector().getActiveMode(); const Fps refreshRate = activeMode.fps; const std::optional<Fps> renderRate = mFlinger->mScheduler->getFrameRateOverride(getOwnerUid()); Loading @@ -3812,7 +3813,12 @@ void Layer::onCompositionPresented(const DisplayDevice* display, mFlinger->getHwComposer().getPresentTimestamp(*displayId); const nsecs_t now = systemTime(CLOCK_MONOTONIC); const nsecs_t vsyncPeriod = display->getVsyncPeriodFromHWC(); const nsecs_t vsyncPeriod = mFlinger->getHwComposer() .getDisplayVsyncPeriod(*displayId) .value_opt() .value_or(activeMode.modePtr->getVsyncRate().getPeriodNsecs()); const nsecs_t actualPresentTime = now - ((now - presentTimestamp) % vsyncPeriod); mFlinger->mTimeStats->setPresentTime(layerId, mCurrentFrameNumber, actualPresentTime, Loading services/surfaceflinger/Scheduler/Scheduler.cpp +12 −15 Original line number Diff line number Diff line Loading @@ -877,9 +877,6 @@ void Scheduler::dump(utils::Dumper& dumper) const { mRefreshRateStats->dump(dumper.out()); dumper.eol(); { utils::Dumper::Section section(dumper, "Frame Targeting"sv); std::scoped_lock lock(mDisplayLock); ftl::FakeGuard guard(kMainThreadContext); Loading @@ -890,11 +887,11 @@ void Scheduler::dump(utils::Dumper& dumper) const { ? ftl::Concat("Pacesetter Display ", id.value).c_str() : ftl::Concat("Follower Display ", id.value).c_str()); display.selectorPtr->dump(dumper); display.targeterPtr->dump(dumper); dumper.eol(); } } } void Scheduler::dumpVsync(std::string& out) const { std::scoped_lock lock(mDisplayLock); Loading services/surfaceflinger/SurfaceFlinger.cpp +1 −14 Original line number Diff line number Diff line Loading @@ -2187,14 +2187,6 @@ void SurfaceFlinger::scheduleSample() { static_cast<void>(mScheduler->schedule([this] { sample(); })); } nsecs_t SurfaceFlinger::getVsyncPeriodFromHWC() const { if (const auto display = getDefaultDisplayDeviceLocked()) { return display->getVsyncPeriodFromHWC(); } return 0; } void SurfaceFlinger::onComposerHalVsync(hal::HWDisplayId hwcDisplayId, int64_t timestamp, std::optional<hal::VsyncPeriodNanos> vsyncPeriod) { if (FlagManager::getInstance().connected_display() && timestamp < 0 && Loading Loading @@ -5724,7 +5716,7 @@ void SurfaceFlinger::listLayers(std::string& result) const { } void SurfaceFlinger::dumpStats(const DumpArgs& args, std::string& result) const { StringAppendF(&result, "%" PRId64 "\n", getVsyncPeriodFromHWC()); StringAppendF(&result, "%" PRId64 "\n", mScheduler->getPacesetterVsyncPeriod().ns()); if (args.size() < 2) return; const auto name = String8(args[1]); Loading Loading @@ -5784,11 +5776,6 @@ void SurfaceFlinger::dumpScheduler(std::string& result) const { // TODO(b/241285876): Move to DisplayModeController. dumper.dump("debugDisplayModeSetByBackdoor"sv, mDebugDisplayModeSetByBackdoor); dumper.eol(); StringAppendF(&result, " present offset: %9" PRId64 " ns\t VSYNC period: %9" PRId64 " ns\n\n", dispSyncPresentTimeOffset, getVsyncPeriodFromHWC()); } void SurfaceFlinger::dumpEvents(std::string& result) const { Loading Loading
services/surfaceflinger/DisplayDevice.cpp +0 −13 Original line number Diff line number Diff line Loading @@ -201,19 +201,6 @@ bool DisplayDevice::isPoweredOn() const { return mPowerMode != hal::PowerMode::OFF; } nsecs_t DisplayDevice::getVsyncPeriodFromHWC() const { const auto physicalId = getPhysicalId(); if (!mHwComposer.isConnected(physicalId)) { return 0; } if (const auto vsyncPeriodOpt = mHwComposer.getDisplayVsyncPeriod(physicalId).value_opt()) { return *vsyncPeriodOpt; } return refreshRateSelector().getActiveMode().modePtr->getVsyncRate().getPeriodNsecs(); } ui::Dataspace DisplayDevice::getCompositionDataSpace() const { return mCompositionDisplay->getState().dataspace; } Loading
services/surfaceflinger/DisplayDevice.h +0 −2 Original line number Diff line number Diff line Loading @@ -203,8 +203,6 @@ public: void updateHdrSdrRatioOverlayRatio(float currentHdrSdrRatio); bool isHdrSdrRatioOverlayEnabled() const { return mHdrSdrRatioOverlay != nullptr; } nsecs_t getVsyncPeriodFromHWC() const; Fps getAdjustedRefreshRate() const { return mAdjustedRefreshRate; } // Round the requested refresh rate to match a divisor of the pacesetter Loading
services/surfaceflinger/Layer.cpp +8 −2 Original line number Diff line number Diff line Loading @@ -3792,7 +3792,8 @@ void Layer::onCompositionPresented(const DisplayDevice* display, } if (display) { const Fps refreshRate = display->refreshRateSelector().getActiveMode().fps; const auto activeMode = display->refreshRateSelector().getActiveMode(); const Fps refreshRate = activeMode.fps; const std::optional<Fps> renderRate = mFlinger->mScheduler->getFrameRateOverride(getOwnerUid()); Loading @@ -3812,7 +3813,12 @@ void Layer::onCompositionPresented(const DisplayDevice* display, mFlinger->getHwComposer().getPresentTimestamp(*displayId); const nsecs_t now = systemTime(CLOCK_MONOTONIC); const nsecs_t vsyncPeriod = display->getVsyncPeriodFromHWC(); const nsecs_t vsyncPeriod = mFlinger->getHwComposer() .getDisplayVsyncPeriod(*displayId) .value_opt() .value_or(activeMode.modePtr->getVsyncRate().getPeriodNsecs()); const nsecs_t actualPresentTime = now - ((now - presentTimestamp) % vsyncPeriod); mFlinger->mTimeStats->setPresentTime(layerId, mCurrentFrameNumber, actualPresentTime, Loading
services/surfaceflinger/Scheduler/Scheduler.cpp +12 −15 Original line number Diff line number Diff line Loading @@ -877,9 +877,6 @@ void Scheduler::dump(utils::Dumper& dumper) const { mRefreshRateStats->dump(dumper.out()); dumper.eol(); { utils::Dumper::Section section(dumper, "Frame Targeting"sv); std::scoped_lock lock(mDisplayLock); ftl::FakeGuard guard(kMainThreadContext); Loading @@ -890,11 +887,11 @@ void Scheduler::dump(utils::Dumper& dumper) const { ? ftl::Concat("Pacesetter Display ", id.value).c_str() : ftl::Concat("Follower Display ", id.value).c_str()); display.selectorPtr->dump(dumper); display.targeterPtr->dump(dumper); dumper.eol(); } } } void Scheduler::dumpVsync(std::string& out) const { std::scoped_lock lock(mDisplayLock); Loading
services/surfaceflinger/SurfaceFlinger.cpp +1 −14 Original line number Diff line number Diff line Loading @@ -2187,14 +2187,6 @@ void SurfaceFlinger::scheduleSample() { static_cast<void>(mScheduler->schedule([this] { sample(); })); } nsecs_t SurfaceFlinger::getVsyncPeriodFromHWC() const { if (const auto display = getDefaultDisplayDeviceLocked()) { return display->getVsyncPeriodFromHWC(); } return 0; } void SurfaceFlinger::onComposerHalVsync(hal::HWDisplayId hwcDisplayId, int64_t timestamp, std::optional<hal::VsyncPeriodNanos> vsyncPeriod) { if (FlagManager::getInstance().connected_display() && timestamp < 0 && Loading Loading @@ -5724,7 +5716,7 @@ void SurfaceFlinger::listLayers(std::string& result) const { } void SurfaceFlinger::dumpStats(const DumpArgs& args, std::string& result) const { StringAppendF(&result, "%" PRId64 "\n", getVsyncPeriodFromHWC()); StringAppendF(&result, "%" PRId64 "\n", mScheduler->getPacesetterVsyncPeriod().ns()); if (args.size() < 2) return; const auto name = String8(args[1]); Loading Loading @@ -5784,11 +5776,6 @@ void SurfaceFlinger::dumpScheduler(std::string& result) const { // TODO(b/241285876): Move to DisplayModeController. dumper.dump("debugDisplayModeSetByBackdoor"sv, mDebugDisplayModeSetByBackdoor); dumper.eol(); StringAppendF(&result, " present offset: %9" PRId64 " ns\t VSYNC period: %9" PRId64 " ns\n\n", dispSyncPresentTimeOffset, getVsyncPeriodFromHWC()); } void SurfaceFlinger::dumpEvents(std::string& result) const { Loading