Originally based on work by Rob Herring, this patch changes
ValidateDisplay() so that if there is only one plane, we modify
Device composited layers to be Client composited.

Without this, on devices with just one plane, nothing gets
displayed on the screen.

Suggestions for alternative solutions here would be greatly
appreciated!

Cc: Marissa Wall <maris...@google.com>
Cc: Sean Paul <seanp...@google.com>
Cc: Dmitry Shmidt <dimitr...@google.com>
Cc: Robert Foss <robert.f...@collabora.com>
Cc: Matt Szczesiak <matt.szczes...@arm.com>
Cc: Liviu Dudau <liviu.du...@arm.com>
Cc: David Hanna <david.hann...@gmail.com>
Cc: Rob Herring <rob.herr...@linaro.org>
Signed-off-by: John Stultz <john.stu...@linaro.org>
---
v2:
* Rework Rob's change to check planes
---
 drmhwctwo.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drmhwctwo.cpp b/drmhwctwo.cpp
index dfca1a6..6d88c5c 100644
--- a/drmhwctwo.cpp
+++ b/drmhwctwo.cpp
@@ -695,6 +695,13 @@ HWC2::Error 
DrmHwcTwo::HwcDisplay::ValidateDisplay(uint32_t *num_types,
         layer.set_validated_type(HWC2::Composition::Client);
         ++*num_types;
         break;
+      case HWC2::Composition::Device:
+       /* If we only have one plane, always do Client composition */
+        if (primary_planes_.size() + overlay_planes_.size() == 1) {
+          layer.set_validated_type(HWC2::Composition::Client);
+          ++*num_types;
+          break;
+        }
       default:
         layer.set_validated_type(layer.sf_type());
         break;
-- 
2.7.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reply via email to