aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArchit Taneja <archit@ti.com>2013-03-26 09:45:24 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2013-04-10 08:02:53 -0400
commitc35eeb2e80a4dd3aa1a4ceac8f74f4c4e61f6463 (patch)
treef7e06461e6f8231588afc1ccf4024d756cb74748
parent3729a70b5837a60d736e8e5edb116b8eecd1bedb (diff)
OMAPDSS: DISPC: Configure doublestride for NV12 when using 2D Tiler buffers
When using a DISPC video pipeline to a fetch a NV12 buffer in a 2D container, we need to set set a doublestride bit in the video pipe's ATTRIBUTES register. This is needed because the stride for the UV plane(using a 16 bit Tiler container) is double the stride for the Y plane(using a 8 bit Tiler container) for the 0 or 180 degree views. The ROW_INC register is meant for the Y plane, and the HW will calculate the row increment needed for the UV plane by using double the stride value based on whether this bit is set or not. Set the bit when we are using a 2D Tiler buffer and when rotation is 0 or 180 degrees. The stride value is the same for 90 and 270 degree Tiler views, hence the bit shouldn't be set. Signed-off-by: Archit Taneja <archit@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r--drivers/video/omap2/dss/dispc.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index a375de3126e5..e7ed1f7bb302 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -1586,6 +1586,7 @@ static void dispc_ovl_set_scaling(enum omap_plane plane,
1586} 1586}
1587 1587
1588static void dispc_ovl_set_rotation_attrs(enum omap_plane plane, u8 rotation, 1588static void dispc_ovl_set_rotation_attrs(enum omap_plane plane, u8 rotation,
1589 enum omap_dss_rotation_type rotation_type,
1589 bool mirroring, enum omap_color_mode color_mode) 1590 bool mirroring, enum omap_color_mode color_mode)
1590{ 1591{
1591 bool row_repeat = false; 1592 bool row_repeat = false;
@@ -1636,6 +1637,15 @@ static void dispc_ovl_set_rotation_attrs(enum omap_plane plane, u8 rotation,
1636 if (dss_has_feature(FEAT_ROWREPEATENABLE)) 1637 if (dss_has_feature(FEAT_ROWREPEATENABLE))
1637 REG_FLD_MOD(DISPC_OVL_ATTRIBUTES(plane), 1638 REG_FLD_MOD(DISPC_OVL_ATTRIBUTES(plane),
1638 row_repeat ? 1 : 0, 18, 18); 1639 row_repeat ? 1 : 0, 18, 18);
1640
1641 if (color_mode == OMAP_DSS_COLOR_NV12) {
1642 bool doublestride = (rotation_type == OMAP_DSS_ROT_TILER) &&
1643 (rotation == OMAP_DSS_ROT_0 ||
1644 rotation == OMAP_DSS_ROT_180);
1645 /* DOUBLESTRIDE */
1646 REG_FLD_MOD(DISPC_OVL_ATTRIBUTES(plane), doublestride, 22, 22);
1647 }
1648
1639} 1649}
1640 1650
1641static int color_mode_to_bpp(enum omap_color_mode color_mode) 1651static int color_mode_to_bpp(enum omap_color_mode color_mode)
@@ -2514,7 +2524,8 @@ static int dispc_ovl_setup_common(enum omap_plane plane,
2514 dispc_ovl_set_vid_color_conv(plane, cconv); 2524 dispc_ovl_set_vid_color_conv(plane, cconv);
2515 } 2525 }
2516 2526
2517 dispc_ovl_set_rotation_attrs(plane, rotation, mirror, color_mode); 2527 dispc_ovl_set_rotation_attrs(plane, rotation, rotation_type, mirror,
2528 color_mode);
2518 2529
2519 dispc_ovl_set_zorder(plane, caps, zorder); 2530 dispc_ovl_set_zorder(plane, caps, zorder);
2520 dispc_ovl_set_pre_mult_alpha(plane, caps, pre_mult_alpha); 2531 dispc_ovl_set_pre_mult_alpha(plane, caps, pre_mult_alpha);