aboutsummaryrefslogtreecommitdiffstats
path: root/meta-rcar-gen3/recipes-multimedia/vspmif-module/files/0001-rcar_gen3-To-correspond-boards-that-do-not-support-F.patch
blob: 9067c6ed93ab669c52f8ffa091caa8faa16e6b09 (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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
From 1f4c6a71cb34b9f8ce5b65db290f4526e3ec8333 Mon Sep 17 00:00:00 2001
From: Sojiro Kusunoki <sojiro.kusunoki.zj@ps.hitachi-solutions.com>
Date: Thu, 18 Oct 2018 17:11:25 +0900
Subject: [PATCH] rcar_gen3: To correspond boards that do not support Full HD

Signed-off-by: Sojiro Kusunoki <sojiro.kusunoki.zj@ps.hitachi-solutions.com>
Signed-off-by: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
---
 vspm_if-tp-user/files/vspm_if/README.txt      |  2 +-
 vspm_if-tp-user/files/vspm_if/vspm_tp_lossy.c | 27 ++++++++++++++++++++++++---
 2 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/vspm_if-tp-user/files/vspm_if/README.txt b/vspm_if-tp-user/files/vspm_if/README.txt
index 79c86cb..6269c2b 100644
--- a/vspm_if-tp-user/files/vspm_if/README.txt
+++ b/vspm_if-tp-user/files/vspm_if/README.txt
@@ -15,7 +15,7 @@ Sample programs for VSP Manager
 
 # monitor
 
-	Please connect a HDMI monitor that supports Full HD or higher resolution.
+	Please connect a HDMI monitor.
 
 
 ## Sample programs
diff --git a/vspm_if-tp-user/files/vspm_if/vspm_tp_lossy.c b/vspm_if-tp-user/files/vspm_if/vspm_tp_lossy.c
index 2ce0390..7d49f08 100644
--- a/vspm_if-tp-user/files/vspm_if/vspm_tp_lossy.c
+++ b/vspm_if-tp-user/files/vspm_if/vspm_tp_lossy.c
@@ -280,8 +280,16 @@ static void output_fb(struct vspm_tp_private_t *priv)
 		return;
 	}
 
-	vinfo.xres = 1920;
-	vinfo.yres = 1080;
+	if (vinfo.xres_virtual > 1920)
+		vinfo.xres = 1920;
+	else
+		vinfo.xres = vinfo.xres_virtual;
+
+	if (vinfo.yres_virtual > 1080)
+		vinfo.yres = 1080;
+	else
+		vinfo.yres = vinfo.yres_virtual;
+
 	screensize = vinfo.xres * vinfo.yres * vinfo.bits_per_pixel / 8;
 
 	fbp = (char*)mmap(0, screensize, PROT_READ|PROT_WRITE, MAP_SHARED, fbfd, 0);
@@ -291,7 +299,20 @@ static void output_fb(struct vspm_tp_private_t *priv)
 		return;
 	}
 
-	memcpy(fbp, (unsigned char*)priv->out_virt, screensize);
+	if (vinfo.xres == 1920 && vinfo.yres == 1080) {
+		memcpy(fbp, (unsigned char*)priv->out_virt, screensize);
+	} else {
+		int i;
+		unsigned char *pto, *pfrom;
+
+		pto = (unsigned char *)fbp;
+		pfrom = (unsigned char *)priv->out_virt;
+		for (i = 0; i < vinfo.yres; i++) {
+			memcpy(pto, pfrom, vinfo.xres * vinfo.bits_per_pixel / 8);
+			pto += (vinfo.xres * vinfo.bits_per_pixel / 8);
+			pfrom += (1920 * 4);
+		}
+	}
 
 	ercd = ioctl(fbfd, FBIOPAN_DISPLAY, &vinfo);
 	if (ercd) {
-- 
1.9.1