Skip to contentSkip to conversation

drm_hwcomposer: use upstream DRM_MODE_{ROTATE, REFLECT} defines

PATCH In review Rob Herring 3 participants 4 messages Oct 6, 2017 – Oct 9, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm_hwcomposer: use upstream DRM_MODE_{ROTATE, REFLECT} defines

The DRM_REFLECT_* and DRM_ROTATE_* defines were not upstream, but now they are. Convert to using the upstream version which are defined as a bit mask rather than a bit position.

---
 drmdisplaycompositor.cpp | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drmdisplaycompositor.cpp +5 -5
index a07d3588d1f5..036a45e8b88b 100644
@@ -572,15 +572,15 @@ int DrmDisplayCompositor::CommitFrame(DrmDisplayComposition *display_comp,
 
       rotation = 0;
       if (layer.transform & DrmHwcTransform::kFlipH)
-        rotation |= 1 << DRM_REFLECT_X;
+        rotation |= DRM_MODE_REFLECT_X;
       if (layer.transform & DrmHwcTransform::kFlipV)
-        rotation |= 1 << DRM_REFLECT_Y;
+        rotation |= DRM_MODE_REFLECT_Y;
       if (layer.transform & DrmHwcTransform::kRotate90)
-        rotation |= 1 << DRM_ROTATE_90;
+        rotation |= DRM_MODE_ROTATE_90;
       else if (layer.transform & DrmHwcTransform::kRotate180)
-        rotation |= 1 << DRM_ROTATE_180;
+        rotation |= DRM_MODE_ROTATE_180;
       else if (layer.transform & DrmHwcTransform::kRotate270)
-        rotation |= 1 << DRM_ROTATE_270;
+        rotation |= DRM_MODE_ROTATE_270;
 
       if (fence_fd < 0) {
         int prop_id = plane->in_fence_fd_property().id();
Signature · 6 lines
2.11.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Rob Herring

The DRM_REFLECT_* and DRM_ROTATE_* defines were not upstream, but now they are. Convert to using the upstream version which are defined as a bit mask rather than a bit position.

---
 drmdisplaycompositor.cpp | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw

Hey Thierry,

Quoted 7 lines · Thierry Reding
Quoted 6 lines · Rob Herring

The DRM_REFLECT_* and DRM_ROTATE_* defines were not upstream, but now
they are. Convert to using the upstream version which are defined as a
bit mask rather than a bit position.

Quoted 6 lines
Quoted 4 lines

---
 drmdisplaycompositor.cpp | 10 +++++-----

 1 file changed, 5 insertions(+), 5 deletions(-)

I pushed this patch, but I slightly bungled it, and missed appending your r-b to the commit message. Sorry about that.

Rob.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw

Re: [PATCH hwc] drm_hwcomposer: use upstream DRM_MODE_{ROTATE,REFLECT} defines

In reply to Rob Herring

Hey Rob,

This looks good to me, added r-b and pushed.

Rob.

Quoted 29 lines · Rob Herring

The DRM_REFLECT_* and DRM_ROTATE_* defines were not upstream, but now they are. Convert to using the upstream version which are defined as a
bit mask rather than a bit position.

---
 drmdisplaycompositor.cpp | 10 +++++-----

 1 file changed, 5 insertions(+), 5 deletions(-)
drmdisplaycompositor.cpp +0 -0
index a07d3588d1f5..036a45e8b88b 100644
@@ -572,15 +572,15 @@ int

DrmDisplayCompositor::CommitFrame(DrmDisplayComposition *display_comp,

       rotation = 0;
       if (layer.transform & DrmHwcTransform::kFlipH) -        rotation |= 1 << DRM_REFLECT_X;
+        rotation |= DRM_MODE_REFLECT_X;
       if (layer.transform & DrmHwcTransform::kFlipV) -        rotation |= 1 << DRM_REFLECT_Y;
+        rotation |= DRM_MODE_REFLECT_Y;
       if (layer.transform & DrmHwcTransform::kRotate90) -        rotation |= 1 << DRM_ROTATE_90;
+        rotation |= DRM_MODE_ROTATE_90;
       else if (layer.transform & DrmHwcTransform::kRotate180)

Quoted 8 lines

-        rotation |= 1 << DRM_ROTATE_180;
+        rotation |= DRM_MODE_ROTATE_180;
       else if (layer.transform & DrmHwcTransform::kRotate270) -        rotation |= 1 << DRM_ROTATE_270;
+        rotation |= DRM_MODE_ROTATE_270;

       if (fence_fd < 0) {
         int prop_id = plane->in_fence_fd_property().id();

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel