summaryrefslogtreecommitdiffstats
path: root/meta-uhmi/meta-rvgpu/recipes-graphics/remote-virtio-gpu/remote-virtio-gpu/0001-Remove-some-rvgpu-command-options.patch
blob: 044c84203b33a0cf7d1e4a0fe74c3e47f27a6385 (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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
From fb9d1134906356b20ac698fca64a3c7de0dd111c Mon Sep 17 00:00:00 2001
From: Fumiya Kohzu <kohzu.fumiya@jp.panasonic.com>
Date: Mon, 20 Nov 2023 19:28:19 +0900
Subject: [PATCH] Remove some rvgpu command options

Remove vsync and card_index option supports from remote-virtio-gpu,
because the kernel needs to be patched to run those options in
rvgpu-proxy and rvgpu-renderer.

Upstream-Status: Inappropriate [embedded specific]
---
 include/rvgpu-proxy/gpu/rvgpu-gpu-device.h |  1 -
 src/rvgpu-proxy/gpu/rvgpu-gpu-device.c     |  3 ---
 src/rvgpu-proxy/rvgpu-proxy.c              | 27 ++--------------------
 src/rvgpu-renderer/rvgpu-renderer.c        | 10 +++-----
 4 files changed, 5 insertions(+), 36 deletions(-)

diff --git a/include/rvgpu-proxy/gpu/rvgpu-gpu-device.h b/include/rvgpu-proxy/gpu/rvgpu-gpu-device.h
index 72adb07..29dc157 100644
--- a/include/rvgpu-proxy/gpu/rvgpu-gpu-device.h
+++ b/include/rvgpu-proxy/gpu/rvgpu-gpu-device.h
@@ -35,7 +35,6 @@ struct gpu_device;
 
 struct gpu_device_params {
 	bool split_resources;
-	int card_index;
 	unsigned int num_scanouts;
 	unsigned int mem_limit;
 	unsigned long framerate;
diff --git a/src/rvgpu-proxy/gpu/rvgpu-gpu-device.c b/src/rvgpu-proxy/gpu/rvgpu-gpu-device.c
index 0db2d7f..6b84a0a 100644
--- a/src/rvgpu-proxy/gpu/rvgpu-gpu-device.c
+++ b/src/rvgpu-proxy/gpu/rvgpu-gpu-device.c
@@ -655,7 +655,6 @@ struct gpu_device *gpu_device_init(int lo_fd, int efd, int capset,
 	if (capset != -1)
 		gpu_capset_init(g, capset);
 
-	info.card_index = params->card_index;
 	info.config = (__u8 *)&g->config;
 	info.config_kick = g->config_fd;
 
@@ -1013,8 +1012,6 @@ static void gpu_device_trigger_vsync(struct gpu_device *g,
 		return;
 
 	hdr->flags |= VIRTIO_GPU_FLAG_VSYNC;
-	/* use padding bytes to pass scanout_id to virtio-gpu driver */
-	hdr->padding = g->scan_id;
 	add_resp(g, hdr, req);
 
 	if ((!vsync_ts.tv_sec) && (!vsync_ts.tv_nsec)) {
diff --git a/src/rvgpu-proxy/rvgpu-proxy.c b/src/rvgpu-proxy/rvgpu-proxy.c
index b9958b8..b78ed1c 100644
--- a/src/rvgpu-proxy/rvgpu-proxy.c
+++ b/src/rvgpu-proxy/rvgpu-proxy.c
@@ -47,7 +47,6 @@ static void usage(void)
 	info("\t-s scanout\tspecify scanout in form WxH@X,Y (default: %ux%u@0,0)\n",
 	     DEFAULT_WIDTH, DEFAULT_HEIGHT);
 	info("\t-f rate\t\tspecify virtual framerate (default: disabled)\n");
-	info("\t-i index\tspecify index 'n' for device /dev/dri/card<n>\n");
 	info("\t-n\t\tserver:port for connecting (max 4 hosts, default: %s:%s)\n",
 	     RVGPU_DEFAULT_HOSTNAME, RVGPU_DEFAULT_PORT);
 	info("\t-h\t\tshow this message\n");
@@ -79,7 +78,6 @@ int main(int argc, char **argv)
 	struct gpu_device_params params = {
 		.framerate = 0u,
 		.mem_limit = VMEM_DEFAULT_MB,
-		.card_index = -1,
 		.num_scanouts = 0u,
 		.dpys = { { .r = { .x = 0,
 				   .y = 0,
@@ -97,38 +95,17 @@ int main(int argc, char **argv)
 	};
 
 	pthread_t input_thread;
-	char path[64];
 	FILE *oomFile;
-	int lo_fd, epoll_fd, res, opt, capset = -1;
+	int lo_fd, epoll_fd, opt, capset = -1;
 	char *ip, *port, *errstr = NULL;
 
-	while ((opt = getopt(argc, argv, "hi:n:M:c:R:f:s:")) != -1) {
+	while ((opt = getopt(argc, argv, "h:n:M:c:R:f:s:")) != -1) {
 		switch (opt) {
 		case 'c':
 			capset = open(optarg, O_RDONLY);
 			if (capset == -1)
 				err(1, "open %s", optarg);
 			break;
-		case 'i':
-			params.card_index =
-				(int)sanity_strtonum(optarg, CARD_INDEX_MIN,
-						     CARD_INDEX_MAX - 1,
-						     &errstr);
-			if (errstr != NULL) {
-				warnx("Card index should be in [%u..%u]\n",
-				      CARD_INDEX_MIN, CARD_INDEX_MAX - 1);
-				errx(1, "Invalid card index %s:%s", optarg,
-				     errstr);
-			}
-
-			snprintf(path, sizeof(path), "/dev/dri/card%d",
-				 params.card_index);
-			res = access(path, F_OK);
-			if (res == 0)
-				errx(1, "device %s exists", path);
-			else if (errno != ENOENT)
-				err(1, "error while checking device %s", path);
-			break;
 		case 'M':
 			params.mem_limit = (unsigned int)sanity_strtonum(
 				optarg, VMEM_MIN_MB, VMEM_MAX_MB, &errstr);
diff --git a/src/rvgpu-renderer/rvgpu-renderer.c b/src/rvgpu-renderer/rvgpu-renderer.c
index 2757827..b21a168 100644
--- a/src/rvgpu-renderer/rvgpu-renderer.c
+++ b/src/rvgpu-renderer/rvgpu-renderer.c
@@ -53,7 +53,6 @@ static void usage(void)
 	info("\t-f\t\tRun in fullscreen mode\n");
 	info("\t-p port\t\tport for listening (default: %u)\n",
 	     RVGPU_DEFAULT_PORT);
-	info("\t-v\t\tRun in vsync mode (eglSwapInterval 1)\n");
 	info("\t-h\t\tShow this message\n");
 
 	info("\nNote:\n");
@@ -186,13 +185,13 @@ int main(int argc, char **argv)
 	unsigned int res_id, scanout;
 	uint16_t port_nr = RVGPU_DEFAULT_PORT;
 	FILE *input_stream = stdout;
-	bool fullscreen = false, vsync = false, translucent = false,
+	bool fullscreen = false, translucent = false,
 	     user_specified_scanouts = false;
 
 	memset(sp, 0, sizeof(sp));
 	memset(&pp, 0, sizeof(pp));
 
-	while ((opt = getopt(argc, argv, "afhvi:c:s:S:b:B:p:g:")) != -1) {
+	while ((opt = getopt(argc, argv, "afhi:c:s:S:b:B:p:g:")) != -1) {
 		switch (opt) {
 		case 'a':
 			translucent = true;
@@ -271,9 +270,6 @@ int main(int argc, char **argv)
 				     errstr);
 			}
 			break;
-		case 'v':
-			vsync = true;
-			break;
 		case 'h':
 			usage();
 			exit(EXIT_SUCCESS);
@@ -311,7 +307,7 @@ int main(int argc, char **argv)
 	}
 
 	while ((res_id = rvgpu_pr_dispatch(pr))) {
-		rvgpu_egl_drawall(egl, res_id, vsync);
+		rvgpu_egl_drawall(egl, res_id, false);
 	}
 
 	if (pp.capset)
-- 
2.25.1