Reland "Add Display, DisplaySurface, and DisplaySurfaceVk"

This reverts commit a34429d666f8caf299703866f08188a8dc57ccd7.

Original change: aosp/2218522

See https://android-review.googlesource.com/c/device/generic/vulkan-cereal/+/2252597/1..5
for the difference between the original change and this change.
The issue in the original change was:

1. FrameBuffer::setupSubWindow(<resize>) starts
2. FrameBuffer::setupSubWindow(<resize>) blocks PostWorker
3. FrameBuffer::setupSubWindow(<resize>) resizes the window
4. FrameBuffer::setupSubWindow(<resize>) calls m_displaySurface->updateSize()
   and DisplaySurfaceVk now has a potentially large size.
5. FrameBuffer::setupSubWindow(<resize>) unblocks PostWorker
6. PostWorker resumes with a POST command, calls DisplayVk->post()
7. DisplayVk::postImpl() does vkAcquireNextImageKHR() which doesn't return
   VK_ERROR_OUT_OF_DATE_KHR.
8. DisplayVk::postImpl() performs a vkCmdBlit() using the updated size
   from the connected DisplaySurfaceVk.

The original change relied on vkAcquireNextImageKHR() returning
VK_ERROR_OUT_OF_DATE_KHR early in order to recreate the swapchain. This
might not occur until later though and DisplayVk should always just use
the image extent from when the swapchain was created.

Bug: b/233939967
Test: android build
Test: cmake build
Test: cvd start --gpu_mode=gfxstream
Test: gfxstream unit tests
Change-Id: I493594ec597e26a7483dca206562340df1568240
diff --git a/stream-servers/vulkan/VkCommonOperations.cpp b/stream-servers/vulkan/VkCommonOperations.cpp
index da03f65..dfd3bcd 100644
--- a/stream-servers/vulkan/VkCommonOperations.cpp
+++ b/stream-servers/vulkan/VkCommonOperations.cpp
@@ -1225,6 +1225,24 @@
     sVkEmulation = nullptr;
 }
 
+std::unique_ptr<gfxstream::DisplaySurface> createDisplaySurface(FBNativeWindowType window,
+                                                                uint32_t width,
+                                                                uint32_t height) {
+    if (!sVkEmulation || !sVkEmulation->live) {
+        return nullptr;
+    }
+
+    auto surfaceVk = DisplaySurfaceVk::create(*sVkEmulation->ivk,
+                                              sVkEmulation->instance,
+                                              window);
+    if (!surfaceVk) {
+        VK_COMMON_ERROR("Failed to create DisplaySurfaceVk.");
+        return nullptr;
+    }
+
+    return std::make_unique<gfxstream::DisplaySurface>(width, height, std::move(surfaceVk));
+}
+
 // Precondition: sVkEmulation has valid device support info
 bool allocExternalMemory(VulkanDispatch* vk, VkEmulation::ExternalMemoryInfo* info,
                          bool actuallyExternal, Optional<uint64_t> deviceAlignment) {