UnifiedHMI: Update SRCREV for RVGPU and virtio-loopback-driver, and upgrade mesa...
[AGL/meta-agl-devel.git] / meta-uhmi / meta-rvgpu / recipes-graphics / remote-virtio-gpu / remote-virtio-gpu / 0001-Remove-some-rvgpu-command-options.patch
1 From fb9d1134906356b20ac698fca64a3c7de0dd111c Mon Sep 17 00:00:00 2001
2 From: Fumiya Kohzu <kohzu.fumiya@jp.panasonic.com>
3 Date: Mon, 20 Nov 2023 19:28:19 +0900
4 Subject: [PATCH] Remove some rvgpu command options
5
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.
9
10 Upstream-Status: Inappropriate [embedded specific]
11 ---
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(-)
17
18 diff --git a/include/rvgpu-proxy/gpu/rvgpu-gpu-device.h b/include/rvgpu-proxy/gpu/rvgpu-gpu-device.h
19 index 72adb07..29dc157 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;
23  
24  struct gpu_device_params {
25         bool split_resources;
26 -       int card_index;
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 0db2d7f..6b84a0a 100644
32 --- a/src/rvgpu-proxy/gpu/rvgpu-gpu-device.c
33 +++ b/src/rvgpu-proxy/gpu/rvgpu-gpu-device.c
34 @@ -655,7 +655,6 @@ struct gpu_device *gpu_device_init(int lo_fd, int efd, int capset,
35         if (capset != -1)
36                 gpu_capset_init(g, capset);
37  
38 -       info.card_index = params->card_index;
39         info.config = (__u8 *)&g->config;
40         info.config_kick = g->config_fd;
41  
42 @@ -1013,8 +1012,6 @@ static void gpu_device_trigger_vsync(struct gpu_device *g,
43                 return;
44  
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);
49  
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 b9958b8..b78ed1c 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 = {
65                 .framerate = 0u,
66                 .mem_limit = VMEM_DEFAULT_MB,
67 -               .card_index = -1,
68                 .num_scanouts = 0u,
69                 .dpys = { { .r = { .x = 0,
70                                    .y = 0,
71 @@ -97,38 +95,17 @@ int main(int argc, char **argv)
72         };
73  
74         pthread_t input_thread;
75 -       char path[64];
76         FILE *oomFile;
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;
80  
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) {
83                 switch (opt) {
84                 case 'c':
85                         capset = open(optarg, O_RDONLY);
86                         if (capset == -1)
87                                 err(1, "open %s", optarg);
88                         break;
89 -               case 'i':
90 -                       params.card_index =
91 -                               (int)sanity_strtonum(optarg, CARD_INDEX_MIN,
92 -                                                    CARD_INDEX_MAX - 1,
93 -                                                    &errstr);
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,
98 -                                    errstr);
99 -                       }
100 -
101 -                       snprintf(path, sizeof(path), "/dev/dri/card%d",
102 -                                params.card_index);
103 -                       res = access(path, F_OK);
104 -                       if (res == 0)
105 -                               errx(1, "device %s exists", path);
106 -                       else if (errno != ENOENT)
107 -                               err(1, "error while checking device %s", path);
108 -                       break;
109                 case 'M':
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 2757827..b21a168 100644
114 --- a/src/rvgpu-renderer/rvgpu-renderer.c
115 +++ b/src/rvgpu-renderer/rvgpu-renderer.c
116 @@ -53,7 +53,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",
119              RVGPU_DEFAULT_PORT);
120 -       info("\t-v\t\tRun in vsync mode (eglSwapInterval 1)\n");
121         info("\t-h\t\tShow this message\n");
122  
123         info("\nNote:\n");
124 @@ -186,13 +185,13 @@ 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;
131  
132         memset(sp, 0, sizeof(sp));
133         memset(&pp, 0, sizeof(pp));
134  
135 -       while ((opt = getopt(argc, argv, "afhvi:c:s:S:b:B:p:g:")) != -1) {
136 +       while ((opt = getopt(argc, argv, "afhi:c:s:S:b:B:p:g:")) != -1) {
137                 switch (opt) {
138                 case 'a':
139                         translucent = true;
140 @@ -271,9 +270,6 @@ int main(int argc, char **argv)
141                                      errstr);
142                         }
143                         break;
144 -               case 'v':
145 -                       vsync = true;
146 -                       break;
147                 case 'h':
148                         usage();
149                         exit(EXIT_SUCCESS);
150 @@ -311,7 +307,7 @@ int main(int argc, char **argv)
151         }
152  
153         while ((res_id = rvgpu_pr_dispatch(pr))) {
154 -               rvgpu_egl_drawall(egl, res_id, vsync);
155 +               rvgpu_egl_drawall(egl, res_id, false);
156         }
157  
158         if (pp.capset)
159 -- 
160 2.25.1
161