Skip to contentSkip to conversation

drm_hwcomposer: Andorid.mk : Mark libdrmhwc_utils as vendor module

PATCH In review John Stultz 2 participants 8 messages Apr 26, 2018 – Apr 27, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 drm_hwcomposer: Andorid.mk : Mark libdrmhwc_utils as vendor module

From: Sumit Semwal <[email protected]>

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

Cc Marissa Wall <[email protected]>
Cc Sean Paul <[email protected]>
Cc Dmitry Shmidt <[email protected]>
Cc Robert Foss <[email protected]>
Cc Matt Szczesiak <[email protected]>
Cc Liviu Dudau <[email protected]>
Cc David Hanna <[email protected]>
Cc Rob Herring <[email protected]>
Cc Alexandru-Cosmin Gheorghe <[email protected]>
Cc Alistair Strachan <[email protected]>
[jstultz: commit message tweaks]
---
 Android.mk | 1 +
 1 file changed, 1 insertion(+)
Android.mk +1 -0
index 1add286..a60d112 100644
@@ -25,6 +25,7 @@ LOCAL_SRC_FILES := \
 	worker.cpp
 
 LOCAL_MODULE := libdrmhwc_utils
+LOCAL_VENDOR_MODULE := true
 
 include $(BUILD_STATIC_LIBRARY)
 
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw

PATCH 2/4 drm_hwcomposer: Use log/log.h instead of cutils/log.h

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

Cc Marissa Wall <[email protected]>
Cc Sean Paul <[email protected]>
Cc Dmitry Shmidt <[email protected]>
Cc Robert Foss <[email protected]>
Cc Matt Szczesiak <[email protected]>
Cc Liviu Dudau <[email protected]>
Cc David Hanna <[email protected]>
Cc Rob Herring <[email protected]>
Cc Alexandru-Cosmin Gheorghe <[email protected]>
Cc Alistair Strachan <[email protected]>
---
 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(-)
autolock.cpp +1 -1
index 1a2ded7..795a8c2 100644
@@ -22,7 +22,7 @@
 #include <errno.h>
 #include <pthread.h>
 
