Skip to content

Commit 5b73d4d

Browse files
Rachel LeeAndroid (Google) Code Review
authored andcommitted
Merge "getSupportedRefreshRates same as legacy on MRR" into main
2 parents c28b463 + d7f5048 commit 5b73d4d

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

services/surfaceflinger/SurfaceFlinger.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1269,7 +1269,17 @@ void SurfaceFlinger::getDynamicDisplayInfoInternal(ui::DynamicDisplayInfo*& info
12691269
ui::FrameRateCategoryRate frameRateCategoryRate(normal.getValue(), high.getValue());
12701270
info->frameRateCategoryRate = frameRateCategoryRate;
12711271

1272-
info->supportedRefreshRates = display->refreshRateSelector().getSupportedFrameRates();
1272+
if (info->hasArrSupport) {
1273+
info->supportedRefreshRates = display->refreshRateSelector().getSupportedFrameRates();
1274+
} else {
1275+
// On non-ARR devices, list the refresh rates same as the supported display modes.
1276+
std::vector<float> supportedFrameRates;
1277+
supportedFrameRates.reserve(info->supportedDisplayModes.size());
1278+
std::transform(info->supportedDisplayModes.begin(), info->supportedDisplayModes.end(),
1279+
std::back_inserter(supportedFrameRates),
1280+
[](ui::DisplayMode mode) { return mode.peakRefreshRate; });
1281+
info->supportedRefreshRates = supportedFrameRates;
1282+
}
12731283
info->activeColorMode = display->getCompositionDisplay()->getState().colorMode;
12741284
info->hdrCapabilities = filterOut4k30(display->getHdrCapabilities());
12751285

0 commit comments

Comments
 (0)