summaryrefslogtreecommitdiff
path: root/drmdisplaycomposition.cpp
diff options
context:
space:
mode:
authorSean Paul <seanpaul@chromium.org>2015-11-19 21:46:11 -0500
committerSean Paul <seanpaul@chromium.org>2015-11-20 15:01:18 -0500
commit04b47ea435834b4373d57dae6485986b9f0918ae (patch)
tree9a54b4abdede013cfd74994c27e35e7e460b3544 /drmdisplaycomposition.cpp
parent35301f498c372f3ad2bbbc969acda39056131b26 (diff)
downloaddrm_hwcomposer-04b47ea435834b4373d57dae6485986b9f0918ae.tar.gz
drm_hwcomposer-04b47ea435834b4373d57dae6485986b9f0918ae.tar.xz
drm_hwcomposer: Allow for multiple transforms at once
Because sometimes one just ain't enough, allow more than one transform at a time. Bug: chrome-os-partner:46710 Test: Tested with the CTS Verifier "Camera Orientation" test Change-Id: Ie5f9bbbc7c89964feafc78150e18512861c85b69 Signed-off-by: Sean Paul <seanpaul@chromium.org>
Diffstat (limited to 'drmdisplaycomposition.cpp')
-rw-r--r--drmdisplaycomposition.cpp68
1 files changed, 49 insertions, 19 deletions
diff --git a/drmdisplaycomposition.cpp b/drmdisplaycomposition.cpp
index b266bd7..300414d 100644
--- a/drmdisplaycomposition.cpp
+++ b/drmdisplaycomposition.cpp
@@ -443,23 +443,52 @@ static void DumpBuffer(const DrmHwcBuffer &buffer, std::ostringstream *out) {
*out << buffer->width << "/" << buffer->height << "/" << buffer->format;
}
-static const char *TransformToString(DrmHwcTransform transform) {
- switch (transform) {
- case DrmHwcTransform::kIdentity:
- return "IDENTITY";
- case DrmHwcTransform::kFlipH:
- return "FLIPH";
- case DrmHwcTransform::kFlipV:
- return "FLIPV";
- case DrmHwcTransform::kRotate90:
- return "ROTATE90";
- case DrmHwcTransform::kRotate180:
- return "ROTATE180";
- case DrmHwcTransform::kRotate270:
- return "ROTATE270";
- default:
- return "<invalid>";
- }
+static void DumpTransform(uint32_t transform, std::ostringstream *out) {
+ *out << "[";
+
+ if (transform == 0)
+ *out << "IDENTITY";
+
+ bool separator = false;
+ if (transform & DrmHwcTransform::kFlipH) {
+ *out << "FLIPH";
+ separator = true;
+ }
+ if (transform & DrmHwcTransform::kFlipV) {
+ if (separator)
+ *out << "|";
+ *out << "FLIPV";
+ separator = true;
+ }
+ if (transform & DrmHwcTransform::kRotate90) {
+ if (separator)
+ *out << "|";
+ *out << "ROTATE90";
+ separator = true;
+ }
+ if (transform & DrmHwcTransform::kRotate180) {
+ if (separator)
+ *out << "|";
+ *out << "ROTATE180";
+ separator = true;
+ }
+ if (transform & DrmHwcTransform::kRotate270) {
+ if (separator)
+ *out << "|";
+ *out << "ROTATE270";
+ separator = true;
+ }
+
+ uint32_t valid_bits = DrmHwcTransform::kFlipH | DrmHwcTransform::kFlipH |
+ DrmHwcTransform::kRotate90 |
+ DrmHwcTransform::kRotate180 |
+ DrmHwcTransform::kRotate270;
+ if (transform & ~valid_bits) {
+ if (separator)
+ *out << "|";
+ *out << "INVALID";
+ }
+ *out << "]";
}
static const char *BlendingToString(DrmHwcBlending blending) {
@@ -523,8 +552,9 @@ void DrmDisplayComposition::Dump(std::ostringstream *out) const {
if (layer.protected_usage())
*out << " protected";
- *out << " transform=" << TransformToString(layer.transform)
- << " blending[a=" << (int)layer.alpha
+ *out << " transform=";
+ DumpTransform(layer.transform, out);
+ *out << " blending[a=" << (int)layer.alpha
<< "]=" << BlendingToString(layer.blending) << " source_crop";
layer.source_crop.Dump(out);
*out << " display_frame";