All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH hwc 1/4] drm_hwcomposer: Andorid.mk : Mark libdrmhwc_utils as vendor module
@ 2018-04-26 19:05 John Stultz
  2018-04-26 19:05 ` [PATCH hwc 2/4] drm_hwcomposer: Use log/log.h instead of cutils/log.h John Stultz
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: John Stultz @ 2018-04-26 19:05 UTC (permalink / raw)
  To: dri-devel
  Cc: Rob Herring, Matt Szczesiak, Dmitry Shmidt, Sean Paul,
	Robert Foss, Alexandru-Cosmin Gheorghe, Liviu Dudau,
	Alistair Strachan, Marissa Wall, David Hanna

From: Sumit Semwal <sumit.semwal@linaro.org>

To allow drm_hwcomposer to build with Treble, set
the libdrmhwc_utils library as a vendor module.

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>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
[jstultz: commit message tweaks]
Signed-off-by: John Stultz <john.stultz@linaro.org>
---
 Android.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Android.mk b/Android.mk
index 1add286..a60d112 100644
--- a/Android.mk
+++ b/Android.mk
@@ -25,6 +25,7 @@ LOCAL_SRC_FILES := \
 	worker.cpp
 
 LOCAL_MODULE := libdrmhwc_utils
+LOCAL_VENDOR_MODULE := true
 
 include $(BUILD_STATIC_LIBRARY)
 
-- 
2.7.4

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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH hwc 2/4] drm_hwcomposer: Use log/log.h instead of cutils/log.h
  2018-04-26 19:05 [PATCH hwc 1/4] drm_hwcomposer: Andorid.mk : Mark libdrmhwc_utils as vendor module John Stultz
@ 2018-04-26 19:05 ` John Stultz
  2018-04-26 19:34   ` Robert Foss
  2018-04-26 19:05 ` [PATCH hwc 3/4] drm_hwcomposer: Cleanup gl precompositor init and provide uses_GL flag John Stultz
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: John Stultz @ 2018-04-26 19:05 UTC (permalink / raw)
  To: dri-devel
  Cc: Rob Herring, Matt Szczesiak, Dmitry Shmidt, Sean Paul,
	Robert Foss, Alexandru-Cosmin Gheorghe, Liviu Dudau,
	Alistair Strachan, Marissa Wall, David Hanna

When enabling Treble, Android builds are complaining about using
cutils/log.h so instead use log/log.h

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>
Signed-off-by: John Stultz <john.stultz@linaro.org>
---
 autolock.cpp                | 2 +-
 drmcompositorworker.cpp     | 2 +-
 drmconnector.cpp            | 2 +-
 drmcrtc.cpp                 | 2 +-
 drmdisplaycomposition.cpp   | 2 +-
 drmdisplaycompositor.cpp    | 2 +-
 drmeventlistener.cpp        | 2 +-
 drmhwctwo.cpp               | 2 +-
 drmplane.cpp                | 2 +-
 drmresources.cpp            | 2 +-
 hwcomposer.cpp              | 2 +-
 hwcutils.cpp                | 2 +-
 platform.cpp                | 2 +-
 platformdrmgeneric.cpp      | 2 +-
 platformhisi.cpp            | 2 +-
 virtualcompositorworker.cpp | 2 +-
 vsyncworker.cpp             | 2 +-
 17 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/autolock.cpp b/autolock.cpp
index 1a2ded7..795a8c2 100644
--- a/autolock.cpp
+++ b/autolock.cpp
@@ -22,7 +22,7 @@
 #include <errno.h>
 #include <pthread.h>
 
