surfaceflinger: discard stale commands

When we skip validate, we may have stale commands on the command
buffer.  They should be discarded.

Bug: 62906801
Test: manual
Change-Id: Ie7921ba75ab2252b834cda6924e1fcfdf236f759
diff --git a/services/surfaceflinger/DisplayHardware/HWC2.h b/services/surfaceflinger/DisplayHardware/HWC2.h
index 4d9155c..7463e3b 100644
--- a/services/surfaceflinger/DisplayHardware/HWC2.h
+++ b/services/surfaceflinger/DisplayHardware/HWC2.h
@@ -259,6 +259,12 @@
                                                  uint32_t* outNumRequests,
                                                           android::sp<android::Fence>* outPresentFence, uint32_t* state);
 
+    // Most methods in this class write a command to a command buffer.  The
+    // command buffer is implicitly submitted in validate, present, and
+    // presentOrValidate.  This method provides a way to discard the commands,
+    // which can be used to discard stale commands.
+    void discardCommands();
+
     // Other Display methods
 
     Device& getDevice() const { return mDevice; }