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

Message ID 20171006214648.2077-1-robh@kernel.org
State New
Headers show
Series
  • [hwc] drm_hwcomposer: use upstream DRM_MODE_{ROTATE, REFLECT} defines
Related show

Commit Message

Rob Herring Oct. 6, 2017, 9:46 p.m.
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.

Signed-off-by: Rob Herring <robh@kernel.org>
---
 drmdisplaycompositor.cpp | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Thierry Reding Oct. 6, 2017, 11:29 p.m. | #1
On Fri, Oct 06, 2017 at 04:46:48PM -0500, Rob Herring wrote:
> 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.

> 

> Signed-off-by: Rob Herring <robh@kernel.org>

> ---

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

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


Reviewed-by: Thierry Reding <treding@nvidia.com>
Robert Foss Oct. 9, 2017, 11:20 a.m. | #2
Hey Rob,

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


Rob.

On Fri, 2017-10-06 at 16:46 -0500, Rob Herring wrote:
> 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.
> 
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  drmdisplaycompositor.cpp | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drmdisplaycompositor.cpp b/drmdisplaycompositor.cpp
> index a07d3588d1f5..036a45e8b88b 100644
> --- a/drmdisplaycompositor.cpp
> +++ b/drmdisplaycompositor.cpp
> @@ -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();
Robert Foss Oct. 9, 2017, 2:04 p.m. | #3
Hey Thierry,

On Sat, 2017-10-07 at 01:29 +0200, Thierry Reding wrote:
> On Fri, Oct 06, 2017 at 04:46:48PM -0500, Rob Herring wrote:
> > 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.
> > 
> > Signed-off-by: Rob Herring <robh@kernel.org>
> > ---
> >  drmdisplaycompositor.cpp | 10 +++++-----
> >  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> Reviewed-by: Thierry Reding <treding@nvidia.com>

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


Rob.

Patch

diff --git a/drmdisplaycompositor.cpp b/drmdisplaycompositor.cpp
index a07d3588d1f5..036a45e8b88b 100644
--- a/drmdisplaycompositor.cpp
+++ b/drmdisplaycompositor.cpp
@@ -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();