-#include <cutils/log.h>
+#include <log/log.h>
 
 namespace android {
 
drmcompositorworker.cpp +1 -1
index a4e7fc9..695876d 100644
@@ -22,7 +22,7 @@
 
 #include <stdlib.h>
 
-#include <cutils/log.h>
+#include <log/log.h>
 #include <hardware/hardware.h>
 
 namespace android {
drmconnector.cpp +1 -1
index 145518f..10b96b5 100644
@@ -22,7 +22,7 @@
 #include <errno.h>
 #include <stdint.h>
 
-#include <cutils/log.h>
+#include <log/log.h>
 #include <xf86drmMode.h>
 
 namespace android {
drmcrtc.cpp +1 -1
index 1b354fe..4033269 100644
@@ -22,7 +22,7 @@
 #include <stdint.h>
 #include <xf86drmMode.h>
 
-#include <cutils/log.h>
+#include <log/log.h>
 
 namespace android {
 
drmdisplaycomposition.cpp +1 -1
index 66e67a4..24a8e9c 100644
@@ -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>
drmdisplaycompositor.cpp +1 -1
index e556e86..e570923 100644
@@ -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>
drmeventlistener.cpp +1 -1
index 5534182..9cdff81 100644
@@ -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>
drmhwctwo.cpp +1 -1
index dfca1a6..8e00d71 100644
@@ -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>
drmplane.cpp +1 -1
index 1f739ae..4449256 100644
@@ -23,7 +23,7 @@
 #include <errno.h>
 #include <stdint.h>
 
-#include <cutils/log.h>
+#include <log/log.h>
 #include <xf86drmMode.h>
 
 namespace android {
drmresources.cpp +1 -1
index 32dd376..ec6664c 100644
@@ -30,7 +30,7 @@
 #include <xf86drm.h>
 #include <xf86drmMode.h>
 
-#include <cutils/log.h>
+#include <log/log.h>
 #include <cutils/properties.h>
 
 namespace android {
hwcomposer.cpp +1 -1
index c0aafef..338e042 100644
@@ -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>
hwcutils.cpp +1 -1
index 53a7d82..715c93e 100644
@@ -20,7 +20,7 @@
 #include "drmhwcomposer.h"
 #include "platform.h"
 
-#include <cutils/log.h>
+#include <log/log.h>
 
 namespace android {
 
platform.cpp +1 -1
index 56ab37e..62b03a8 100644
@@ -19,7 +19,7 @@
 #include "drmresources.h"
 #include "platform.h"
 
-#include <cutils/log.h>
+#include <log/log.h>
 
 namespace android {
 
platformdrmgeneric.cpp +1 -1
index 2a6773c..8253967 100644
@@ -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>
platformhisi.cpp +1 -1
index 16c5e6f..3f5c319 100644
@@ -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"
 
virtualcompositorworker.cpp +1 -1
index 639dc86..b64b414 100644
@@ -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>
vsyncworker.cpp +1 -1
index 3bfe4be..d431d2e 100644
@@ -26,7 +26,7 @@
 #include <xf86drm.h>
 #include <xf86drmMode.h>
 
-#include <cutils/log.h>
+#include <log/log.h>
 #include <hardware/hardware.h>
 
 namespace android {
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Acked-by on v1 2/4
#2 lore raw

Re: [PATCH hwc 2/4] drm_hwcomposer: Use log/log.h instead of cutils/log.h

This patch is:

Quoted 248 lines · John Stultz

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

Cc Marissa Wall <[email protected]>
Cc Sean Paul <[email protected]>
Cc Dmitry Shmidt <[email protected]>
Cc Robert Foss <[email protected]>
Cc Matt Szczesiak <[email protected]>
Cc Liviu Dudau <[email protected]>
Cc David Hanna <[email protected]>
Cc Rob Herring <[email protected]>
Cc Alexandru-Cosmin Gheorghe <[email protected]>
Cc Alistair Strachan <[email protected]>
---
  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(-)
autolock.cpp +1 -1
index 1a2ded7..795a8c2 100644
@@ -22,7 +22,7 @@
  #include <errno.h>
  #include <pthread.h>
 
-#include <cutils/log.h>
+#include <log/log.h>
 
  namespace android {
 
drmcompositorworker.cpp +1 -1
index a4e7fc9..695876d 100644
@@ -22,7 +22,7 @@
 
  #include <stdlib.h>
 
-#include <cutils/log.h>
+#include <log/log.h>
  #include <hardware/hardware.h>
 
  namespace android {
drmconnector.cpp +1 -1
index 145518f..10b96b5 100644
@@ -22,7 +22,7 @@
  #include <errno.h>
  #include <stdint.h>
 
-#include <cutils/log.h>
+#include <log/log.h>
  #include <xf86drmMode.h>
 
  namespace android {
drmcrtc.cpp +1 -1
index 1b354fe..4033269 100644
@@ -22,7 +22,7 @@
  #include <stdint.h>
  #include <xf86drmMode.h>
 
-#include <cutils/log.h>
+#include <log/log.h>
 
  namespace android {
 
drmdisplaycomposition.cpp +1 -1
index 66e67a4..24a8e9c 100644
@@ -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>
drmdisplaycompositor.cpp +1 -1
index e556e86..e570923 100644
@@ -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>
drmeventlistener.cpp +1 -1
index 5534182..9cdff81 100644
@@ -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>
drmhwctwo.cpp +1 -1
index dfca1a6..8e00d71 100644
@@ -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>
drmplane.cpp +1 -1
index 1f739ae..4449256 100644
@@ -23,7 +23,7 @@
  #include <errno.h>
  #include <stdint.h>
 
-#include <cutils/log.h>
+#include <log/log.h>
  #include <xf86drmMode.h>
 
  namespace android {
drmresources.cpp +1 -1
index 32dd376..ec6664c 100644
@@ -30,7 +30,7 @@
  #include <xf86drm.h>
  #include <xf86drmMode.h>
 
-#include <cutils/log.h>
+#include <log/log.h>
  #include <cutils/properties.h>
 
  namespace android {
hwcomposer.cpp +1 -1
index c0aafef..338e042 100644
@@ -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>
hwcutils.cpp +1 -1
index 53a7d82..715c93e 100644
@@ -20,7 +20,7 @@
  #include "drmhwcomposer.h"
  #include "platform.h"
 
-#include <cutils/log.h>
+#include <log/log.h>
 
  namespace android {
 
platform.cpp +1 -1
index 56ab37e..62b03a8 100644
@@ -19,7 +19,7 @@
  #include "drmresources.h"
  #include "platform.h"
 
-#include <cutils/log.h>
+#include <log/log.h>
 
  namespace android {
 
platformdrmgeneric.cpp +1 -1
index 2a6773c..8253967 100644
@@ -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>
platformhisi.cpp +1 -1
index 16c5e6f..3f5c319 100644
@@ -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"
 
virtualcompositorworker.cpp +1 -1
index 639dc86..b64b414 100644
@@ -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>
vsyncworker.cpp +0 -0
index 3bfe4be..d431d2e 100644

vsyncworker.cpp line 32

Quoted 8 lines
vsyncworker.cpp +1 -1
@@ -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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw

PATCH 3/4 drm_hwcomposer: Cleanup gl precompositor init and provide uses_GL flag

In reply to John Stultz

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 <[email protected]>
Cc Sean Paul <[email protected]>
Cc Dmitry Shmidt <[email protected]>
Cc Robert Foss <[email protected]>
Cc Matt Szczesiak <[email protected]>
Cc Liviu Dudau <[email protected]>
Cc David Hanna <[email protected]>
Cc Rob Herring <[email protected]>
Cc Alexandru-Cosmin Gheorghe <[email protected]>
Cc Alistair Strachan <[email protected]>
---
 drmdisplaycompositor.cpp | 40 +++++++++++++++++++++-------------------
 drmdisplaycompositor.h   |  3 +++
 2 files changed, 24 insertions(+), 19 deletions(-)
drmdisplaycompositor.cpp +21 -19
index e570923..40af3be 100644
@@ -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;
drmdisplaycompositor.h +3 -0
index f1965fb..ed6c5f9 100644
@@ -98,6 +98,9 @@ class DrmDisplayCompositor {
     return &squash_state_;
   }
 
+  bool uses_GL() {
+    return !!pre_compositor_;
+  }
  private:
   struct ModeState {
     bool needs_modeset = false;
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Acked-by on v1 3/4
#4 lore raw

Re: [PATCH hwc 3/4] drm_hwcomposer: Cleanup gl precompositor init and provide uses_GL flag

This patch is:

Quoted 124 lines · John Stultz

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 <[email protected]>
Cc Sean Paul <[email protected]>
Cc Dmitry Shmidt <[email protected]>
Cc Robert Foss <[email protected]>
Cc Matt Szczesiak <[email protected]>
Cc Liviu Dudau <[email protected]>
Cc David Hanna <[email protected]>
Cc Rob Herring <[email protected]>
Cc Alexandru-Cosmin Gheorghe <[email protected]>
Cc Alistair Strachan <[email protected]>
---
  drmdisplaycompositor.cpp | 40 +++++++++++++++++++++-------------------
  drmdisplaycompositor.h   |  3 +++
  2 files changed, 24 insertions(+), 19 deletions(-)
drmdisplaycompositor.cpp +21 -19
index e570923..40af3be 100644
@@ -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;
drmdisplaycompositor.h +0 -0
index f1965fb..ed6c5f9 100644

drmdisplaycompositor.h class DrmDisplayCompositor { · line 106

Quoted 9 lines
drmdisplaycompositor.h +3 -0
@@ -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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#5 lore raw

PATCH 4/4 drm_hwcomposer: Fall back to client compositon if the gl precompostior fails

In reply to John Stultz

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 <[email protected]>
Cc Sean Paul <[email protected]>
Cc Dmitry Shmidt <[email protected]>
Cc Robert Foss <[email protected]>
Cc Matt Szczesiak <[email protected]>
Cc Liviu Dudau <[email protected]>
Cc David Hanna <[email protected]>
Cc Rob Herring <[email protected]>
Cc Alexandru-Cosmin Gheorghe <[email protected]>
Cc Alistair Strachan <[email protected]>

---
v2:
* Dropped misguided attempt to trivially allocate layers to planes

---
 drmhwctwo.cpp | 7 +++++++
 1 file changed, 7 insertions(+)
drmhwctwo.cpp +7 -0
index 8e00d71..ede75e0 100644
@@ -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;
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Acked-by on v1 4/4
#6 lore raw

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

This patch is:

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

Quoted 42 lines · John Stultz

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 <[email protected]>
Cc Sean Paul <[email protected]>
Cc Dmitry Shmidt <[email protected]>
Cc Robert Foss <[email protected]>
Cc Matt Szczesiak <[email protected]>
Cc Liviu Dudau <[email protected]>
Cc David Hanna <[email protected]>
Cc Rob Herring <[email protected]>
Cc Alexandru-Cosmin Gheorghe <[email protected]>
Cc Alistair Strachan <[email protected]>

---
v2:
* Dropped misguided attempt to trivially allocate layers to planes

---
  drmhwctwo.cpp | 7 +++++++
  1 file changed, 7 insertions(+)
drmhwctwo.cpp +0 -0
index 8e00d71..ede75e0 100644
@@ -695,6 +695,13 @@ HWC2::Error DrmHwcTwo::HwcDisplay::ValidateDisplay(uint32_t *num_types,
          layer.set_validated_type(HWC2::Composition::Client);
          ++*num_types;
          break;

drmhwctwo.cpp HWC2::Error DrmHwcTwo::HwcDisplay::ValidateDisplay(uint32_t *num_types, · line 707

Quoted 10 lines
drmhwctwo.cpp +7 -0
+      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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Acked-by on v1 1/4
#7 lore raw
In reply to John Stultz

This patch is:

Quoted 28 lines · John Stultz

From: Sumit Semwal <[email protected]>

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

Cc Marissa Wall <[email protected]>
Cc Sean Paul <[email protected]>
Cc Dmitry Shmidt <[email protected]>
Cc Robert Foss <[email protected]>
Cc Matt Szczesiak <[email protected]>
Cc Liviu Dudau <[email protected]>
Cc David Hanna <[email protected]>
Cc Rob Herring <[email protected]>
Cc Alexandru-Cosmin Gheorghe <[email protected]>
Cc Alistair Strachan <[email protected]>
[jstultz: commit message tweaks]
---
  Android.mk | 1 +
  1 file changed, 1 insertion(+)
Android.mk +0 -0
index 1add286..a60d112 100644

Android.mk LOCAL_SRC_FILES := \ · line 31

Quoted 7 lines
Android.mk +1 -0
@@ -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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel