Loading libs/gui/SurfaceComposerClient.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -2873,6 +2873,11 @@ void SurfaceComposerClient::getDynamicDisplayInfoInternal(gui::DynamicDisplayInf outInfo->hasArrSupport = ginfo.hasArrSupport; outInfo->frameRateCategoryRate = ui::FrameRateCategoryRate(ginfo.frameRateCategoryRate.normal, ginfo.frameRateCategoryRate.high); outInfo->supportedRefreshRates.clear(); outInfo->supportedRefreshRates.reserve(ginfo.supportedRefreshRates.size()); for (const auto rate : ginfo.supportedRefreshRates) { outInfo->supportedRefreshRates.push_back(static_cast<float>(rate)); } } status_t SurfaceComposerClient::getDynamicDisplayInfoFromId(int64_t displayId, Loading libs/gui/aidl/android/gui/DynamicDisplayInfo.aidl +3 −0 Original line number Diff line number Diff line Loading @@ -50,4 +50,7 @@ parcelable DynamicDisplayInfo { // Represents frame rate for FrameRateCategory Normal and High. FrameRateCategoryRate frameRateCategoryRate; // All the refresh rates supported for the default display mode. float[] supportedRefreshRates; } libs/ui/include/ui/DynamicDisplayInfo.h +3 −0 Original line number Diff line number Diff line Loading @@ -59,6 +59,9 @@ struct DynamicDisplayInfo { // Represents frame rate for FrameRateCategory Normal and High. ui::FrameRateCategoryRate frameRateCategoryRate; // All the refresh rates supported for the default display mode. std::vector<float> supportedRefreshRates; }; } // namespace android::ui services/surfaceflinger/Scheduler/RefreshRateSelector.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -1557,6 +1557,19 @@ Fps RefreshRateSelector::findClosestKnownFrameRate(Fps frameRate) const { return distance1 < distance2 ? *lowerBound : *std::prev(lowerBound); } std::vector<float> RefreshRateSelector::getSupportedFrameRates() const { std::scoped_lock lock(mLock); // TODO(b/356986687) Remove the limit once we have the anchor list implementation. const size_t frameRatesSize = std::min<size_t>(11, mPrimaryFrameRates.size()); std::vector<float> supportedFrameRates; supportedFrameRates.reserve(frameRatesSize); std::transform(mPrimaryFrameRates.rbegin(), mPrimaryFrameRates.rbegin() + static_cast<int>(frameRatesSize), std::back_inserter(supportedFrameRates), [](FrameRateMode mode) { return mode.fps.getValue(); }); return supportedFrameRates; } auto RefreshRateSelector::getIdleTimerAction() const -> KernelIdleTimerAction { std::lock_guard lock(mLock); Loading services/surfaceflinger/Scheduler/RefreshRateSelector.h +2 −0 Original line number Diff line number Diff line Loading @@ -441,6 +441,8 @@ public: std::pair<Fps, Fps> getFrameRateCategoryRates() const { return kFrameRateCategoryRates; } std::vector<float> getSupportedFrameRates() const EXCLUDES(mLock); private: friend struct TestableRefreshRateSelector; Loading Loading
libs/gui/SurfaceComposerClient.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -2873,6 +2873,11 @@ void SurfaceComposerClient::getDynamicDisplayInfoInternal(gui::DynamicDisplayInf outInfo->hasArrSupport = ginfo.hasArrSupport; outInfo->frameRateCategoryRate = ui::FrameRateCategoryRate(ginfo.frameRateCategoryRate.normal, ginfo.frameRateCategoryRate.high); outInfo->supportedRefreshRates.clear(); outInfo->supportedRefreshRates.reserve(ginfo.supportedRefreshRates.size()); for (const auto rate : ginfo.supportedRefreshRates) { outInfo->supportedRefreshRates.push_back(static_cast<float>(rate)); } } status_t SurfaceComposerClient::getDynamicDisplayInfoFromId(int64_t displayId, Loading
libs/gui/aidl/android/gui/DynamicDisplayInfo.aidl +3 −0 Original line number Diff line number Diff line Loading @@ -50,4 +50,7 @@ parcelable DynamicDisplayInfo { // Represents frame rate for FrameRateCategory Normal and High. FrameRateCategoryRate frameRateCategoryRate; // All the refresh rates supported for the default display mode. float[] supportedRefreshRates; }
libs/ui/include/ui/DynamicDisplayInfo.h +3 −0 Original line number Diff line number Diff line Loading @@ -59,6 +59,9 @@ struct DynamicDisplayInfo { // Represents frame rate for FrameRateCategory Normal and High. ui::FrameRateCategoryRate frameRateCategoryRate; // All the refresh rates supported for the default display mode. std::vector<float> supportedRefreshRates; }; } // namespace android::ui
services/surfaceflinger/Scheduler/RefreshRateSelector.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -1557,6 +1557,19 @@ Fps RefreshRateSelector::findClosestKnownFrameRate(Fps frameRate) const { return distance1 < distance2 ? *lowerBound : *std::prev(lowerBound); } std::vector<float> RefreshRateSelector::getSupportedFrameRates() const { std::scoped_lock lock(mLock); // TODO(b/356986687) Remove the limit once we have the anchor list implementation. const size_t frameRatesSize = std::min<size_t>(11, mPrimaryFrameRates.size()); std::vector<float> supportedFrameRates; supportedFrameRates.reserve(frameRatesSize); std::transform(mPrimaryFrameRates.rbegin(), mPrimaryFrameRates.rbegin() + static_cast<int>(frameRatesSize), std::back_inserter(supportedFrameRates), [](FrameRateMode mode) { return mode.fps.getValue(); }); return supportedFrameRates; } auto RefreshRateSelector::getIdleTimerAction() const -> KernelIdleTimerAction { std::lock_guard lock(mLock); Loading
services/surfaceflinger/Scheduler/RefreshRateSelector.h +2 −0 Original line number Diff line number Diff line Loading @@ -441,6 +441,8 @@ public: std::pair<Fps, Fps> getFrameRateCategoryRates() const { return kFrameRateCategoryRates; } std::vector<float> getSupportedFrameRates() const EXCLUDES(mLock); private: friend struct TestableRefreshRateSelector; Loading