From acc4dcf1787b9fc43c5748ce06e79f045e07a3ff Mon Sep 17 00:00:00 2001 From: John Stultz Date: Thu, 26 Apr 2018 12:05:57 -0700 Subject: drm_hwcomposer: Fall back to client compositon if the gl precompostior fails If the gl precompositor isn't being used, we cannot accept every layer as a device composited layer. Thus this patch adds some extra logic in the validate function to fall back to client side compositing if the gl precompositor did not initialize properly. This does force everything to a single plane even if we have a few available, but a deeper rework of the validate step planning is needed before we can reliably make use of them. Credit to Rob Herring, who's single plane patch was what this was originally based on. Cc: Marissa Wall Cc: Sean Paul Cc: Dmitry Shmidt Cc: Robert Foss Cc: Matt Szczesiak Cc: Liviu Dudau Cc: David Hanna Cc: Rob Herring Cc: Alexandru-Cosmin Gheorghe Cc: Alistair Strachan Reviewed-by: Rob Herring Signed-off-by: John Stultz --- drmhwctwo.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drmhwctwo.cpp b/drmhwctwo.cpp index 8e00d71..ede75e0 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 (!compositor_.uses_GL()) { + layer.set_validated_type(HWC2::Composition::Client); + ++*num_types; + break; + } + /* fall through */ default: layer.set_validated_type(layer.sf_type()); break; -- cgit v1.2.3