linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] drm/imx/dcss: a couple of fixes
@ 2020-11-05 14:01 Laurentiu Palcu
  2020-11-05 14:01 ` [PATCH 1/2] drm/imx/dcss: fix rotations for Vivante tiled formats Laurentiu Palcu
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Laurentiu Palcu @ 2020-11-05 14:01 UTC (permalink / raw)
  To: Lucas Stach, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Laurentiu Palcu, Guido Günther, dri-devel,
	linux-arm-kernel, linux-kernel

Hi,

This patchset fixes 90/270 rotations for Vivante tiled and super-tiled
formats and a Coccinelle warning.

Thanks,
laurentiu

Laurentiu Palcu (2):
  drm/imx/dcss: fix rotations for Vivante tiled formats
  drm/imx/dcss: fix coccinelle warning

 drivers/gpu/drm/imx/dcss/dcss-plane.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

-- 
2.23.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 1/2] drm/imx/dcss: fix rotations for Vivante tiled formats
  2020-11-05 14:01 [PATCH 0/2] drm/imx/dcss: a couple of fixes Laurentiu Palcu
@ 2020-11-05 14:01 ` Laurentiu Palcu
  2020-11-05 14:01 ` [PATCH 2/2] drm/imx/dcss: fix coccinelle warning Laurentiu Palcu
  2020-11-26 10:34 ` [PATCH 0/2] drm/imx/dcss: a couple of fixes Lucas Stach
  2 siblings, 0 replies; 4+ messages in thread
From: Laurentiu Palcu @ 2020-11-05 14:01 UTC (permalink / raw)
  To: Lucas Stach, Philipp Zabel, David Airlie, Daniel Vetter,
	Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Guido Günther
  Cc: Laurentiu Palcu, linux-arm-kernel, dri-devel, linux-kernel

DCSS supports 90/180/270 degree rotations for Vivante tiled and super-tiled
formats. Unfortunately, with the current code, they didn't work properly.

This simple patch makes the rotations work by fixing the way the scaler is set
up for 90/270 degree rotations. In this particular case, the source width and
height need to be swapped since DPR is sending the buffer to scaler already
rotated.

Also, make sure to allow full rotations for DRM_FORMAT_MOD_VIVANTE_SUPER_TILED.

Fixes: 9021c317b770 ("drm/imx: Add initial support for DCSS on iMX8MQ")
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
---
 drivers/gpu/drm/imx/dcss/dcss-plane.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/imx/dcss/dcss-plane.c b/drivers/gpu/drm/imx/dcss/dcss-plane.c
