aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0010-DSS2-Fix-scaling-checks-when-rotation-is-90-or-270-d.patch
blob: 3a59b59ed6ae26c03b4f324b3743c4cbd745620d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
From 23ddd0dafbf79d7919aa90479dc038e1d9e7c905 Mon Sep 17 00:00:00 2001
From: Tim Yamin <plasm@roo.me.uk>
Date: Fri, 12 Mar 2010 13:57:38 +0100
Subject: [PATCH 10/16] DSS2: Fix scaling checks when rotation is 90 or 270 degrees.

---
 drivers/video/omap2/dss/dispc.c |   25 +++++++++++++++++++------
 1 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 1b38c49..d648c08 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -1563,16 +1563,29 @@ static int _dispc_setup_plane(enum omap_plane plane,
 		}
 	} else {
 		/* video plane */
-
+		u8 error = 0;
 		unsigned long fclk = 0;
 
-		if (out_width < width / maxdownscale ||
-		   out_width > width * 8)
-			return -EINVAL;
+		if(rotation == 1 || rotation == 3)
+		{
+			if (out_width < height / maxdownscale || out_width > height * 8)
+				error = 1;
+
+			if (out_height < width / maxdownscale || out_height > width * 8)
+				error = 1;
+		} else {
+			if (out_width < width / maxdownscale || out_width > width * 8)
+				error = 1;
 
-		if (out_height < height / maxdownscale ||
-		   out_height > height * 8)
+			if (out_height < height / maxdownscale || out_height > height * 8)
+				error = 1;
+		}
+
+		if(error != 0)
+		{
+			printk("DSS: Unable to down/up scale video plane\n");
 			return -EINVAL;
+		}
 
 		switch (color_mode) {
 		case OMAP_DSS_COLOR_RGBX32:
-- 
1.6.6.1