diff mbox

[02/16] drm/omap: fix setting & clearing DOUBLESTRIDE

Message ID 1493893412-12178-3-git-send-email-tomi.valkeinen@ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

Tomi Valkeinen May 4, 2017, 10:23 a.m. UTC
The code that sets and clears DOUBLESTRIDE is only ran when using NV12.
This is not correct, as we might first set the bith when using NV12, but
never clear it when using other formats.

Fix it so that when the bit is available (when the HW supports NV12) we
always either set or clear the bit.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 drivers/gpu/drm/omapdrm/dss/dispc.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

Comments

Laurent Pinchart May 24, 2017, 12:36 p.m. UTC | #1
Hi Tomi,

Thank you for the patch.

On Thursday 04 May 2017 13:23:18 Tomi Valkeinen wrote:
> The code that sets and clears DOUBLESTRIDE is only ran when using NV12.
> This is not correct, as we might first set the bith when using NV12, but
> never clear it when using other formats.
> 
> Fix it so that when the bit is available (when the HW supports NV12) we
> always either set or clear the bit.
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/gpu/drm/omapdrm/dss/dispc.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c
> b/drivers/gpu/drm/omapdrm/dss/dispc.c index 352fad583571..079ec5d0b624
> 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dispc.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
> @@ -1864,14 +1864,15 @@ static void dispc_ovl_set_rotation_attrs(enum
> omap_plane_id plane, u8 rotation, REG_FLD_MOD(DISPC_OVL_ATTRIBUTES(plane),
>  			row_repeat ? 1 : 0, 18, 18);
> 
> -	if (color_mode == OMAP_DSS_COLOR_NV12) {
> -		bool doublestride = (rotation_type == OMAP_DSS_ROT_TILER) &&
> -					(rotation == OMAP_DSS_ROT_0 ||
> -					rotation == OMAP_DSS_ROT_180);
> +	if (dss_feat_color_mode_supported(plane, OMAP_DSS_COLOR_NV12)) {
> +		bool doublestride =
> +			color_mode == OMAP_DSS_COLOR_NV12 &&
> +			rotation_type == OMAP_DSS_ROT_TILER &&
> +			(rotation == OMAP_DSS_ROT_0 || rotation == 
OMAP_DSS_ROT_180);
> +
>  		/* DOUBLESTRIDE */
>  		REG_FLD_MOD(DISPC_OVL_ATTRIBUTES(plane), doublestride, 22, 
22);
>  	}
> -
>  }
> 
>  static int color_mode_to_bpp(enum omap_color_mode color_mode)
diff mbox

Patch

diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c
index 352fad583571..079ec5d0b624 100644
--- a/drivers/gpu/drm/omapdrm/dss/dispc.c
+++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
@@ -1864,14 +1864,15 @@  static void dispc_ovl_set_rotation_attrs(enum omap_plane_id plane, u8 rotation,
 		REG_FLD_MOD(DISPC_OVL_ATTRIBUTES(plane),
 			row_repeat ? 1 : 0, 18, 18);
 
-	if (color_mode == OMAP_DSS_COLOR_NV12) {
-		bool doublestride = (rotation_type == OMAP_DSS_ROT_TILER) &&
-					(rotation == OMAP_DSS_ROT_0 ||
-					rotation == OMAP_DSS_ROT_180);
+	if (dss_feat_color_mode_supported(plane, OMAP_DSS_COLOR_NV12)) {
+		bool doublestride =
+			color_mode == OMAP_DSS_COLOR_NV12 &&
+			rotation_type == OMAP_DSS_ROT_TILER &&
+			(rotation == OMAP_DSS_ROT_0 || rotation == OMAP_DSS_ROT_180);
+
 		/* DOUBLESTRIDE */
 		REG_FLD_MOD(DISPC_OVL_ATTRIBUTES(plane), doublestride, 22, 22);
 	}
-
 }
 
 static int color_mode_to_bpp(enum omap_color_mode color_mode)