Skip to contentSkip to conversation

drm/msm/dpu: add rotation property

PATCH Superseded Rob Clark 2 participants 3 messages Aug 22, 2019

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Rob Clark

author
#0 lore raw

PATCH 1/1 drm/msm/dpu: add rotation property

From: Rob Clark <[email protected]>

---
 drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +20 -0
index 45bfac9e3af7..c5653771e8fa 100644
@@ -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 */
Signature · 1 line
2.21.0
#1 lore raw
Quoted 20 lines · Rob Clark

From: Rob Clark <[email protected]>

---
 drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +3 -0
index 45bfac9e3af7..c5653771e8fa 100644
@@ -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,

drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c static void dpu_plane_sspp_atomic_update(struct drm_plane *plane) · line 1057

Quoted 10 lines
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +10 -0
+						 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.

Quoted 25 lines
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +7 -0
 		/* 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 */
Signature · 6 lines
2.21.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 2 lines
Ville Syrjälä
Intel
author
#2 lore raw
Quoted 21 lines · Ville Syrjälä
Quoted 19 lines · Rob Clark

From: Rob Clark <[email protected]>

---
 drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +2 -0
index 45bfac9e3af7..c5653771e8fa 100644
@@ -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;
 
Quoted 14 lines

drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c static void dpu_plane_sspp_atomic_update(struct drm_plane *plane) · line 1057

Quoted 11 lines
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +11 -0
+             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

Quoted 30 lines
Quoted 22 lines
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +7 -1
              /* 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

Quoted 4 lines

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

--
Ville Syrjälä
Intel