diff options
author | 2023-11-19 10:24:51 -0500 | |
---|---|---|
committer | 2023-11-20 14:39:28 -0500 | |
commit | 4b32e4bce09e1932e485d333725bbcbfef4f5e52 (patch) | |
tree | 2f5de1d92552447b86cb1ecdc792874e041d5e9c /services/surfaceflinger/DisplayDevice.cpp | |
parent | 6165155e50e4a7d730236403fcf8f64c35d5984c (diff) |
SF: Clean up DisplayDevice::initiateModeChange
Trace the pending mode after successfully setting it on HWC.
Remove unused status_t return value, and redundant warning log. Disallow
nullptr for out parameter.
Bug: 255635711
Test: presubmit
Change-Id: I381e5528d6336c300a80abcebccdd76369126c04
Diffstat (limited to 'services/surfaceflinger/DisplayDevice.cpp')
-rw-r--r-- | services/surfaceflinger/DisplayDevice.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/services/surfaceflinger/DisplayDevice.cpp b/services/surfaceflinger/DisplayDevice.cpp index 50e94bf9e4..7fdf9e7672 100644 --- a/services/surfaceflinger/DisplayDevice.cpp +++ b/services/surfaceflinger/DisplayDevice.cpp @@ -217,9 +217,9 @@ void DisplayDevice::setActiveMode(DisplayModeId modeId, Fps vsyncRate, Fps rende updateRefreshRateOverlayRate(vsyncRate, renderFps); } -status_t DisplayDevice::initiateModeChange(const ActiveModeInfo& info, - const hal::VsyncPeriodChangeConstraints& constraints, - hal::VsyncPeriodChangeTimeline* outTimeline) { +bool DisplayDevice::initiateModeChange(const ActiveModeInfo& info, + const hal::VsyncPeriodChangeConstraints& constraints, + hal::VsyncPeriodChangeTimeline& outTimeline) { if (!info.modeOpt || info.modeOpt->modePtr->getPhysicalDisplayId() != getPhysicalId()) { ALOGE("Trying to initiate a mode change to invalid mode %s on display %s", info.modeOpt ? std::to_string(info.modeOpt->modePtr->getId().value()).c_str() @@ -230,11 +230,15 @@ status_t DisplayDevice::initiateModeChange(const ActiveModeInfo& info, mPendingMode = info; mIsModeSetPending = true; - const auto& pendingMode = *info.modeOpt->modePtr; - ATRACE_INT(mPendingModeFpsTrace.c_str(), pendingMode.getVsyncRate().getIntValue()); + const auto& mode = *info.modeOpt->modePtr; - return mHwComposer.setActiveModeWithConstraints(getPhysicalId(), pendingMode.getHwcId(), - constraints, outTimeline); + if (mHwComposer.setActiveModeWithConstraints(getPhysicalId(), mode.getHwcId(), constraints, + &outTimeline) != OK) { + return false; + } + + ATRACE_INT(mPendingModeFpsTrace.c_str(), mode.getVsyncRate().getIntValue()); + return true; } void DisplayDevice::finalizeModeChange(DisplayModeId modeId, Fps vsyncRate, Fps renderFps) { |