Output::presentFrameAndReleaseLayers: flush pending commands for OFF displays
Most work from this method can be skipped if the display is not enabled.
However, uncaching buffers should still occur. If the display is
disabled and there are buffers to uncache, still flush pending commands.
They should only contain commands that are meaningful for a disabled
display, like bufferSlotsToClear.
Bug: 330806421
Test: libcompositionengine_test
Flag: flush_buffer_slots_to_uncache
Change-Id: I7baa3e76af86329fb266395e63e92a0ba38967f4
diff --git a/services/surfaceflinger/common/FlagManager.cpp b/services/surfaceflinger/common/FlagManager.cpp
index 57b170f..b78809a 100644
--- a/services/surfaceflinger/common/FlagManager.cpp
+++ b/services/surfaceflinger/common/FlagManager.cpp
@@ -148,6 +148,7 @@
DUMP_READ_ONLY_FLAG(commit_not_composited);
DUMP_READ_ONLY_FLAG(local_tonemap_screenshots);
DUMP_READ_ONLY_FLAG(override_trusted_overlay);
+ DUMP_READ_ONLY_FLAG(flush_buffer_slots_to_uncache);
#undef DUMP_READ_ONLY_FLAG
#undef DUMP_SERVER_FLAG
@@ -246,6 +247,7 @@
FLAG_MANAGER_READ_ONLY_FLAG(commit_not_composited, "");
FLAG_MANAGER_READ_ONLY_FLAG(local_tonemap_screenshots, "debug.sf.local_tonemap_screenshots");
FLAG_MANAGER_READ_ONLY_FLAG(override_trusted_overlay, "");
+FLAG_MANAGER_READ_ONLY_FLAG(flush_buffer_slots_to_uncache, "");
/// Trunk stable server flags ///
FLAG_MANAGER_SERVER_FLAG(refresh_rate_overlay_on_external_display, "")
diff --git a/services/surfaceflinger/common/include/common/FlagManager.h b/services/surfaceflinger/common/include/common/FlagManager.h
index 9517ff7..302d311 100644
--- a/services/surfaceflinger/common/include/common/FlagManager.h
+++ b/services/surfaceflinger/common/include/common/FlagManager.h
@@ -87,6 +87,7 @@
bool commit_not_composited() const;
bool local_tonemap_screenshots() const;
bool override_trusted_overlay() const;
+ bool flush_buffer_slots_to_uncache() const;
protected:
// overridden for unit tests