All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH hwc] drm_hwcomposer: make sure primary plane is allocated for squash
@ 2017-10-02 18:31 Adrian Salido
  2017-10-17 17:19 ` Robert Foss
  0 siblings, 1 reply; 2+ messages in thread
From: Adrian Salido @ 2017-10-02 18:31 UTC (permalink / raw)
  To: dri-devel; +Cc: Adrian Salido

There are instances where the primary plane may have been disabled, look
through disabled planes as well to find primary plane to use for squash.

Signed-off-by: Adrian Salido <salidoa@google.com>
---
 drmdisplaycompositor.cpp | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/drmdisplaycompositor.cpp b/drmdisplaycompositor.cpp
index a07d3588d1f5..80e3eba60ccf 100644
--- a/drmdisplaycompositor.cpp
+++ b/drmdisplaycompositor.cpp
@@ -933,10 +933,13 @@ int DrmDisplayCompositor::SquashFrame(DrmDisplayComposition *src,
       goto move_layers_back;
     }
 
-    if (comp_plane.type() == DrmCompositionPlane::Type::kDisable) {
+    if (comp_plane.plane()->type() == DRM_PLANE_TYPE_PRIMARY)
+      squashed_comp.set_plane(comp_plane.plane());
+    else
       dst->AddPlaneDisable(comp_plane.plane());
+
+    if (comp_plane.type() == DrmCompositionPlane::Type::kDisable)
       continue;
-    }
 
     for (auto i : comp_plane.source_layers()) {
       DrmHwcLayer &layer = src_layers[i];
@@ -955,11 +958,12 @@ int DrmDisplayCompositor::SquashFrame(DrmDisplayComposition *src,
       squashed_comp.source_layers().push_back(
           squashed_comp.source_layers().size());
     }
+  }
 
-    if (comp_plane.plane()->type() == DRM_PLANE_TYPE_PRIMARY)
-      squashed_comp.set_plane(comp_plane.plane());
-    else
-      dst->AddPlaneDisable(comp_plane.plane());
+  if (squashed_comp.plane() == NULL) {
+    ALOGE("Primary plane not found for squash");
+    ret = -ENOTSUP;
+    goto move_layers_back;
   }
 
   ret = dst->SetLayers(dst_layers.data(), dst_layers.size(), false);
-- 
2.14.2.822.g60be5d43e6-goog

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

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

* Re: [PATCH hwc] drm_hwcomposer: make sure primary plane is allocated for squash
  2017-10-02 18:31 [PATCH hwc] drm_hwcomposer: make sure primary plane is allocated for squash Adrian Salido
@ 2017-10-17 17:19 ` Robert Foss
  0 siblings, 0 replies; 2+ messages in thread
From: Robert Foss @ 2017-10-17 17:19 UTC (permalink / raw)
  To: Adrian Salido, dri-devel

Hey Adrian,

This looks good to me. Pushed!

Sorry about the late reply, I was under the weather for a bit.
Would you be interested in commit rights to this project?


Rob.

On Mon, 2017-10-02 at 11:31 -0700, Adrian Salido wrote:
> There are instances where the primary plane may have been disabled,
> look
> through disabled planes as well to find primary plane to use for
> squash.
> 
> Signed-off-by: Adrian Salido <salidoa@google.com>
> ---
>  drmdisplaycompositor.cpp | 16 ++++++++++------
>  1 file changed, 10 insertions(+), 6 deletions(-)
> 
> diff --git a/drmdisplaycompositor.cpp b/drmdisplaycompositor.cpp
> index a07d3588d1f5..80e3eba60ccf 100644
> --- a/drmdisplaycompositor.cpp
> +++ b/drmdisplaycompositor.cpp
> @@ -933,10 +933,13 @@ int
> DrmDisplayCompositor::SquashFrame(DrmDisplayComposition *src,
>        goto move_layers_back;
>      }
>  
> -    if (comp_plane.type() == DrmCompositionPlane::Type::kDisable) {
> +    if (comp_plane.plane()->type() == DRM_PLANE_TYPE_PRIMARY)
> +      squashed_comp.set_plane(comp_plane.plane());
> +    else
>        dst->AddPlaneDisable(comp_plane.plane());
> +
> +    if (comp_plane.type() == DrmCompositionPlane::Type::kDisable)
>        continue;
> -    }
>  
>      for (auto i : comp_plane.source_layers()) {
>        DrmHwcLayer &layer = src_layers[i];
> @@ -955,11 +958,12 @@ int
> DrmDisplayCompositor::SquashFrame(DrmDisplayComposition *src,
>        squashed_comp.source_layers().push_back(
>            squashed_comp.source_layers().size());
>      }
> +  }
>  
> -    if (comp_plane.plane()->type() == DRM_PLANE_TYPE_PRIMARY)
> -      squashed_comp.set_plane(comp_plane.plane());
> -    else
> -      dst->AddPlaneDisable(comp_plane.plane());
> +  if (squashed_comp.plane() == NULL) {
> +    ALOGE("Primary plane not found for squash");
> +    ret = -ENOTSUP;
> +    goto move_layers_back;
>    }
>  
>    ret = dst->SetLayers(dst_layers.data(), dst_layers.size(), false);
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2017-10-17 17:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-02 18:31 [PATCH hwc] drm_hwcomposer: make sure primary plane is allocated for squash Adrian Salido
2017-10-17 17:19 ` 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.