diff options
author | 2023-07-12 20:37:59 -0700 | |
---|---|---|
committer | 2023-08-09 16:40:00 -0700 | |
commit | 3c722da347953b10762d74a12b7cc9840698b005 (patch) | |
tree | 009d51b56a2b4834170cd4483111ed435ff4c799 /services/surfaceflinger/DisplayDevice.cpp | |
parent | ca1bc7bd1572a590a739c3539c388471d4bcec33 (diff) |
[SF] Update to use updateRefreshRateOverlayRate from setActiveMode
setActiveMode updates the refresh rate on the overlay
when changes the refresh rate not caused by the HWC callback,
updating overlay directly created the race condition for the updates.
Updates the order to enable the overlay first and
then making the call to HWC to enableRefreshRateCallbackDebugEnabled
BUG: 279544150
Test: manual test
Change-Id: I42eed19242944479e5f9e6edf10565417f358a73
Diffstat (limited to 'services/surfaceflinger/DisplayDevice.cpp')
-rw-r--r-- | services/surfaceflinger/DisplayDevice.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/services/surfaceflinger/DisplayDevice.cpp b/services/surfaceflinger/DisplayDevice.cpp index 3c7cbe693f..70ccaf883e 100644 --- a/services/surfaceflinger/DisplayDevice.cpp +++ b/services/surfaceflinger/DisplayDevice.cpp @@ -213,10 +213,7 @@ void DisplayDevice::setActiveMode(DisplayModeId modeId, Fps displayFps, Fps rend ATRACE_INT(mRenderFrameRateFPSTrace.c_str(), renderFps.getIntValue()); mRefreshRateSelector->setActiveMode(modeId, renderFps); - - if (mRefreshRateOverlay) { - mRefreshRateOverlay->changeRefreshRate(displayFps, renderFps); - } + updateRefreshRateOverlayRate(displayFps, renderFps); } status_t DisplayDevice::initiateModeChange(const ActiveModeInfo& info, @@ -473,7 +470,7 @@ void DisplayDevice::enableRefreshRateOverlay(bool enable, bool setByHwc, bool sh mRefreshRateOverlay = std::make_unique<RefreshRateOverlay>(fpsRange, features); mRefreshRateOverlay->setLayerStack(getLayerStack()); mRefreshRateOverlay->setViewport(getSize()); - updateRefreshRateOverlayRate(getActiveMode().modePtr->getFps(), getActiveMode().fps); + updateRefreshRateOverlayRate(getActiveMode().modePtr->getFps(), getActiveMode().fps, setByHwc); } void DisplayDevice::updateRefreshRateOverlayRate(Fps displayFps, Fps renderFps, bool setByHwc) { |