[hwc,4/4] drm_hwcomposer: Fall back to client compositon if the gl precompostior fails

Message ID 1524769557-6108-4-git-send-email-john.stultz@linaro.org
State New
Headers show
Series
  • [hwc,1/4] drm_hwcomposer: Andorid.mk : Mark libdrmhwc_utils as vendor module
Related show

Commit Message

John Stultz April 26, 2018, 7:05 p.m.
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 <marissaw@google.com>
Cc: Sean Paul <seanpaul@google.com>
Cc: Dmitry Shmidt <dimitrysh@google.com>
Cc: Robert Foss <robert.foss@collabora.com>
Cc: Matt Szczesiak <matt.szczesiak@arm.com>
Cc: Liviu Dudau <Liviu.Dudau@arm.com>
Cc: David Hanna <david.hanna11@gmail.com>
Cc: Rob Herring <rob.herring@linaro.org>
Cc: Alexandru-Cosmin Gheorghe <Alexandru-Cosmin.Gheorghe@arm.com>
Cc: Alistair Strachan <astrachan@google.com>
Reviewed-by: Rob Herring <robh@kernel.org>

Signed-off-by: John Stultz <john.stultz@linaro.org>

---
v2:
* Dropped misguided attempt to trivially allocate layers to planes
---
 drmhwctwo.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

-- 
2.7.4

Comments

Robert Foss April 27, 2018, 12:17 p.m. | #1
This patch is:
Acked-by: Robert Foss <robert.foss@collabora.com>

I'll push this series upstream in a few minutes.

On 04/26/2018 09:05 PM, John Stultz wrote:
> 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 <marissaw@google.com>
> Cc: Sean Paul <seanpaul@google.com>
> Cc: Dmitry Shmidt <dimitrysh@google.com>
> Cc: Robert Foss <robert.foss@collabora.com>
> Cc: Matt Szczesiak <matt.szczesiak@arm.com>
> Cc: Liviu Dudau <Liviu.Dudau@arm.com>
> Cc: David Hanna <david.hanna11@gmail.com>
> Cc: Rob Herring <rob.herring@linaro.org>
> Cc: Alexandru-Cosmin Gheorghe <Alexandru-Cosmin.Gheorghe@arm.com>
> Cc: Alistair Strachan <astrachan@google.com>
> Reviewed-by: Rob Herring <robh@kernel.org>
> Signed-off-by: John Stultz <john.stultz@linaro.org>
> ---
> v2:
> * Dropped misguided attempt to trivially allocate layers to planes
> ---
>   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;
>

Patch

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;