1 From 0fc1cf03f76d21cec5b859ff46bee146cd4e52f7 Mon Sep 17 00:00:00 2001
2 From: murakami <murakami.kenta002@jp.panasonic.jp>
3 Date: Fri, 28 Jul 2023 12:09:35 +0900
4 Subject: [PATCH 1/2] Remove some rvgpu command options
6 Remove vsync and card_index option supports from remote-virtio-gpu,
7 because the kernel needs to be patched to run those options in
8 rvgpu-proxy and rvgpu-renderer.
10 Upstream-Status: Inappropriate [embedded specific]
12 include/rvgpu-proxy/gpu/rvgpu-gpu-device.h | 1 -
13 src/rvgpu-proxy/gpu/rvgpu-gpu-device.c | 3 ---
14 src/rvgpu-proxy/rvgpu-proxy.c | 27 ++--------------------
15 src/rvgpu-renderer/rvgpu-renderer.c | 10 +++-----
16 4 files changed, 5 insertions(+), 36 deletions(-)
18 diff --git a/include/rvgpu-proxy/gpu/rvgpu-gpu-device.h b/include/rvgpu-proxy/gpu/rvgpu-gpu-device.h
19 index eb34b6a..76d747a 100644
20 --- a/include/rvgpu-proxy/gpu/rvgpu-gpu-device.h
21 +++ b/include/rvgpu-proxy/gpu/rvgpu-gpu-device.h
22 @@ -35,7 +35,6 @@ struct gpu_device;
24 struct gpu_device_params {
27 unsigned int num_scanouts;
28 unsigned int mem_limit;
29 unsigned long framerate;
30 diff --git a/src/rvgpu-proxy/gpu/rvgpu-gpu-device.c b/src/rvgpu-proxy/gpu/rvgpu-gpu-device.c
31 index 947e81a..71f62ca 100644
32 --- a/src/rvgpu-proxy/gpu/rvgpu-gpu-device.c
33 +++ b/src/rvgpu-proxy/gpu/rvgpu-gpu-device.c
34 @@ -528,7 +528,6 @@ struct gpu_device *gpu_device_init(int lo_fd, int efd, uint32_t cidx,
36 gpu_capset_init(g, capset);
38 - info.card_index = params->card_index;
39 info.config = (__u8 *)&g->config;
40 info.config_kick = g->config_fd;
42 @@ -939,8 +938,6 @@ static void gpu_device_trigger_vsync(struct gpu_device *g,
45 hdr->flags |= VIRTIO_GPU_FLAG_VSYNC;
46 - /* use padding bytes to pass scanout_id to virtio-gpu driver */
47 - hdr->padding = g->scan_id;
48 add_resp(g, hdr, req);
50 if ((!vsync_ts.tv_sec) && (!vsync_ts.tv_nsec)) {
51 diff --git a/src/rvgpu-proxy/rvgpu-proxy.c b/src/rvgpu-proxy/rvgpu-proxy.c
52 index 6ff4e19..d082b72 100644
53 --- a/src/rvgpu-proxy/rvgpu-proxy.c
54 +++ b/src/rvgpu-proxy/rvgpu-proxy.c
55 @@ -47,7 +47,6 @@ static void usage(void)
56 info("\t-s scanout\tspecify scanout in form WxH@X,Y (default: %ux%u@0,0)\n",
57 DEFAULT_WIDTH, DEFAULT_HEIGHT);
58 info("\t-f rate\t\tspecify virtual framerate (default: disabled)\n");
59 - info("\t-i index\tspecify index 'n' for device /dev/dri/card<n>\n");
60 info("\t-n\t\tserver:port for connecting (max 4 hosts, default: %s:%s)\n",
61 RVGPU_DEFAULT_HOSTNAME, RVGPU_DEFAULT_PORT);
62 info("\t-h\t\tshow this message\n");
63 @@ -79,7 +78,6 @@ int main(int argc, char **argv)
64 struct gpu_device_params params = {
66 .mem_limit = VMEM_DEFAULT_MB,
69 .dpys = { { .r = { .x = 0,
71 @@ -97,38 +95,17 @@ int main(int argc, char **argv)
74 pthread_t input_thread;
77 - int lo_fd, epoll_fd, res, opt, capset = -1;
78 + int lo_fd, epoll_fd, opt, capset = -1;
79 char *ip, *port, *errstr = NULL;
81 - while ((opt = getopt(argc, argv, "hi:n:M:c:R:f:s:")) != -1) {
82 + while ((opt = getopt(argc, argv, "h:n:M:c:R:f:s:")) != -1) {
85 capset = open(optarg, O_RDONLY);
87 err(1, "open %s", optarg);
91 - (int)sanity_strtonum(optarg, CARD_INDEX_MIN,
94 - if (errstr != NULL) {
95 - warnx("Card index should be in [%u..%u]\n",
96 - CARD_INDEX_MIN, CARD_INDEX_MAX - 1);
97 - errx(1, "Invalid card index %s:%s", optarg,
101 - snprintf(path, sizeof(path), "/dev/dri/card%d",
102 - params.card_index);
103 - res = access(path, F_OK);
105 - errx(1, "device %s exists", path);
106 - else if (errno != ENOENT)
107 - err(1, "error while checking device %s", path);
110 params.mem_limit = (unsigned int)sanity_strtonum(
111 optarg, VMEM_MIN_MB, VMEM_MAX_MB, &errstr);
112 diff --git a/src/rvgpu-renderer/rvgpu-renderer.c b/src/rvgpu-renderer/rvgpu-renderer.c
113 index 7166fb9..3e74289 100644
114 --- a/src/rvgpu-renderer/rvgpu-renderer.c
115 +++ b/src/rvgpu-renderer/rvgpu-renderer.c
116 @@ -52,7 +52,6 @@ static void usage(void)
117 info("\t-f\t\tRun in fullscreen mode\n");
118 info("\t-p port\t\tport for listening (default: %u)\n",
120 - info("\t-v\t\tRun in vsync mode (eglSwapInterval 1)\n");
121 info("\t-h\t\tShow this message\n");
124 @@ -185,12 +184,12 @@ int main(int argc, char **argv)
125 unsigned int res_id, scanout;
126 uint16_t port_nr = RVGPU_DEFAULT_PORT;
127 FILE *input_stream = stdout;
128 - bool fullscreen = false, vsync = false, translucent = false,
129 + bool fullscreen = false, translucent = false,
130 user_specified_scanouts = false;
132 memset(sp, 0, sizeof(sp));
134 - while ((opt = getopt(argc, argv, "afhvi:c:s:S:b:B:p:g:")) != -1) {
135 + while ((opt = getopt(argc, argv, "afhi:c:s:S:b:B:p:g:")) != -1) {
139 @@ -269,9 +268,6 @@ int main(int argc, char **argv)
149 @@ -309,7 +305,7 @@ int main(int argc, char **argv)
152 while ((res_id = rvgpu_pr_dispatch(pr))) {
153 - rvgpu_egl_drawall(egl, res_id, vsync);
154 + rvgpu_egl_drawall(egl, res_id, false);