aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2
diff options
context:
space:
mode:
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();