File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2873,6 +2873,11 @@ void SurfaceComposerClient::getDynamicDisplayInfoInternal(gui::DynamicDisplayInf
28732873 outInfo->hasArrSupport = ginfo.hasArrSupport ;
28742874 outInfo->frameRateCategoryRate = ui::FrameRateCategoryRate (ginfo.frameRateCategoryRate .normal ,
28752875 ginfo.frameRateCategoryRate .high );
2876+ outInfo->supportedRefreshRates .clear ();
2877+ outInfo->supportedRefreshRates .reserve (ginfo.supportedRefreshRates .size ());
2878+ for (const auto rate : ginfo.supportedRefreshRates ) {
2879+ outInfo->supportedRefreshRates .push_back (static_cast <float >(rate));
2880+ }
28762881}
28772882
28782883status_t SurfaceComposerClient::getDynamicDisplayInfoFromId (int64_t displayId,
Original file line number Diff line number Diff line change @@ -50,4 +50,7 @@ parcelable DynamicDisplayInfo {
5050
5151 // Represents frame rate for FrameRateCategory Normal and High.
5252 FrameRateCategoryRate frameRateCategoryRate ;
53+
54+ // All the refresh rates supported for the default display mode.
55+ float [] supportedRefreshRates ;
5356}
Original file line number Diff line number Diff line change @@ -59,6 +59,9 @@ struct DynamicDisplayInfo {
5959
6060 // Represents frame rate for FrameRateCategory Normal and High.
6161 ui::FrameRateCategoryRate frameRateCategoryRate;
62+
63+ // All the refresh rates supported for the default display mode.
64+ std::vector<float > supportedRefreshRates;
6265};
6366
6467} // namespace android::ui
Original file line number Diff line number Diff line change @@ -1557,6 +1557,19 @@ Fps RefreshRateSelector::findClosestKnownFrameRate(Fps frameRate) const {
15571557 return distance1 < distance2 ? *lowerBound : *std::prev (lowerBound);
15581558}
15591559
1560+ std::vector<float > RefreshRateSelector::getSupportedFrameRates () const {
1561+ std::scoped_lock lock (mLock );
1562+ // TODO(b/356986687) Remove the limit once we have the anchor list implementation.
1563+ const size_t frameRatesSize = std::min<size_t >(11 , mPrimaryFrameRates .size ());
1564+ std::vector<float > supportedFrameRates;
1565+ supportedFrameRates.reserve (frameRatesSize);
1566+ std::transform (mPrimaryFrameRates .rbegin (),
1567+ mPrimaryFrameRates .rbegin () + static_cast <int >(frameRatesSize),
1568+ std::back_inserter (supportedFrameRates),
1569+ [](FrameRateMode mode) { return mode.fps .getValue (); });
1570+ return supportedFrameRates;
1571+ }
1572+
15601573auto RefreshRateSelector::getIdleTimerAction () const -> KernelIdleTimerAction {
15611574 std::lock_guard lock (mLock );
15621575
Original file line number Diff line number Diff line change @@ -441,6 +441,8 @@ class RefreshRateSelector {
441441
442442 std::pair<Fps, Fps> getFrameRateCategoryRates () const { return kFrameRateCategoryRates ; }
443443
444+ std::vector<float > getSupportedFrameRates () const EXCLUDES(mLock );
445+
444446private:
445447 friend struct TestableRefreshRateSelector ;
446448
Original file line number Diff line number Diff line change @@ -1231,6 +1231,8 @@ void SurfaceFlinger::getDynamicDisplayInfoInternal(ui::DynamicDisplayInfo*& info
12311231 const auto [normal, high] = display->refreshRateSelector ().getFrameRateCategoryRates ();
12321232 ui::FrameRateCategoryRate frameRateCategoryRate (normal.getValue (), high.getValue ());
12331233 info->frameRateCategoryRate = frameRateCategoryRate;
1234+
1235+ info->supportedRefreshRates = display->refreshRateSelector ().getSupportedFrameRates ();
12341236 info->activeColorMode = display->getCompositionDisplay ()->getState ().colorMode ;
12351237 info->hdrCapabilities = filterOut4k30 (display->getHdrCapabilities ());
12361238
@@ -8643,6 +8645,11 @@ void SurfaceComposerAIDL::getDynamicDisplayInfoInternal(ui::DynamicDisplayInfo&
86438645 gui::FrameRateCategoryRate& frameRateCategoryRate = outInfo->frameRateCategoryRate ;
86448646 frameRateCategoryRate.normal = info.frameRateCategoryRate .getNormal ();
86458647 frameRateCategoryRate.high = info.frameRateCategoryRate .getHigh ();
8648+ outInfo->supportedRefreshRates .clear ();
8649+ outInfo->supportedRefreshRates .reserve (info.supportedRefreshRates .size ());
8650+ for (float supportedRefreshRate : info.supportedRefreshRates ) {
8651+ outInfo->supportedRefreshRates .push_back (supportedRefreshRate);
8652+ }
86468653
86478654 outInfo->supportedColorModes .clear ();
86488655 outInfo->supportedColorModes .reserve (info.supportedColorModes .size ());
You can’t perform that action at this time.
0 commit comments