AidlComposer: use a reader/writer per display

In order to call HWC from different threads, with one thread per
display, separate commands and their results per display.

AidlComposer:
- Add a maps from display to a ComposerClientReader and a
  ComposerClientWriter. Each reader/writer will be used by a single
  display. AidlComposer is generally threadsafe, except for these
  objects. (The other members are pointers to proxy binders, which can
  have their methods safely called from multiple threads.) Use an
  ftl::SharedMutex to guard access to the maps. The client is
  responsible for ensuring they do not attempt to access the same
  reader/writer concurrently from multiple threads. Different threads
  can access different readers/writers concurrently, but the mutex
  ensures that adding or deleting an entry does not impact access to the
  objects.
- Add a `Display` parameter to execute[Commands] and resetCommands, so
  that it only affects the intended writer. The callers already know
  which Display they care about, so pass it in.
- If no displays support DisplayCapability.MULTI_THREADED_PRESENT, use a
  single reader for all displays. This is required for backwards
  compatibility.

[Hidl]ComposerHal, MockComposer:
- update APIs for executeCommands and resetCommands
- implement onHotPlug[Connect/Disconnect]

HWComposer, fuzzer:
- pass the display to new APIs

Bug: 241285491
Test: make, boot
Change-Id: I2b62e4965b12b3c653e6c00f9f6ab4f48b506b18
diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.cpp b/services/surfaceflinger/DisplayHardware/HWComposer.cpp
index 168e2dd..5f11cb8 100644
--- a/services/surfaceflinger/DisplayHardware/HWComposer.cpp
+++ b/services/surfaceflinger/DisplayHardware/HWComposer.cpp
@@ -513,7 +513,7 @@
 
     if (displayData.validateWasSkipped) {
         // explicitly flush all pending commands
-        auto error = static_cast<hal::Error>(mComposer->executeCommands());
+        auto error = static_cast<hal::Error>(mComposer->executeCommands(hwcDisplay->getId()));
         RETURN_IF_HWC_ERROR_FOR("executeCommands", error, displayId, UNKNOWN_ERROR);
         RETURN_IF_HWC_ERROR_FOR("present", displayData.presentError, displayId, UNKNOWN_ERROR);
         return NO_ERROR;
@@ -933,6 +933,8 @@
                                                                : "Secondary display",
                                              .deviceProductInfo = std::nullopt};
         }();
+
+        mComposer->onHotplugConnect(hwcDisplayId);
     }
 
     if (!isConnected(info->id)) {
@@ -960,6 +962,7 @@
     // The display will later be destroyed by a call to HWComposer::disconnectDisplay. For now, mark
     // it as disconnected.
     mDisplayData.at(*displayId).hwcDisplay->setConnected(false);
+    mComposer->onHotplugDisconnect(hwcDisplayId);
     return DisplayIdentificationInfo{.id = *displayId};
 }