SF: Return EX_CONFIG_FAILED from setActiveConfigWithConstraints()
setActiveConfigWithConstraints() currently returns V2_4 Hal::Error
But with the new Composer3 IcomposerClient AIDL changes, it should
return int32_t corresponding the new EX_CONFIG_FAILED
exception. So define a new enum class Error to handle all V2_1 and 2_4
errors and the new IcomposerClient exception.
Also define a new class to return the result of initiateModeChange
as: Changed, Rejected, Aborted.
So change this plumbing through SF. Catch this error and propagate
up from DisplayModeController to SF using Scheduler
Bug: 374185540
Flag: EXEMPT refactor
Test: manual
Change-Id: I3548fd6bda806055fb071cc364d07d37b2693374
Signed-off-by: Manasi Navare <navaremanasi@google.com>
diff --git a/services/surfaceflinger/Display/DisplayModeController.h b/services/surfaceflinger/Display/DisplayModeController.h
index 9ec603d..af3e909 100644
--- a/services/surfaceflinger/Display/DisplayModeController.h
+++ b/services/surfaceflinger/Display/DisplayModeController.h
@@ -70,6 +70,7 @@
RefreshRateSelectorPtr selectorPtrFor(PhysicalDisplayId) const EXCLUDES(mDisplayLock);
enum class DesiredModeAction { None, InitiateDisplayModeSwitch, InitiateRenderRateSwitch };
+ enum class ModeChangeResult { Changed, Rejected, Aborted };
DesiredModeAction setDesiredMode(PhysicalDisplayId, DisplayModeRequest&&)
EXCLUDES(mDisplayLock);
@@ -86,9 +87,9 @@
scheduler::FrameRateMode getActiveMode(PhysicalDisplayId) const EXCLUDES(mDisplayLock);
- bool initiateModeChange(PhysicalDisplayId, DisplayModeRequest&&,
- const hal::VsyncPeriodChangeConstraints&,
- hal::VsyncPeriodChangeTimeline& outTimeline)
+ ModeChangeResult initiateModeChange(PhysicalDisplayId, DisplayModeRequest&&,
+ const hal::VsyncPeriodChangeConstraints&,
+ hal::VsyncPeriodChangeTimeline& outTimeline)
REQUIRES(kMainThreadContext) EXCLUDES(mDisplayLock);
void finalizeModeChange(PhysicalDisplayId, DisplayModeId, Fps vsyncRate, Fps renderFps)