index e13652e3a115..46a188dd02ad 100644
--- a/drivers/gpu/drm/imx/dcss/dcss-plane.c
+++ b/drivers/gpu/drm/imx/dcss/dcss-plane.c
@@ -111,7 +111,8 @@ static bool dcss_plane_can_rotate(const struct drm_format_info *format,
 		supported_rotation = DRM_MODE_ROTATE_0 | DRM_MODE_ROTATE_180 |
 				     DRM_MODE_REFLECT_MASK;
 	else if (!format->is_yuv &&
-		 modifier == DRM_FORMAT_MOD_VIVANTE_TILED)
+		 (modifier == DRM_FORMAT_MOD_VIVANTE_TILED ||
+		  modifier == DRM_FORMAT_MOD_VIVANTE_SUPER_TILED))
 		supported_rotation = DRM_MODE_ROTATE_MASK |
 				     DRM_MODE_REFLECT_MASK;
 	else if (format->is_yuv && linear_format &&
@@ -272,6 +273,7 @@ static void dcss_plane_atomic_update(struct drm_plane *plane,
 	u32 src_w, src_h, dst_w, dst_h;
 	struct drm_rect src, dst;
 	bool enable = true;
+	bool is_rotation_90_or_270;
 
 	if (!fb || !state->crtc || !state->visible)
 		return;
@@ -309,8 +311,13 @@ static void dcss_plane_atomic_update(struct drm_plane *plane,
 
 	dcss_plane_atomic_set_base(dcss_plane);
 
+	is_rotation_90_or_270 = state->rotation & (DRM_MODE_ROTATE_90 |
+						   DRM_MODE_ROTATE_270);
+
 	dcss_scaler_setup(dcss->scaler, dcss_plane->ch_num,
-			  state->fb->format, src_w, src_h,
+			  state->fb->format,
+			  is_rotation_90_or_270 ? src_h : src_w,
+			  is_rotation_90_or_270 ? src_w : src_h,
 			  dst_w, dst_h,
 			  drm_mode_vrefresh(&crtc_state->mode));
 
-- 
2.23.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 2/2] drm/imx/dcss: fix coccinelle warning
  2020-11-05 14:01 [PATCH 0/2] drm/imx/dcss: a couple of fixes Laurentiu Palcu
  2020-11-05 14:01 ` [PATCH 1/2] drm/imx/dcss: fix rotations for Vivante tiled formats Laurentiu Palcu
@ 2020-11-05 14:01 ` Laurentiu Palcu
  2020-11-26 10:34 ` [PATCH 0/2] drm/imx/dcss: a couple of fixes Lucas Stach
  2 siblings, 0 replies; 4+ messages in thread
From: Laurentiu Palcu @ 2020-11-05 14:01 UTC (permalink / raw)
  To: Lucas Stach, Philipp Zabel, David Airlie, Daniel Vetter,
	Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Guido Günther
  Cc: Laurentiu Palcu, linux-arm-kernel, dri-devel, linux-kernel

This small patch fixes a warning that I got while running coccinelle:

  CHECK   drivers/gpu/drm/imx/dcss/dcss-plane.c
  drivers/gpu/drm/imx/dcss/dcss-plane.c:107:21-23: WARNING !A || A && B is equivalent to !A || B

Fixes: 9021c317b770 ("drm/imx: Add initial support for DCSS on iMX8MQ")
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
---
 drivers/gpu/drm/imx/dcss/dcss-plane.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/imx/dcss/dcss-plane.c b/drivers/gpu/drm/imx/dcss/dcss-plane.c
index 46a188dd02ad..5db093aada2f 100644
--- a/drivers/gpu/drm/imx/dcss/dcss-plane.c
+++ b/drivers/gpu/drm/imx/dcss/dcss-plane.c
@@ -103,8 +103,7 @@ static bool dcss_plane_can_rotate(const struct drm_format_info *format,
 				  bool mod_present, u64 modifier,
 				  unsigned int rotation)
 {
-	bool linear_format = !mod_present ||
-			     (mod_present && modifier == DRM_FORMAT_MOD_LINEAR);
+	bool linear_format = !mod_present || modifier == DRM_FORMAT_MOD_LINEAR;
 	u32 supported_rotation = DRM_MODE_ROTATE_0;
 
 	if (!format->is_yuv && linear_format)
-- 
2.23.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 0/2] drm/imx/dcss: a couple of fixes
  2020-11-05 14:01 [PATCH 0/2] drm/imx/dcss: a couple of fixes Laurentiu Palcu
  2020-11-05 14:01 ` [PATCH 1/2] drm/imx/dcss: fix rotations for Vivante tiled formats Laurentiu Palcu
  2020-11-05 14:01 ` [PATCH 2/2] drm/imx/dcss: fix coccinelle warning Laurentiu Palcu
@ 2020-11-26 10:34 ` Lucas Stach
  2 siblings, 0 replies; 4+ messages in thread
From: Lucas Stach @ 2020-11-26 10:34 UTC (permalink / raw)
  To: Laurentiu Palcu, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Laurentiu Palcu, Guido Günther, dri-devel,
	linux-arm-kernel, linux-kernel

On Do, 2020-11-05 at 16:01 +0200, Laurentiu Palcu wrote:
> Hi,
> 
> This patchset fixes 90/270 rotations for Vivante tiled and super-tiled
> formats and a Coccinelle warning.

Thanks, looks good. I've pushed them into drm-misc-next.

Regards,
Lucas


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2020-11-26 10:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-05 14:01 [PATCH 0/2] drm/imx/dcss: a couple of fixes Laurentiu Palcu
2020-11-05 14:01 ` [PATCH 1/2] drm/imx/dcss: fix rotations for Vivante tiled formats Laurentiu Palcu
2020-11-05 14:01 ` [PATCH 2/2] drm/imx/dcss: fix coccinelle warning Laurentiu Palcu
2020-11-26 10:34 ` [PATCH 0/2] drm/imx/dcss: a couple of fixes Lucas Stach

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).