aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2
diff options
context:
space:
mode:
authorArchit Taneja <archit@ti.com>2012-08-22 07:34:48 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2012-09-26 07:58:49 -0400
commit20fbb50be4ff22b443183ffb4b5e6dd0691a4fc1 (patch)
treea42b5e78d453c585e297249886561e97e3648f82 /drivers/video/omap2
parent8ba85306ba0fd87a3c15a02fe83d817832705a7d (diff)
OMAPDSS: DISPC: Allow both upscaling and downscaling of chroma
In the function dispc_plane_set_scaling_uv(), create a parameter which tells if we want to upscale or downscale the chroma plane. Downscaling of chroma is required by writeback pipeline for converting the input YUV444 color format to YUV422 or NV12. Signed-off-by: Archit Taneja <archit@ti.com>
Diffstat (limited to 'drivers/video/omap2')
-rw-r--r--drivers/video/omap2/dss/dispc.c32
1 files changed, 22 insertions, 10 deletions
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index fd932b83ce43..b1b9e3f1be90 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -1457,6 +1457,7 @@ static void dispc_ovl_set_scaling_uv(enum omap_plane plane,
1457{ 1457{
1458 int scale_x = out_width != orig_width; 1458 int scale_x = out_width != orig_width;
1459 int scale_y = out_height != orig_height; 1459 int scale_y = out_height != orig_height;
1460 bool chroma_upscale = true;
1460 1461
1461 if (!dss_has_feature(FEAT_HANDLE_UV_SEPARATE)) 1462 if (!dss_has_feature(FEAT_HANDLE_UV_SEPARATE))
1462 return; 1463 return;
@@ -1473,23 +1474,34 @@ static void dispc_ovl_set_scaling_uv(enum omap_plane plane,
1473 1474
1474 switch (color_mode) { 1475 switch (color_mode) {
1475 case OMAP_DSS_COLOR_NV12: 1476 case OMAP_DSS_COLOR_NV12:
1476 /* UV is subsampled by 2 vertically*/ 1477 if (chroma_upscale) {
1477 orig_height >>= 1; 1478 /* UV is subsampled by 2 horizontally and vertically */
1478 /* UV is subsampled by 2 horz.*/ 1479 orig_height >>= 1;
1479 orig_width >>= 1; 1480 orig_width >>= 1;
1481 } else {
1482 /* UV is downsampled by 2 horizontally and vertically */
1483 orig_height <<= 1;
1484 orig_width <<= 1;
1485 }
1486
1480 break; 1487 break;
1481 case OMAP_DSS_COLOR_YUV2: 1488 case OMAP_DSS_COLOR_YUV2:
1482 case OMAP_DSS_COLOR_UYVY: 1489 case OMAP_DSS_COLOR_UYVY:
1483 /*For YUV422 with 90/270 rotation, 1490 /* For YUV422 with 90/270 rotation, we don't upsample chroma */
1484 *we don't upsample chroma
1485 */
1486 if (rotation == OMAP_DSS_ROT_0 || 1491 if (rotation == OMAP_DSS_ROT_0 ||
1487 rotation == OMAP_DSS_ROT_180) 1492 rotation == OMAP_DSS_ROT_180) {
1488 /* UV is subsampled by 2 hrz*/ 1493 if (chroma_upscale)
1489 orig_width >>= 1; 1494 /* UV is subsampled by 2 horizontally */
1495 orig_width >>= 1;
1496 else
1497 /* UV is downsampled by 2 horizontally */
1498 orig_width <<= 1;
1499 }
1500
1490 /* must use FIR for YUV422 if rotated */ 1501 /* must use FIR for YUV422 if rotated */
1491 if (rotation != OMAP_DSS_ROT_0) 1502 if (rotation != OMAP_DSS_ROT_0)
1492 scale_x = scale_y = true; 1503 scale_x = scale_y = true;
1504
1493 break; 1505 break;
1494 default: 1506 default:
1495 BUG(); 1507 BUG();