Linux-ARM-MSM Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] drm/msm/dpu: add rotation property
@ 2019-08-22  1:57 Rob Clark
  2019-08-22 12:26 ` Ville Syrjälä
  0 siblings, 1 reply; 3+ messages in thread
From: Rob Clark @ 2019-08-22  1:57 UTC (permalink / raw)
  To: dri-devel
  Cc: Rob Clark, Rob Clark, Sean Paul, David Airlie, Daniel Vetter,
	Jeykumar Sankaran, Jordan Crouse, Bruce Wang, Fritz Koenig,
	linux-arm-msm, freedreno, linux-kernel

From: Rob Clark <robdclark@chromium.org>

Signed-off-by: Rob Clark <robdclark@chromium.org>
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
index 45bfac9e3af7..c5653771e8fa 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
@@ -1040,8 +1040,21 @@ static void dpu_plane_sspp_atomic_update(struct drm_plane *plane)
 				pstate->multirect_mode);
 
 	if (pdpu->pipe_hw->ops.setup_format) {
+		unsigned int rotation;
+
 		src_flags = 0x0;
 
+		rotation = drm_rotation_simplify(state->rotation,
+						 DRM_MODE_ROTATE_0 |
+						 DRM_MODE_REFLECT_X |
+						 DRM_MODE_REFLECT_Y);
+
+		if (rotation & DRM_MODE_REFLECT_X)
+			src_flags |= DPU_SSPP_FLIP_UD;
+
+		if (rotation & DRM_MODE_REFLECT_Y)
+			src_flags |= DPU_SSPP_FLIP_LR;
+
 		/* update format */
 		pdpu->pipe_hw->ops.setup_format(pdpu->pipe_hw, fmt, src_flags,
 				pstate->multirect_index);
@@ -1522,6 +1535,13 @@ struct drm_plane *dpu_plane_init(struct drm_device *dev,
 	if (ret)
 		DPU_ERROR("failed to install zpos property, rc = %d\n", ret);
 
+	drm_plane_create_rotation_property(plane,
+			DRM_MODE_ROTATE_0,
+			DRM_MODE_ROTATE_0 |
+			DRM_MODE_ROTATE_180 |
+			DRM_MODE_REFLECT_X |
+			DRM_MODE_REFLECT_Y);
+
 	drm_plane_enable_fb_damage_clips(plane);
 
 	/* success! finalize initialization */
-- 
2.21.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/msm/dpu: add rotation property
  2019-08-22  1:57 [PATCH] drm/msm/dpu: add rotation property Rob Clark
@ 2019-08-22 12:26 ` Ville Syrjälä
  2019-08-22 15:45   ` Rob Clark
  0 siblings, 1 reply; 3+ messages in thread
From: Ville Syrjälä @ 2019-08-22 12:26 UTC (permalink / raw)
  To: Rob Clark
  Cc: dri-devel, Rob Clark, freedreno, Fritz Koenig, David Airlie,
	linux-arm-msm, linux-kernel, Bruce Wang, Sean Paul

On Wed, Aug 21, 2019 at 06:57:24PM -0700, Rob Clark wrote:
> From: Rob Clark <robdclark@chromium.org>
> 
> Signed-off-by: Rob Clark <robdclark@chromium.org>
> ---
>  drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
> 
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> index 45bfac9e3af7..c5653771e8fa 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> @@ -1040,8 +1040,21 @@ static void dpu_plane_sspp_atomic_update(struct drm_plane *plane)
>  				pstate->multirect_mode);
>  
>  	if (pdpu->pipe_hw->ops.setup_format) {
> +		unsigned int rotation;
> +
>  		src_flags = 0x0;
>  
> +		rotation = drm_rotation_simplify(state->rotation,
> +						 DRM_MODE_ROTATE_0 |
> +						 DRM_MODE_REFLECT_X |
> +						 DRM_MODE_REFLECT_Y);
> +
> +		if (rotation & DRM_MODE_REFLECT_X)
> +			src_flags |= DPU_SSPP_FLIP_UD;
> + 
> +		if (rotation & DRM_MODE_REFLECT_Y)
> +			src_flags |= DPU_SSPP_FLIP_LR;
> +

UD vs. LR (assuming those mean what I think they mean) seem the wrong
way around here.

>
>  		/* update format */
>  		pdpu->pipe_hw->ops.setup_format(pdpu->pipe_hw, fmt, src_flags,
>  				pstate->multirect_index);
> @@ -1522,6 +1535,13 @@ struct drm_plane *dpu_plane_init(struct drm_device *dev,
>  	if (ret)
>  		DPU_ERROR("failed to install zpos property, rc = %d\n", ret);
>  
> +	drm_plane_create_rotation_property(plane,
> +			DRM_MODE_ROTATE_0,
> +			DRM_MODE_ROTATE_0 |
> +			DRM_MODE_ROTATE_180 |
> +			DRM_MODE_REFLECT_X |
> +			DRM_MODE_REFLECT_Y);
> +
>  	drm_plane_enable_fb_damage_clips(plane);
>  
>  	/* success! finalize initialization */
> -- 
> 2.21.0
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Ville Syrjälä
Intel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/msm/dpu: add rotation property
  2019-08-22 12:26 ` Ville Syrjälä
