drm_hwcomposer: Fix invalid rotation value

Message ID 1490843286-21045-1-git-send-email-john.stultz@linaro.org
State New
Headers show

Commit Message

John Stultz March 30, 2017, 3:08 a.m.
From: Rob Clark <robdclark@gmail.com>


Change-Id: If718d3eee03575e011ae5d13dc9088ed73fbeab6
Signed-off-by: Robert Foss <robert.foss@collabora.com>

Signed-off-by: John Stultz <john.stultz@linaro.org>

---
 drmdisplaycompositor.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

-- 
2.7.4

Patch hide | download patch | download mbox

diff --git a/drmdisplaycompositor.cpp b/drmdisplaycompositor.cpp
index e8327cd..86e1b71 100644
--- a/drmdisplaycompositor.cpp
+++ b/drmdisplaycompositor.cpp
@@ -711,6 +711,8 @@  int DrmDisplayCompositor::CommitFrame(DrmDisplayComposition *display_comp,
           rotation |= 1 << DRM_ROTATE_180;
         else if (layer.transform & DrmHwcTransform::kRotate270)
           rotation |= 1 << DRM_ROTATE_270;
+        if (!rotation)
+          rotation |= 1 << DRM_ROTATE_0;
       }
     }
 
@@ -728,7 +730,7 @@  int DrmDisplayCompositor::CommitFrame(DrmDisplayComposition *display_comp,
     }
 
     // TODO: Once we have atomic test, this should fall back to GL
-    if (rotation && plane->rotation_property().id() == 0) {
+    if ((rotation != 1 << DRM_ROTATE_0) && plane->rotation_property().id() == 0) {
       ALOGE("Rotation is not supported on plane %d", plane->id());
       ret = -EINVAL;
       break;