Skip to contentSkip to conversation

drm_hwcomposer: Cleanup gl precompositor init and provide uses_GL flag

RFC PATCH In review John Stultz 6 participants 9 messages Apr 24, 2018 – Apr 25, 2018

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/2 drm_hwcomposer: Cleanup gl precompositor init and provide uses_GL flag

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.

Feedback or alternative ideas would be greatly appreciated!

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 e556e86..5c6bf9b 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
#1 lore raw

RFC PATCH 2/2 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 try to map layers to available device planes, falling back to client side compositing if we run-out of planes.

Credit to Rob Herring, who's work this single plane patch was originally based on.

Feedback or alternative ideas would be greatly appreciated!

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]>
---
 drmhwctwo.cpp | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
drmhwctwo.cpp +18 -0
index dfca1a6..437a439 100644
@@ -686,6 +686,15 @@ HWC2::Error DrmHwcTwo::HwcDisplay::ValidateDisplay(uint32_t *num_types,
   supported(__func__);
   *num_types = 0;
   *num_requests = 0;
+  int avail_planes = primary_planes_.size() + overlay_planes_.size();
+
+  /*
+   * If more layers then planes, save one plane
+   * for client composited layers
+   */
+  if (avail_planes < layers_.size())
+	avail_planes--;
+
   for (std::pair<const hwc2_layer_t, DrmHwcTwo::HwcLayer> &l : layers_) {
     DrmHwcTwo::HwcLayer &layer = l.second;
     switch (layer.sf_type()) {
@@ -695,6 +704,15 @@ 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() && !avail_planes) {
+          layer.set_validated_type(HWC2::Composition::Client);
+          ++*num_types;
+          break;
+        } else {
+	   avail_planes--;
+	}
+	/* 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
#2 lore raw

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

Quoted 12 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 try to map layers to available device planes, falling back to client side compositing if we run-out of planes.

Credit to Rob Herring, who's work this single plane patch was originally based on.

Feedback or alternative ideas would be greatly appreciated!

Quoted 12 lines
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]>

A patch so nice, I signed it off twice! :P

Sorry, looks like I yanked and pasted one too many lines from the cc list.

-john
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw

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

In reply to John Stultz
Quoted 49 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 try to map layers to available device planes, falling back to client side compositing if we run-out of planes.

Credit to Rob Herring, who's work this single plane patch was originally based on.

Feedback or alternative ideas would be greatly appreciated!

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]>
---
 drmhwctwo.cpp | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
drmhwctwo.cpp +9 -0
index dfca1a6..437a439 100644
@@ -686,6 +686,15 @@ HWC2::Error DrmHwcTwo::HwcDisplay::ValidateDisplay(uint32_t *num_types,
   supported(__func__);
   *num_types = 0;
   *num_requests = 0;
+  int avail_planes = primary_planes_.size() + overlay_planes_.size();
+
+  /*
+   * If more layers then planes, save one plane
+   * for client composited layers
+   */
+  if (avail_planes < layers_.size())
+	avail_planes--;
+
   for (std::pair<const hwc2_layer_t, DrmHwcTwo::HwcLayer> &l : layers_) {
     DrmHwcTwo::HwcLayer &layer = l.second;
     switch (layer.sf_type()) {

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

Quoted 5 lines
drmhwctwo.cpp +2 -0
@@ -695,6 +704,15 @@ 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() && !avail_planes) {

Something is not entirely correct here, you can't assume just because you have planes available they can be used.
E.g Layer has rotation, but the plane doesn't support it. This part is handled by the planning part in presentDisplay which falls back on GPU.

I think the easiest and safe way is to just fallback to Composition::Client whenever the GLCompositor failed to initialize.

Quoted 12 lines
drmhwctwo.cpp +7 -0
+          layer.set_validated_type(HWC2::Composition::Client);
+          ++*num_types;
+          break;
+        } else {
+	   avail_planes--;
+	}
+	/* fall through */
       default:
         layer.set_validated_type(layer.sf_type());
         break;
Signature · 1 line
2.7.4
Signature · 6 lines
Cheers,
Alex G
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#4 lore raw

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

Quoted 62 lines · Alexandru-Cosmin Gheorghe
Quoted 49 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 try to map layers to available device planes, falling back to client side compositing if we run-out of planes.

Credit to Rob Herring, who's work this single plane patch was originally based on.

Feedback or alternative ideas would be greatly appreciated!

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]>
---
 drmhwctwo.cpp | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
drmhwctwo.cpp +9 -0
index dfca1a6..437a439 100644
@@ -686,6 +686,15 @@ HWC2::Error DrmHwcTwo::HwcDisplay::ValidateDisplay(uint32_t *num_types,
   supported(__func__);
   *num_types = 0;
   *num_requests = 0;
+  int avail_planes = primary_planes_.size() + overlay_planes_.size();
+
+  /*
+   * If more layers then planes, save one plane
+   * for client composited layers
+   */
+  if (avail_planes < layers_.size())
+     avail_planes--;
+
   for (std::pair<const hwc2_layer_t, DrmHwcTwo::HwcLayer> &l : layers_) {
     DrmHwcTwo::HwcLayer &layer = l.second;
     switch (layer.sf_type()) {

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

Quoted 5 lines
drmhwctwo.cpp +2 -0
@@ -695,6 +704,15 @@ 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() && !avail_planes) {

Something is not entirely correct here, you can't assume just because you have planes available they can be used.
E.g Layer has rotation, but the plane doesn't support it. This part is handled by the planning part in presentDisplay which falls back on GPU.

Quoted 3 lines

I think the easiest and safe way is to just fallback to Composition::Client whenever the GLCompositor failed to initialize.

I agree, this would only work out for the single plane case where you end up using client composition for everything.

In the spirit of DRM what we would probably want is to atomic test a composition, and if that fails we can still fallback to client or GL compositor depending on its availability. And then in a far far away future we might even do a few iterations simplifying our composition until it atomic tests correctly so we can still offload some "simple" parts like the cursor.

Thanks,
Stefan
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#5 lore raw

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

Quoted 15 lines · Stefan Schake
Quoted 13 lines · Alexandru-Cosmin Gheorghe

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

Quoted 6 lines · John Stultz
drmhwctwo.cpp +2 -0
@@ -695,6 +704,15 @@ 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() && !avail_planes) {

Something is not entirely correct here, you can't assume just because you have planes available they can be used.
E.g Layer has rotation, but the plane doesn't support it. This part is handled by the planning part in presentDisplay which falls back on GPU.

Ah. Thanks for the correction here!

This is part of the disconnect I have been having with the drm_hwcomposer logic. The plan/validate step doesn't really do either, instead it defers all the checking/planning to the set/present step. But unfortunately it seems if we want to use the surfaceflinger gl composer, we need to mark the layers as client rendered in the validate function.

Quoted 6 lines
Quoted 3 lines

I think the easiest and safe way is to just fallback to Composition::Client whenever the GLCompositor failed to initialize.

I agree, this would only work out for the single plane case where you end up using client composition for everything.

True, but maybe as a first step we simply fall back on the glcompositor, just so we have something displaying in that case (right now nothing gets displayed).

Quoted 6 lines

In the spirit of DRM what we would probably want is to atomic test a composition, and if that fails we can still fallback to client or GL compositor depending on its availability. And then in a far far away future we might even do a few iterations simplifying our composition until it atomic tests correctly so we can still offload some "simple" parts like the cursor.

This sounds reasonable. I suspect it will take some heavier rework of the drm_hwcomposer to move such logic to the validate step.

Marissa/Sean: Any objections here? Doing more planning in the validate step sounds like it aligns closer to the HWC2 interface goals, but I don't want to have to relearn-the-hard-way any lessons that resulted in the current mode of accept it all and sort it in present.

In the meantime I'll drop the flawed plane/layer allocation from this patch and resend.

thanks
-john
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#6 lore raw

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

Quoted 5 lines · John Stultz
Quoted 4 lines · Stefan Schake
Quoted 2 lines · Alexandru-Cosmin Gheorghe

Review HWC2::Error

Quoted 1 line · John Stultz
(quoted diff) +0 -0
@@ -695,6 +704,15 @@ HWC2::Error

DrmHwcTwo::HwcDisplay::ValidateDisplay(uint32_t *num_types,

Quoted 12 lines
Quoted 11 lines
Quoted 11 lines

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

Quoted 5 lines
drmhwctwo.cpp +2 -0
         layer.set_validated_type(HWC2::Composition::Client);
         ++*num_types;
         break;
+      case HWC2::Composition::Device:
+        if (!compositor_.uses_GL() && !avail_planes) {

Something is not entirely correct here, you can't assume just because you have planes available they can be used.
E.g Layer has rotation, but the plane doesn't support it. This part is handled by the planning part in presentDisplay which falls back on GPU.

Quoted 14 lines

Ah. Thanks for the correction here!

This is part of the disconnect I have been having with the drm_hwcomposer logic. The plan/validate step doesn't really do either, instead it defers all the checking/planning to the set/present step. But unfortunately it seems if we want to use the surfaceflinger gl composer, we need to mark the layers as client rendered in the validate function.

Quoted 5 lines
Quoted 3 lines

I think the easiest and safe way is to just fallback to Composition::Client whenever the GLCompositor failed to initialize.

I agree, this would only work out for the single plane case where you

end

Quoted 10 lines
Quoted 1 line

up using client composition for everything.

True, but maybe as a first step we simply fall back on the glcompositor, just so we have something displaying in that case (right now nothing gets displayed).

Quoted 4 lines

In the spirit of DRM what we would probably want is to atomic test a composition, and if that fails we can still fallback to client or GL compositor depending on its availability. And then in a far far away future we might even do a few iterations simplifying our composition

until

Quoted 10 lines
Quoted 2 lines

it atomic tests correctly so we can still offload some "simple" parts like the cursor.

This sounds reasonable. I suspect it will take some heavier rework of the drm_hwcomposer to move such logic to the validate step.

Marissa/Sean: Any objections here? Doing more planning in the validate step sounds like it aligns closer to the HWC2 interface goals, but I don't want to have to relearn-the-hard-way any lessons that resulted in the current mode of accept it all and sort it in present.

No objections, this needs to be done. As you mentioned, this is going to require a good amount of code movement. I think what we're seeing here as well, as with the writeback series, are growing pains. When this was written, it was for HWC1 and the GLCompositor was the only alternate compositor. Now that we're on HWC2 and discussing using writeback, SurfaceFlinger, and possibly GLCompositor, we need something more robust.

Sean

Quoted 5 lines

In the meantime I'll drop the flawed plane/layer allocation from this patch and resend.

thanks
-john

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

#7 lore raw

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

In reply to John Stultz

Hi John,

Quoted 46 lines · John Stultz
Quoted 4 lines · Stefan Schake
Quoted 2 lines · Alexandru-Cosmin Gheorghe

Review HWC2::Error

Quoted 1 line · John Stultz
(quoted diff) +0 -0
@@ -695,6 +704,15 @@ HWC2::Error

DrmHwcTwo::HwcDisplay::ValidateDisplay(uint32_t *num_types,

Quoted 11 lines
Quoted 11 lines

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

Quoted 5 lines
drmhwctwo.cpp +2 -0
         layer.set_validated_type(HWC2::Composition::Client);
         ++*num_types;
         break;
+      case HWC2::Composition::Device:
+        if (!compositor_.uses_GL() && !avail_planes) {

Something is not entirely correct here, you can't assume just because you have planes available they can be used.
E.g Layer has rotation, but the plane doesn't support it. This part is handled by the planning part in presentDisplay which falls back on GPU.

Ah. Thanks for the correction here!

This is part of the disconnect I have been having with the drm_hwcomposer logic. The plan/validate step doesn't really do either, instead it defers all the checking/planning to the set/present step. But unfortunately it seems if we want to use the surfaceflinger gl composer, we need to mark the layers as client rendered in the validate function.

Quoted 6 lines
Quoted 3 lines

I think the easiest and safe way is to just fallback to Composition::Client whenever the GLCompositor failed to initialize.

I agree, this would only work out for the single plane case where you end up using client composition for everything.

True, but maybe as a first step we simply fall back on the glcompositor, just so we have something displaying in that case (right now nothing gets displayed).

Quoted 4 lines

In the spirit of DRM what we would probably want is to atomic test a composition, and if that fails we can still fallback to client or GL compositor depending on its availability. And then in a far far away future we might even do a few iterations simplifying our composition

until

Quoted 2 lines

it atomic tests correctly so we can still offload some "simple" parts like the cursor.

Quoted 8 lines

This sounds reasonable. I suspect it will take some heavier rework of the drm_hwcomposer to move such logic to the validate step.

Marissa/Sean: Any objections here? Doing more planning in the validate step sounds like it aligns closer to the HWC2 interface goals, but I don't want to have to relearn-the-hard-way any lessons that resulted in the current mode of accept it all and sort it in present.

I agree. This was the design goal behind HWC_GEOMETRY_CHANGED / HWC2_PFN_GET_CHANGED_COMPOSITION_TYPES. The validate() function should know that the composition can be set in HWC2_PFN_PRESENT_DISPLAY so there should be no need for an internal GL fallback. This feedback to surfaceflinger also allows for small state optimizations that can't be done in the fallback.

I think validating compositions w/ atomic in kernel is a valid way to do it.

I would suggest that code is also refactored a little so that the validation/planning could also be done in userspace, maybe by linking a static library. This would allow drivers without a way to do it in kernel to keep working.

In the meantime I'll drop the flawed plane/layer allocation from this

Quoted 5 lines

patch and resend.

thanks
-john

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

Reviewed-by on v1 1/2
#8 lore raw
In reply to John Stultz

Please use "PATCH hwc" for drm_hwcomposer patches.

Quoted 36 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.

Feedback or alternative ideas would be greatly appreciated!

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

Both patches look good to me.

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