aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2
diff options
context:
space:
mode:
authorArchit Taneja <archit@ti.com>2012-08-22 17:04:48 +0530
committerTomi Valkeinen <tomi.valkeinen@ti.com>2012-09-26 14:58:49 +0300
commit20fbb50be4ff22b443183ffb4b5e6dd0691a4fc1 (patch)
treea42b5e78d453c585e297249886561e97e3648f82 /drivers/video/omap2
parentOMAPDSS: DIPSC: Relax scaling limitations when in memory to memory mode (diff)
downloadlinux-dev-20fbb50be4ff22b443183ffb4b5e6dd0691a4fc1.tar.xz
linux-dev-20fbb50be4ff22b443183ffb4b5e6dd0691a4fc1.zip
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,
{
int scale_x = out_width != orig_width;
int scale_y = out_height != orig_height;
+ bool chroma_upscale = true;
if (!dss_has_feature(FEAT_HANDLE_UV_SEPARATE))
return;
@@ -1473,23 +1474,34 @@ static void dispc_ovl_set_scaling_uv(enum omap_plane plane,
switch (color_mode) {
case OMAP_DSS_COLOR_NV12:
- /* UV is subsampled by 2 vertically*/
- orig_height >>= 1;
- /* UV is subsampled by 2 horz.*/
- orig_width >>= 1;
+ if (chroma_upscale) {
+ /* UV is subsampled by 2 horizontally and vertically */
+ orig_height >>= 1;
+ orig_width >>= 1;
+ } else {
+ /* UV is downsampled by 2 horizontally and vertically */
+ orig_height <<= 1;
+ orig_width <<= 1;
+ }
+
break;
case OMAP_DSS_COLOR_YUV2:
case OMAP_DSS_COLOR_UYVY:
- /*For YUV422 with 90/270 rotation,
- *we don't upsample chroma
- */
+ /* For YUV422 with 90/270 rotation, we don't upsample chroma */
if (rotation == OMAP_DSS_ROT_0 ||
- rotation == OMAP_DSS_ROT_180)
- /* UV is subsampled by 2 hrz*/
- orig_width >>= 1;
+ rotation == OMAP_DSS_ROT_180) {
+ if (chroma_upscale)
+ /* UV is subsampled by 2 horizontally */
+ orig_width >>= 1;
+ else
+ /* UV is downsampled by 2 horizontally */
+ orig_width <<= 1;
+ }
+
/* must use FIR for YUV422 if rotated */
if (rotation != OMAP_DSS_ROT_0)
scale_x = scale_y = true;
+
break;
default:
BUG();