@ 2019-08-22 15:45   ` Rob Clark
  0 siblings, 0 replies; 3+ messages in thread
From: Rob Clark @ 2019-08-22 15:45 UTC (permalink / raw)
  To: Ville Syrjälä
  Cc: dri-devel, Rob Clark, freedreno, Fritz Koenig, David Airlie,
	linux-arm-msm, Linux Kernel Mailing List, Bruce Wang, Sean Paul

On Thu, Aug 22, 2019 at 5:26 AM Ville Syrjälä
<ville.syrjala@linux.intel.com> wrote:
>
> On Wed, Aug 21, 2019 at 06:57:24PM -0700, Rob Clark wrote:
> > From: Rob Clark <robdclark@chromium.org>
> >
> > Signed-off-by: Rob Clark <robdclark@chromium.org>
> > ---
> >  drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 20 ++++++++++++++++++++
> >  1 file changed, 20 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> > index 45bfac9e3af7..c5653771e8fa 100644
> > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> > @@ -1040,8 +1040,21 @@ static void dpu_plane_sspp_atomic_update(struct drm_plane *plane)
> >                               pstate->multirect_mode);
> >
> >       if (pdpu->pipe_hw->ops.setup_format) {
> > +             unsigned int rotation;
> > +
> >               src_flags = 0x0;
> >
> > +             rotation = drm_rotation_simplify(state->rotation,
> > +                                              DRM_MODE_ROTATE_0 |
> > +                                              DRM_MODE_REFLECT_X |
> > +                                              DRM_MODE_REFLECT_Y);
> > +
> > +             if (rotation & DRM_MODE_REFLECT_X)
> > +                     src_flags |= DPU_SSPP_FLIP_UD;
> > +
> > +             if (rotation & DRM_MODE_REFLECT_Y)
> > +                     src_flags |= DPU_SSPP_FLIP_LR;
> > +
>
> UD vs. LR (assuming those mean what I think they mean) seem the wrong
> way around here.

ahh, right, reflect "along" vs "around"..

BR,
-R

>
> >
> >               /* update format */
> >               pdpu->pipe_hw->ops.setup_format(pdpu->pipe_hw, fmt, src_flags,
> >                               pstate->multirect_index);
> > @@ -1522,6 +1535,13 @@ struct drm_plane *dpu_plane_init(struct drm_device *dev,
> >       if (ret)
> >               DPU_ERROR("failed to install zpos property, rc = %d\n", ret);
> >
> > +     drm_plane_create_rotation_property(plane,
> > +                     DRM_MODE_ROTATE_0,
> > +                     DRM_MODE_ROTATE_0 |
> > +                     DRM_MODE_ROTATE_180 |
> > +                     DRM_MODE_REFLECT_X |
> > +                     DRM_MODE_REFLECT_Y);
> > +
> >       drm_plane_enable_fb_damage_clips(plane);
> >
> >       /* success! finalize initialization */
> > --
> > 2.21.0
> >
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/dri-devel
>
> --
> Ville Syrjälä
> Intel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-22  1:57 [PATCH] drm/msm/dpu: add rotation property Rob Clark
2019-08-22 12:26 ` Ville Syrjälä
2019-08-22 15:45   ` Rob Clark

Linux-ARM-MSM Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-arm-msm/0 linux-arm-msm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-arm-msm linux-arm-msm/ https://lore.kernel.org/linux-arm-msm \
		linux-arm-msm@vger.kernel.org linux-arm-msm@archiver.kernel.org
	public-inbox-index linux-arm-msm


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-arm-msm


AGPL code for this site: git clone https://public-inbox.org/ public-inbox