drm_hwcomposer: Virtual display acceleration support

Some platforms like RaspberryPI-4 can benefit from Display Blender IP Core's
ability to write back the composition into RAM, offloading the GPU in cases
where the display content needs to be used (screen record, remote display,
etc.).

To enable this feature the following system property must be enabled:

    PRODUCT_VENDOR_PROPERTIES += debug.sf.enable_hwc_vds=1

The feature was requested by the Tesla Android project to improve UI
performance.

Closes: https://gitlab.freedesktop.org/drm-hwcomposer/drm-hwcomposer/-/issues/4
Change-Id: I643f94551408bf218a0b889f1a031598646242f1
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
diff --git a/hwc2_device/HwcDisplay.h b/hwc2_device/HwcDisplay.h
index d9dc4eb..aef029a 100644
--- a/hwc2_device/HwcDisplay.h
+++ b/hwc2_device/HwcDisplay.h
@@ -182,6 +182,15 @@
     return flatcon_;
   }
 
+  auto &GetWritebackLayer() {
+    return writeback_layer_;
+  }
+
+  void SetVirtualDisplayResolution(uint16_t width, uint16_t height) {
+    virtual_disp_width_ = width;
+    virtual_disp_height_ = height;
+  }
+
  private:
   HwcDisplayConfigs configs_;
 
@@ -210,6 +219,9 @@
 
   std::map<hwc2_layer_t, HwcLayer> layers_;
   HwcLayer client_layer_;
+  std::unique_ptr<HwcLayer> writeback_layer_;
+  uint16_t virtual_disp_width_{};
+  uint16_t virtual_disp_height_{};
   int32_t color_mode_{};
   static constexpr int kCtmRows = 3;
   static constexpr int kCtmCols = 3;