SF: Start restructuring display creation

Create the compositionengine::Display first thing, outside of
DisplayDevice, and pass it in as part of creating the DisplayDevice,
rather than creating it internal to DisplayDevice.

Also to start, move the logic to allocate a DisplayId for a HWC backed
virtual display into the CompositionEngine class.

This is a first step to moving the internal setup of the display to
CompositionEngine, and eventually eliminating DisplayDevice entirely, as
it is but a thin wrapper around the other class.

DisplayTransactionTest is adjusted so the dummy created DisplayDevices
have an appropriate compositionengine::Display.

Test: atest libsurfaceflinger_unittest libcompositionengine_test
Bug: 142831417
Change-Id: I8417682f4ead7b550a8973d4716c627e31b07b6e
Merged-In: I8417682f4ead7b550a8973d4716c627e31b07b6e
(cherry picked from commit 9370a480fc0a99575a57500b03c9c45d9e52bc1d)
diff --git a/services/surfaceflinger/DisplayDevice.h b/services/surfaceflinger/DisplayDevice.h
index d970b82..fb6c817 100644
--- a/services/surfaceflinger/DisplayDevice.h
+++ b/services/surfaceflinger/DisplayDevice.h
@@ -64,7 +64,7 @@
     constexpr static float sDefaultMinLumiance = 0.0;
     constexpr static float sDefaultMaxLumiance = 500.0;
 
-    explicit DisplayDevice(DisplayDeviceCreationArgs&& args);
+    explicit DisplayDevice(DisplayDeviceCreationArgs& args);
     virtual ~DisplayDevice();
 
     std::shared_ptr<compositionengine::Display> getCompositionDisplay() const {
@@ -211,13 +211,10 @@
     // We use a constructor to ensure some of the values are set, without
     // assuming a default value.
     DisplayDeviceCreationArgs(const sp<SurfaceFlinger>&, const wp<IBinder>& displayToken,
-                              std::optional<DisplayId>);
-
-    bool isVirtual() const { return !connectionType; }
-
+                              std::shared_ptr<compositionengine::Display>);
     const sp<SurfaceFlinger> flinger;
     const wp<IBinder> displayToken;
-    const std::optional<DisplayId> displayId;
+    const std::shared_ptr<compositionengine::Display> compositionDisplay;
 
     int32_t sequenceId{0};
     std::optional<DisplayConnectionType> connectionType;
@@ -231,7 +228,6 @@
     std::unordered_map<ui::ColorMode, std::vector<ui::RenderIntent>> hwcColorModes;
     int initialPowerMode{HWC_POWER_MODE_NORMAL};
     bool isPrimary{false};
-    Hwc2::PowerAdvisor* powerAdvisor{nullptr};
 };
 
 class DisplayRenderArea : public RenderArea {