aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@nokia.com>2010-06-03 09:27:46 -0400
committerTomi Valkeinen <tomi.valkeinen@nokia.com>2010-08-05 09:52:11 -0400
commitf55fdcfe88c5a23115b6d93674ad1e082e841091 (patch)
tree9354e881477de261dfce1b16046e9b299851b600 /drivers/video
parent5cb33e2166067e1fff7ebc3b849ec70a6fd7ec1d (diff)
OMAP: DSS2: adjust YUV overlay width to be even
An overlay in YUV mode has to have an even input width, because data for each pixel is divided between two adjacent pixels. The algorithm handling manual update overlay adjusting may adjust the overlay width to be odd. This patch adds a check for that situation, and makes the width even. The width is increased by one if it is possible (the unadjusted input width is larger than the width), and decreased by one if increasing is not possible. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/omap2/dss/manager.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
index 4b09fcb432b3..6a649ab5539e 100644
--- a/drivers/video/omap2/dss/manager.c
+++ b/drivers/video/omap2/dss/manager.c
@@ -813,6 +813,21 @@ static int configure_overlay(enum omap_plane plane)
813 813
814 w = w * outw / orig_outw; 814 w = w * outw / orig_outw;
815 h = h * outh / orig_outh; 815 h = h * outh / orig_outh;
816
817 /* YUV mode overlay's input width has to be even and the
818 * algorithm above may adjust the width to be odd.
819 *
820 * Here we adjust the width if needed, preferring to increase
821 * the width if the original width was bigger.
822 */
823 if ((w & 1) &&
824 (c->color_mode == OMAP_DSS_COLOR_YUV2 ||
825 c->color_mode == OMAP_DSS_COLOR_UYVY)) {
826 if (orig_w > w)
827 w += 1;
828 else
829 w -= 1;
830 }
816 } 831 }
817 832
818 r = dispc_setup_plane(plane, 833 r = dispc_setup_plane(plane,