From: Adrian Salido <salidoa@google.com>
To: dri-devel@lists.freedesktop.org
Cc: Adrian Salido <salidoa@google.com>
Subject: [PATCH hwc] drm_hwcomposer: make sure primary plane is allocated for squash
Date: Mon, 2 Oct 2017 11:31:27 -0700 [thread overview]
Message-ID: <20171002183127.176139-1-salidoa@google.com> (raw)
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
next reply other threads:[~2017-10-02 18:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-02 18:31 Adrian Salido [this message]
2017-10-17 17:19 ` [PATCH hwc] drm_hwcomposer: make sure primary plane is allocated for squash Robert Foss
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171002183127.176139-1-salidoa@google.com \
--to=salidoa@google.com \
--cc=dri-devel@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox