Skip to content

Commit d7f5048

Browse files
author
Rachel Lee
committed
getSupportedRefreshRates same as legacy on MRR
For MRR devices, change the getSupportedRefreshRates logic to return the same refresh rates as what would be seen in the getSupportedRefreshRatesLegacy API. This is ensures the CTS will pass. Test: run cts-on-gsi -m CtsDisplayTestCases -t android.display.cts.DisplayTest#testGetSupportedRefreshRates Test: cts on git_main Bug: 401485115 Bug: 384427341 Flag: EXEMPT BUG_FIX Change-Id: Iab15c2804932785fed8e40fb7331b4ae8ea9de66
1 parent 835688b commit d7f5048

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
@@ -1265,7 +1265,17 @@ void SurfaceFlinger::getDynamicDisplayInfoInternal(ui::DynamicDisplayInfo*& info
12651265
ui::FrameRateCategoryRate frameRateCategoryRate(normal.getValue(), high.getValue());
12661266
info->frameRateCategoryRate = frameRateCategoryRate;
12671267

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

0 commit comments

Comments
 (0)