From bac7071aa3b1ae72f90b904b9af61b5c74ba9265 Mon Sep 17 00:00:00 2001 From: Dennis Kiilerich Date: Fri, 7 Mar 2025 14:58:25 -0800 Subject: Turn off synthetic VSYNC when adjusting thread scheduling for performance * This CL explicitly sets synthetic VSYNC state based on the new power state. Before, the synthetic VSYNC state was assumed based on the previous power state and in some cases was not set explicitly. * The previous behaviour of enabling synthetic VSYNC if the only display is DOZE_SUSPEND is preserved. * This also fixes a hypothetical gap where it would not optimise for performance if there were a display that needed it, while the primary display was DOZE_SUSPEND. Bug: 342681202 Bug: 241285876 Flag: android.companion.virtualdevice.flags.correct_virtual_display_power_state Test: manually tested with flag on/off using Android Auto Projected Change-Id: I181aefad586ad7b1732c837b67a01d61939d1d3e --- services/surfaceflinger/DisplayDevice.cpp | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'services/surfaceflinger/DisplayDevice.cpp') diff --git a/services/surfaceflinger/DisplayDevice.cpp b/services/surfaceflinger/DisplayDevice.cpp index bad5e2e3b5..de7d455fa4 100644 --- a/services/surfaceflinger/DisplayDevice.cpp +++ b/services/surfaceflinger/DisplayDevice.cpp @@ -50,17 +50,6 @@ namespace android { namespace hal = hardware::graphics::composer::hal; -namespace gui { -inline std::string_view to_string(ISurfaceComposer::OptimizationPolicy optimizationPolicy) { - switch (optimizationPolicy) { - case ISurfaceComposer::OptimizationPolicy::optimizeForPower: - return "optimizeForPower"; - case ISurfaceComposer::OptimizationPolicy::optimizeForPerformance: - return "optimizeForPerformance"; - } -} -} // namespace gui - DisplayDeviceCreationArgs::DisplayDeviceCreationArgs( const sp& flinger, HWComposer& hwComposer, const wp& displayToken, std::shared_ptr compositionDisplay) -- cgit v1.2.3-59-g8ed1b