-#include <cutils/log.h>
+#include <log/log.h>
 
 namespace android {
 
diff --git a/drmcompositorworker.cpp b/drmcompositorworker.cpp
index a4e7fc9..695876d 100644
--- a/drmcompositorworker.cpp
+++ b/drmcompositorworker.cpp
@@ -22,7 +22,7 @@
 
 #include <stdlib.h>
 
-#include <cutils/log.h>
+#include <log/log.h>
 #include <hardware/hardware.h>
 
 namespace android {
diff --git a/drmconnector.cpp b/drmconnector.cpp
index 145518f..10b96b5 100644
--- a/drmconnector.cpp
+++ b/drmconnector.cpp
@@ -22,7 +22,7 @@
 #include <errno.h>
 #include <stdint.h>
 
-#include <cutils/log.h>
+#include <log/log.h>
 #include <xf86drmMode.h>
 
 namespace android {
diff --git a/drmcrtc.cpp b/drmcrtc.cpp
index 1b354fe..4033269 100644
--- a/drmcrtc.cpp
+++ b/drmcrtc.cpp
@@ -22,7 +22,7 @@
 #include <stdint.h>
 #include <xf86drmMode.h>
 
-#include <cutils/log.h>
+#include <log/log.h>
 
 namespace android {
 
diff --git a/drmdisplaycomposition.cpp b/drmdisplaycomposition.cpp
index 66e67a4..24a8e9c 100644
--- a/drmdisplaycomposition.cpp
+++ b/drmdisplaycomposition.cpp
@@ -28,7 +28,7 @@
 #include <algorithm>
 #include <unordered_set>
 
-#include <cutils/log.h>
+#include <log/log.h>
 #include <sw_sync.h>
 #include <sync/sync.h>
 #include <xf86drmMode.h>
diff --git a/drmdisplaycompositor.cpp b/drmdisplaycompositor.cpp
index e556e86..e570923 100644
--- a/drmdisplaycompositor.cpp
+++ b/drmdisplaycompositor.cpp
@@ -26,7 +26,7 @@
 #include <sstream>
 #include <vector>
 
-#include <cutils/log.h>
+#include <log/log.h>
 #include <drm/drm_mode.h>
 #include <sync/sync.h>
 #include <utils/Trace.h>
diff --git a/drmeventlistener.cpp b/drmeventlistener.cpp
index 5534182..9cdff81 100644
--- a/drmeventlistener.cpp
+++ b/drmeventlistener.cpp
@@ -24,7 +24,7 @@
 #include <linux/netlink.h>
 #include <sys/socket.h>
 
-#include <cutils/log.h>
+#include <log/log.h>
 #include <hardware/hardware.h>
 #include <hardware/hwcomposer.h>
 #include <xf86drm.h>
diff --git a/drmhwctwo.cpp b/drmhwctwo.cpp
index dfca1a6..8e00d71 100644
--- a/drmhwctwo.cpp
+++ b/drmhwctwo.cpp
@@ -26,7 +26,7 @@
 #include <inttypes.h>
 #include <string>
 
-#include <cutils/log.h>
+#include <log/log.h>
 #include <cutils/properties.h>
 #include <hardware/hardware.h>
 #include <hardware/hwcomposer2.h>
diff --git a/drmplane.cpp b/drmplane.cpp
index 1f739ae..4449256 100644
--- a/drmplane.cpp
+++ b/drmplane.cpp
@@ -23,7 +23,7 @@
 #include <errno.h>
 #include <stdint.h>
 
-#include <cutils/log.h>
+#include <log/log.h>
 #include <xf86drmMode.h>
 
 namespace android {
diff --git a/drmresources.cpp b/drmresources.cpp
index 32dd376..ec6664c 100644
--- a/drmresources.cpp
+++ b/drmresources.cpp
@@ -30,7 +30,7 @@
 #include <xf86drm.h>
 #include <xf86drmMode.h>
 
-#include <cutils/log.h>
+#include <log/log.h>
 #include <cutils/properties.h>
 
 namespace android {
diff --git a/hwcomposer.cpp b/hwcomposer.cpp
index c0aafef..338e042 100644
--- a/hwcomposer.cpp
+++ b/hwcomposer.cpp
@@ -39,7 +39,7 @@
 #include <xf86drm.h>
 #include <xf86drmMode.h>
 
-#include <cutils/log.h>
+#include <log/log.h>
 #include <cutils/properties.h>
 #include <hardware/hardware.h>
 #include <hardware/hwcomposer.h>
diff --git a/hwcutils.cpp b/hwcutils.cpp
index 53a7d82..715c93e 100644
--- a/hwcutils.cpp
+++ b/hwcutils.cpp
@@ -20,7 +20,7 @@
 #include "drmhwcomposer.h"
 #include "platform.h"
 
-#include <cutils/log.h>
+#include <log/log.h>
 
 namespace android {
 
diff --git a/platform.cpp b/platform.cpp
index 56ab37e..62b03a8 100644
--- a/platform.cpp
+++ b/platform.cpp
@@ -19,7 +19,7 @@
 #include "drmresources.h"
 #include "platform.h"
 
-#include <cutils/log.h>
+#include <log/log.h>
 
 namespace android {
 
diff --git a/platformdrmgeneric.cpp b/platformdrmgeneric.cpp
index 2a6773c..8253967 100644
--- a/platformdrmgeneric.cpp
+++ b/platformdrmgeneric.cpp
@@ -24,7 +24,7 @@
 #include <xf86drm.h>
 #include <xf86drmMode.h>
 
-#include <cutils/log.h>
+#include <log/log.h>
 #include <gralloc_handle.h>
 #include <hardware/gralloc.h>
 #include <EGL/eglext.h>
diff --git a/platformhisi.cpp b/platformhisi.cpp
index 16c5e6f..3f5c319 100644
--- a/platformhisi.cpp
+++ b/platformhisi.cpp
@@ -27,7 +27,7 @@
 #include <xf86drm.h>
 #include <xf86drmMode.h>
 
-#include <cutils/log.h>
+#include <log/log.h>
 #include <hardware/gralloc.h>
 #include "gralloc_priv.h"
 
diff --git a/virtualcompositorworker.cpp b/virtualcompositorworker.cpp
index 639dc86..b64b414 100644
--- a/virtualcompositorworker.cpp
+++ b/virtualcompositorworker.cpp
@@ -22,7 +22,7 @@
 #include <errno.h>
 #include <stdlib.h>
 
-#include <cutils/log.h>
+#include <log/log.h>
 #include <hardware/hardware.h>
 #include <hardware/hwcomposer.h>
 #include <sched.h>
diff --git a/vsyncworker.cpp b/vsyncworker.cpp
index 3bfe4be..d431d2e 100644
--- a/vsyncworker.cpp
+++ b/vsyncworker.cpp
@@ -26,7 +26,7 @@
 #include <xf86drm.h>
 #include <xf86drmMode.h>
 
-#include <cutils/log.h>
+#include <log/log.h>
 #include <hardware/hardware.h>
 
 namespace android {
-- 
2.7.4

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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH hwc 3/4] drm_hwcomposer: Cleanup gl precompositor init and provide uses_GL flag
  2018-04-26 19:05 [PATCH hwc 1/4] drm_hwcomposer: Andorid.mk : Mark libdrmhwc_utils as vendor module John Stultz
  2018-04-26 19:05 ` [PATCH hwc 2/4] drm_hwcomposer: Use log/log.h instead of cutils/log.h John Stultz
@ 2018-04-26 19:05 ` John Stultz
  2018-04-26 19:43   ` Robert Foss
  2018-04-26 19:05 ` [PATCH hwc 4/4] drm_hwcomposer: Fall back to client compositon if the gl precompostior fails John Stultz
  2018-04-26 19:32 ` [PATCH hwc 1/4] drm_hwcomposer: Andorid.mk : Mark libdrmhwc_utils as vendor module Robert Foss
  3 siblings, 1 reply; 8+ messages in thread
From: John Stultz @ 2018-04-26 19:05 UTC (permalink / raw)
  To: dri-devel
  Cc: Rob Herring, Matt Szczesiak, Dmitry Shmidt, Sean Paul,
	Robert Foss, Alexandru-Cosmin Gheorghe, Liviu Dudau,
	Alistair Strachan, Marissa Wall, David Hanna

The drm_hwcomposer has its own GL pre-compositor which is used
to squish layers when there are more layers then planes on the
display hardware. In many ways this duplicates the client-side
GL compositing that is done in SurfaceFlinger, but in theory can
be more highly optimized for the hardware.

Unfortunately, due to these optimizations, the drm_hwcomposer's
pre-compositor becomes somewhat hardware specific (originally
targeting nvidia hardware, I believe).

So on some hardware, the gl precompositor may not actually
initialize due to hardware missing features, or the hardware
supporting different shader APIs.

Rather then try to rework the drm_hwcomposers precompositor
to be more generic, I instead suggest that when the
precompositor fails to initialize, we simply fall back to the
already more widely compatible client compositor in
SurfaceFlinger.

Thus, this patch cleans up some of the precompositor
initialization, which didn't handle failures well.

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>
---
 drmdisplaycompositor.cpp | 40 +++++++++++++++++++++-------------------
 drmdisplaycompositor.h   |  3 +++
 2 files changed, 24 insertions(+), 19 deletions(-)

diff --git a/drmdisplaycompositor.cpp b/drmdisplaycompositor.cpp
index e570923..40af3be 100644
--- a/drmdisplaycompositor.cpp
+++ b/drmdisplaycompositor.cpp
@@ -222,6 +222,13 @@ int DrmDisplayCompositor::Init(DrmResources *drm, int display) {
     return ret;
   }
 
+  pre_compositor_.reset(new GLWorkerCompositor());
+  ret = pre_compositor_->Init();
+  if (ret) {
+    ALOGE("Failed to initialize OpenGL compositor %d", ret);
+    pre_compositor_.reset();
+  }
+
   initialized_ = true;
   return 0;
 }
@@ -294,14 +301,16 @@ int DrmDisplayCompositor::ApplySquash(DrmDisplayComposition *display_comp) {
   }
 
   std::vector<DrmCompositionRegion> &regions = display_comp->squash_regions();
-  ret = pre_compositor_->Composite(display_comp->layers().data(),
+  if (pre_compositor_) {
+    ret = pre_compositor_->Composite(display_comp->layers().data(),
                                    regions.data(), regions.size(), fb.buffer(),
                                    display_comp->importer());
-  pre_compositor_->Finish();
+    pre_compositor_->Finish();
 
-  if (ret) {
-    ALOGE("Failed to squash layers");
-    return ret;
+    if (ret) {
+      ALOGE("Failed to squash layers");
+      return ret;
+    }
   }
 
   ret = display_comp->CreateNextTimelineFence();
@@ -328,14 +337,16 @@ int DrmDisplayCompositor::ApplyPreComposite(
   }
 
   std::vector<DrmCompositionRegion> &regions = display_comp->pre_comp_regions();
-  ret = pre_compositor_->Composite(display_comp->layers().data(),
+  if (pre_compositor_) {
+    ret = pre_compositor_->Composite(display_comp->layers().data(),
                                    regions.data(), regions.size(), fb.buffer(),
                                    display_comp->importer());
-  pre_compositor_->Finish();
+    pre_compositor_->Finish();
 
-  if (ret) {
-    ALOGE("Failed to pre-composite layers");
-    return ret;
+    if (ret) {
+      ALOGE("Failed to pre-composite layers");
+      return ret;
+    }
   }
 
   ret = display_comp->CreateNextTimelineFence();
@@ -395,15 +406,6 @@ int DrmDisplayCompositor::PrepareFrame(DrmDisplayComposition *display_comp) {
   std::vector<DrmCompositionRegion> &pre_comp_regions =
       display_comp->pre_comp_regions();
 
-  if (!pre_compositor_) {
-    pre_compositor_.reset(new GLWorkerCompositor());
-    int ret = pre_compositor_->Init();
-    if (ret) {
-      ALOGE("Failed to initialize OpenGL compositor %d", ret);
-      return ret;
-    }
-  }
-
   int squash_layer_index = -1;
   if (squash_regions.size() > 0) {
     squash_framebuffer_index_ = (squash_framebuffer_index_ + 1) % 2;
diff --git a/drmdisplaycompositor.h b/drmdisplaycompositor.h
index f1965fb..ed6c5f9 100644
--- a/drmdisplaycompositor.h
+++ b/drmdisplaycompositor.h
@@ -98,6 +98,9 @@ class DrmDisplayCompositor {
     return &squash_state_;
   }
 
+  bool uses_GL() {
+    return !!pre_compositor_;
+  }
  private:
   struct ModeState {
     bool needs_modeset = false;
-- 
2.7.4

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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH hwc 4/4] drm_hwcomposer: Fall back to client compositon if the gl precompostior fails
  2018-04-26 19:05 [PATCH hwc 1/4] drm_hwcomposer: Andorid.mk : Mark libdrmhwc_utils as vendor module John Stultz
  2018-04-26 19:05 ` [PATCH hwc 2/4] drm_hwcomposer: Use log/log.h instead of cutils/log.h John Stultz
  2018-04-26 19:05 ` [PATCH hwc 3/4] drm_hwcomposer: Cleanup gl precompositor init and provide uses_GL flag John Stultz
@ 2018-04-26 19:05 ` John Stultz
  2018-04-27 12:17   ` Robert Foss
  2018-04-26 19:32 ` [PATCH hwc 1/4] drm_hwcomposer: Andorid.mk : Mark libdrmhwc_utils as vendor module Robert Foss
  3 siblings, 1 reply; 8+ messages in thread
From: John Stultz @ 2018-04-26 19:05 UTC (permalink / raw)
  To: dri-devel
  Cc: Rob Herring, Matt Szczesiak, Dmitry Shmidt, Sean Paul,
	Robert Foss, Alexandru-Cosmin Gheorghe, Liviu Dudau,
	Alistair Strachan, Marissa Wall, David Hanna

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;
-- 
2.7.4

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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH hwc 1/4] drm_hwcomposer: Andorid.mk : Mark libdrmhwc_utils as vendor module
  2018-04-26 19:05 [PATCH hwc 1/4] drm_hwcomposer: Andorid.mk : Mark libdrmhwc_utils as vendor module John Stultz
                   ` (2 preceding siblings ...)
  2018-04-26 19:05 ` [PATCH hwc 4/4] drm_hwcomposer: Fall back to client compositon if the gl precompostior fails John Stultz
@ 2018-04-26 19:32 ` Robert Foss
  3 siblings, 0 replies; 8+ messages in thread
From: Robert Foss @ 2018-04-26 19:32 UTC (permalink / raw)
  To: John Stultz, dri-devel
  Cc: Rob Herring, Matt Szczesiak, Dmitry Shmidt, Sean Paul,
	Alexandru-Cosmin Gheorghe, Liviu Dudau, Alistair Strachan,
	Marissa Wall, David Hanna

This patch is:
Acked-by: Robert Foss <robert.foss@collabora.com>

On 04/26/2018 09:05 PM, John Stultz wrote:
> From: Sumit Semwal <sumit.semwal@linaro.org>
> 
> To allow drm_hwcomposer to build with Treble, set
> the libdrmhwc_utils library as a vendor module.
> 
> 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>
> Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
> [jstultz: commit message tweaks]
> Signed-off-by: John Stultz <john.stultz@linaro.org>
> ---
>   Android.mk | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/Android.mk b/Android.mk
> index 1add286..a60d112 100644
> --- a/Android.mk
> +++ b/Android.mk
> @@ -25,6 +25,7 @@ LOCAL_SRC_FILES := \
>   	worker.cpp
>   
>   LOCAL_MODULE := libdrmhwc_utils
> +LOCAL_VENDOR_MODULE := true
>   
>   include $(BUILD_STATIC_LIBRARY)
>   
> 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH hwc 2/4] drm_hwcomposer: Use log/log.h instead of cutils/log.h
  2018-04-26 19:05 ` [PATCH hwc 2/4] drm_hwcomposer: Use log/log.h instead of cutils/log.h John Stultz
@ 2018-04-26 19:34   ` Robert Foss
  0 siblings, 0 replies; 8+ messages in thread
From: Robert Foss @ 2018-04-26 19:34 UTC (permalink / raw)
  To: John Stultz, dri-devel
  Cc: Rob Herring, Matt Szczesiak, Dmitry Shmidt, Sean Paul,
	Alexandru-Cosmin Gheorghe, Liviu Dudau, Alistair Strachan,
	Marissa Wall, David Hanna

This patch is:
Acked-by: Robert Foss <robert.foss@collabora.com>


On 04/26/2018 09:05 PM, John Stultz wrote:
> When enabling Treble, Android builds are complaining about using
> cutils/log.h so instead use log/log.h
> 
> 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>
> Signed-off-by: John Stultz <john.stultz@linaro.org>
> ---
>   autolock.cpp                | 2 +-
>   drmcompositorworker.cpp     | 2 +-
>   drmconnector.cpp            | 2 +-
>   drmcrtc.cpp                 | 2 +-
>   drmdisplaycomposition.cpp   | 2 +-
>   drmdisplaycompositor.cpp    | 2 +-
>   drmeventlistener.cpp        | 2 +-
>   drmhwctwo.cpp               | 2 +-
>   drmplane.cpp                | 2 +-
>   drmresources.cpp            | 2 +-
>   hwcomposer.cpp              | 2 +-
>   hwcutils.cpp                | 2 +-
>   platform.cpp                | 2 +-
>   platformdrmgeneric.cpp      | 2 +-
>   platformhisi.cpp            | 2 +-
>   virtualcompositorworker.cpp | 2 +-
>   vsyncworker.cpp             | 2 +-
>   17 files changed, 17 insertions(+), 17 deletions(-)
> 
> diff --git a/autolock.cpp b/autolock.cpp
> index 1a2ded7..795a8c2 100644
> --- a/autolock.cpp
> +++ b/autolock.cpp
> @@ -22,7 +22,7 @@
>   #include <errno.h>
>   #include <pthread.h>
>   
> -#include <cutils/log.h>
> +#include <log/log.h>
>   
>   namespace android {
>   
> diff --git a/drmcompositorworker.cpp b/drmcompositorworker.cpp
> index a4e7fc9..695876d 100644
> --- a/drmcompositorworker.cpp
> +++ b/drmcompositorworker.cpp
> @@ -22,7 +22,7 @@
>   
>   #include <stdlib.h>
>   
> -#include <cutils/log.h>
> +#include <log/log.h>
>   #include <hardware/hardware.h>
>   
>   namespace android {
> diff --git a/drmconnector.cpp b/drmconnector.cpp
> index 145518f..10b96b5 100644
> --- a/drmconnector.cpp
> +++ b/drmconnector.cpp
> @@ -22,7 +22,7 @@
>   #include <errno.h>
>   #include <stdint.h>
>   
> -#include <cutils/log.h>
> +#include <log/log.h>
>   #include <xf86drmMode.h>
>   
>   namespace android {
> diff --git a/drmcrtc.cpp b/drmcrtc.cpp
> index 1b354fe..4033269 100644
> --- a/drmcrtc.cpp
> +++ b/drmcrtc.cpp
> @@ -22,7 +22,7 @@
>   #include <stdint.h>
>   #include <xf86drmMode.h>
>   
> -#include <cutils/log.h>
> +#include <log/log.h>
>   
>   namespace android {
>   
> diff --git a/drmdisplaycomposition.cpp b/drmdisplaycomposition.cpp
> index 66e67a4..24a8e9c 100644
> --- a/drmdisplaycomposition.cpp
> +++ b/drmdisplaycomposition.cpp
> @@ -28,7 +28,7 @@
>   #include <algorithm>
>   #include <unordered_set>
>   
> -#include <cutils/log.h>
> +#include <log/log.h>
>   #include <sw_sync.h>
>   #include <sync/sync.h>
>   #include <xf86drmMode.h>
> diff --git a/drmdisplaycompositor.cpp b/drmdisplaycompositor.cpp
> index e556e86..e570923 100644
> --- a/drmdisplaycompositor.cpp
> +++ b/drmdisplaycompositor.cpp
> @@ -26,7 +26,7 @@
>   #include <sstream>
>   #include <vector>
>   
> -#include <cutils/log.h>
> +#include <log/log.h>
>   #include <drm/drm_mode.h>
>   #include <sync/sync.h>
>   #include <utils/Trace.h>
> diff --git a/drmeventlistener.cpp b/drmeventlistener.cpp
> index 5534182..9cdff81 100644
> --- a/drmeventlistener.cpp
> +++ b/drmeventlistener.cpp
> @@ -24,7 +24,7 @@
>   #include <linux/netlink.h>
>   #include <sys/socket.h>
>   
> -#include <cutils/log.h>
> +#include <log/log.h>
>   #include <hardware/hardware.h>
>   #include <hardware/hwcomposer.h>
>   #include <xf86drm.h>
> diff --git a/drmhwctwo.cpp b/drmhwctwo.cpp
> index dfca1a6..8e00d71 100644
> --- a/drmhwctwo.cpp
> +++ b/drmhwctwo.cpp
> @@ -26,7 +26,7 @@
>   #include <inttypes.h>
>   #include <string>
>   
> -#include <cutils/log.h>
> +#include <log/log.h>
>   #include <cutils/properties.h>
>   #include <hardware/hardware.h>
>   #include <hardware/hwcomposer2.h>
> diff --git a/drmplane.cpp b/drmplane.cpp
> index 1f739ae..4449256 100644
> --- a/drmplane.cpp
> +++ b/drmplane.cpp
> @@ -23,7 +23,7 @@
>   #include <errno.h>
>   #include <stdint.h>
>   
> -#include <cutils/log.h>
> +#include <log/log.h>
>   #include <xf86drmMode.h>
>   
>   namespace android {
> diff --git a/drmresources.cpp b/drmresources.cpp
> index 32dd376..ec6664c 100644
> --- a/drmresources.cpp
> +++ b/drmresources.cpp
> @@ -30,7 +30,7 @@
>   #include <xf86drm.h>
>   #include <xf86drmMode.h>
>   
> -#include <cutils/log.h>
> +#include <log/log.h>
>   #include <cutils/properties.h>
>   
>   namespace android {
> diff --git a/hwcomposer.cpp b/hwcomposer.cpp
> index c0aafef..338e042 100644
> --- a/hwcomposer.cpp
> +++ b/hwcomposer.cpp
> @@ -39,7 +39,7 @@
>   #include <xf86drm.h>
>   #include <xf86drmMode.h>
>   
> -#include <cutils/log.h>
> +#include <log/log.h>
>   #include <cutils/properties.h>
>   #include <hardware/hardware.h>
>   #include <hardware/hwcomposer.h>
> diff --git a/hwcutils.cpp b/hwcutils.cpp
> index 53a7d82..715c93e 100644
> --- a/hwcutils.cpp
> +++ b/hwcutils.cpp
> @@ -20,7 +20,7 @@
>   #include "drmhwcomposer.h"
>   #include "platform.h"
>   
> -#include <cutils/log.h>
> +#include <log/log.h>
>   
>   namespace android {
>   
> diff --git a/platform.cpp b/platform.cpp
> index 56ab37e..62b03a8 100644
> --- a/platform.cpp
> +++ b/platform.cpp
> @@ -19,7 +19,7 @@
>   #include "drmresources.h"
>   #include "platform.h"
>   
> -#include <cutils/log.h>
> +#include <log/log.h>
>   
>   namespace android {
>   
> diff --git a/platformdrmgeneric.cpp b/platformdrmgeneric.cpp
> index 2a6773c..8253967 100644
> --- a/platformdrmgeneric.cpp
> +++ b/platformdrmgeneric.cpp
> @@ -24,7 +24,7 @@
>   #include <xf86drm.h>
>   #include <xf86drmMode.h>
>   
> -#include <cutils/log.h>
> +#include <log/log.h>
>   #include <gralloc_handle.h>
>   #include <hardware/gralloc.h>
>   #include <EGL/eglext.h>
> diff --git a/platformhisi.cpp b/platformhisi.cpp
> index 16c5e6f..3f5c319 100644
> --- a/platformhisi.cpp
> +++ b/platformhisi.cpp
> @@ -27,7 +27,7 @@
>   #include <xf86drm.h>
>   #include <xf86drmMode.h>
>   
> -#include <cutils/log.h>
> +#include <log/log.h>
>   #include <hardware/gralloc.h>
>   #include "gralloc_priv.h"
>   
> diff --git a/virtualcompositorworker.cpp b/virtualcompositorworker.cpp
> index 639dc86..b64b414 100644
> --- a/virtualcompositorworker.cpp
> +++ b/virtualcompositorworker.cpp
> @@ -22,7 +22,7 @@
>   #include <errno.h>
>   #include <stdlib.h>
>   
> -#include <cutils/log.h>
> +#include <log/log.h>
>   #include <hardware/hardware.h>
>   #include <hardware/hwcomposer.h>
>   #include <sched.h>
> diff --git a/vsyncworker.cpp b/vsyncworker.cpp
> index 3bfe4be..d431d2e 100644
> --- a/vsyncworker.cpp
> +++ b/vsyncworker.cpp
> @@ -26,7 +26,7 @@
>   #include <xf86drm.h>
>   #include <xf86drmMode.h>
>   
> -#include <cutils/log.h>
> +#include <log/log.h>
>   #include <hardware/hardware.h>
>   
>   namespace android {
> 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH hwc 3/4] drm_hwcomposer: Cleanup gl precompositor init and provide uses_GL flag
  2018-04-26 19:05 ` [PATCH hwc 3/4] drm_hwcomposer: Cleanup gl precompositor init and provide uses_GL flag John Stultz
@ 2018-04-26 19:43   ` Robert Foss
  0 siblings, 0 replies; 8+ messages in thread
From: Robert Foss @ 2018-04-26 19:43 UTC (permalink / raw)
  To: John Stultz, dri-devel
  Cc: Rob Herring, Matt Szczesiak, Dmitry Shmidt, Sean Paul,
	Alexandru-Cosmin Gheorghe, Liviu Dudau, Alistair Strachan,
	Marissa Wall, David Hanna

This patch is:
Acked-by: Robert Foss <robert.foss@collabora.com>


On 04/26/2018 09:05 PM, John Stultz wrote:
> The drm_hwcomposer has its own GL pre-compositor which is used
> to squish layers when there are more layers then planes on the
> display hardware. In many ways this duplicates the client-side
> GL compositing that is done in SurfaceFlinger, but in theory can
> be more highly optimized for the hardware.
> 
> Unfortunately, due to these optimizations, the drm_hwcomposer's
> pre-compositor becomes somewhat hardware specific (originally
> targeting nvidia hardware, I believe).
> 
> So on some hardware, the gl precompositor may not actually
> initialize due to hardware missing features, or the hardware
> supporting different shader APIs.
> 
> Rather then try to rework the drm_hwcomposers precompositor
> to be more generic, I instead suggest that when the
> precompositor fails to initialize, we simply fall back to the
> already more widely compatible client compositor in
> SurfaceFlinger.
> 
> Thus, this patch cleans up some of the precompositor
> initialization, which didn't handle failures well.
> 
> 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>
> ---
>   drmdisplaycompositor.cpp | 40 +++++++++++++++++++++-------------------
>   drmdisplaycompositor.h   |  3 +++
>   2 files changed, 24 insertions(+), 19 deletions(-)
> 
> diff --git a/drmdisplaycompositor.cpp b/drmdisplaycompositor.cpp
> index e570923..40af3be 100644
> --- a/drmdisplaycompositor.cpp
> +++ b/drmdisplaycompositor.cpp
> @@ -222,6 +222,13 @@ int DrmDisplayCompositor::Init(DrmResources *drm, int display) {
>       return ret;
>     }
>   
> +  pre_compositor_.reset(new GLWorkerCompositor());
> +  ret = pre_compositor_->Init();
> +  if (ret) {
> +    ALOGE("Failed to initialize OpenGL compositor %d", ret);
> +    pre_compositor_.reset();
> +  }
> +
>     initialized_ = true;
>     return 0;
>   }
> @@ -294,14 +301,16 @@ int DrmDisplayCompositor::ApplySquash(DrmDisplayComposition *display_comp) {
>     }
>   
>     std::vector<DrmCompositionRegion> &regions = display_comp->squash_regions();
> -  ret = pre_compositor_->Composite(display_comp->layers().data(),
> +  if (pre_compositor_) {
> +    ret = pre_compositor_->Composite(display_comp->layers().data(),
>                                      regions.data(), regions.size(), fb.buffer(),
>                                      display_comp->importer());
> -  pre_compositor_->Finish();
> +    pre_compositor_->Finish();
>   
> -  if (ret) {
> -    ALOGE("Failed to squash layers");
> -    return ret;
> +    if (ret) {
> +      ALOGE("Failed to squash layers");
> +      return ret;
> +    }
>     }
>   
>     ret = display_comp->CreateNextTimelineFence();
> @@ -328,14 +337,16 @@ int DrmDisplayCompositor::ApplyPreComposite(
>     }
>   
>     std::vector<DrmCompositionRegion> &regions = display_comp->pre_comp_regions();
> -  ret = pre_compositor_->Composite(display_comp->layers().data(),
> +  if (pre_compositor_) {
> +    ret = pre_compositor_->Composite(display_comp->layers().data(),
>                                      regions.data(), regions.size(), fb.buffer(),
>                                      display_comp->importer());
> -  pre_compositor_->Finish();
> +    pre_compositor_->Finish();
>   
> -  if (ret) {
> -    ALOGE("Failed to pre-composite layers");
> -    return ret;
> +    if (ret) {
> +      ALOGE("Failed to pre-composite layers");
> +      return ret;
> +    }
>     }
>   
>     ret = display_comp->CreateNextTimelineFence();
> @@ -395,15 +406,6 @@ int DrmDisplayCompositor::PrepareFrame(DrmDisplayComposition *display_comp) {
>     std::vector<DrmCompositionRegion> &pre_comp_regions =
>         display_comp->pre_comp_regions();
>   
> -  if (!pre_compositor_) {
> -    pre_compositor_.reset(new GLWorkerCompositor());
> -    int ret = pre_compositor_->Init();
> -    if (ret) {
> -      ALOGE("Failed to initialize OpenGL compositor %d", ret);
> -      return ret;
> -    }
> -  }
> -
>     int squash_layer_index = -1;
>     if (squash_regions.size() > 0) {
>       squash_framebuffer_index_ = (squash_framebuffer_index_ + 1) % 2;
> diff --git a/drmdisplaycompositor.h b/drmdisplaycompositor.h
> index f1965fb..ed6c5f9 100644
> --- a/drmdisplaycompositor.h
> +++ b/drmdisplaycompositor.h
> @@ -98,6 +98,9 @@ class DrmDisplayCompositor {
>       return &squash_state_;
>     }
>   
> +  bool uses_GL() {
> +    return !!pre_compositor_;
> +  }
>    private:
>     struct ModeState {
>       bool needs_modeset = false;
> 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH hwc 4/4] drm_hwcomposer: Fall back to client compositon if the gl precompostior fails
  2018-04-26 19:05 ` [PATCH hwc 4/4] drm_hwcomposer: Fall back to client compositon if the gl precompostior fails John Stultz
@ 2018-04-27 12:17   ` Robert Foss
  0 siblings, 0 replies; 8+ messages in thread
From: Robert Foss @ 2018-04-27 12:17 UTC (permalink / raw)
  To: John Stultz, dri-devel
  Cc: Rob Herring, Matt Szczesiak, Dmitry Shmidt, Sean Paul,
	Alexandru-Cosmin Gheorghe, Liviu Dudau, Alistair Strachan,
	Marissa Wall, David Hanna

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;
> 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-04-27 12:17 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-26 19:05 [PATCH hwc 1/4] drm_hwcomposer: Andorid.mk : Mark libdrmhwc_utils as vendor module John Stultz
2018-04-26 19:05 ` [PATCH hwc 2/4] drm_hwcomposer: Use log/log.h instead of cutils/log.h John Stultz
2018-04-26 19:34   ` Robert Foss
2018-04-26 19:05 ` [PATCH hwc 3/4] drm_hwcomposer: Cleanup gl precompositor init and provide uses_GL flag John Stultz
2018-04-26 19:43   ` Robert Foss
2018-04-26 19:05 ` [PATCH hwc 4/4] drm_hwcomposer: Fall back to client compositon if the gl precompostior fails John Stultz
2018-04-27 12:17   ` Robert Foss
2018-04-26 19:32 ` [PATCH hwc 1/4] drm_hwcomposer: Andorid.mk : Mark libdrmhwc_utils as vendor module Robert Foss

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.