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/drm/ResourceManager.cpp b/drm/ResourceManager.cpp
index 634ccb7..a6e9fc2 100644
--- a/drm/ResourceManager.cpp
+++ b/drm/ResourceManager.cpp
@@ -187,4 +187,30 @@
return ordered_connectors;
}
+
+auto ResourceManager::GetVirtualDisplayPipeline()
+ -> std::shared_ptr<DrmDisplayPipeline> {
+ for (auto &drm : drms_) {
+ for (const auto &conn : drm->GetWritebackConnectors()) {
+ auto pipeline = DrmDisplayPipeline::CreatePipeline(*conn);
+ if (!pipeline) {
+ ALOGE("Failed to create pipeline for writeback connector %s",
+ conn->GetName().c_str());
+ }
+ if (pipeline) {
+ return pipeline;
+ }
+ }
+ }
+ return {};
+}
+
+auto ResourceManager::GetWritebackConnectorsCount() -> uint32_t {
+ uint32_t count = 0;
+ for (auto &drm : drms_) {
+ count += drm->GetWritebackConnectors().size();
+ }
+ return count;
+}
+
} // namespace android