[PATCH hwc] drm_hwcomposer: make sure primary plane is allocated for squash

Robert Foss robert.foss at collabora.com
Tue Oct 17 17:19:24 UTC 2017


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 at 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);


More information about the dri-devel mailing list