1 | This patchset adds DRM native context support to VirtIO-GPU on Qemu. | 1 | This patchset adds DRM native context support to VirtIO-GPU on Qemu. |
---|---|---|---|
2 | It's based on the pending Venus v17 patches [1] that bring host blobs | 2 | |
3 | support to virtio-gpu-gl device. | 3 | Contarary to Virgl and Venus contexts that mediates high level GFX APIs, |
4 | 4 | DRM native context [1] mediates lower level kernel driver UAPI, which | |
5 | [1] https://lore.kernel.org/qemu-devel/20240822185110.1757429-1-dmitry.osipenko@collabora.com/ | ||
6 | |||
7 | Contarary to Virgl and Venus contexts which mediate high level GFX APIs, | ||
8 | DRM native context [2] mediates lower level kernel driver UAPI, which | ||
9 | reflects in a less CPU overhead and less/simpler code needed to support it. | 5 | reflects in a less CPU overhead and less/simpler code needed to support it. |
10 | DRM context consists of a host and guest parts that have to be implemented | 6 | DRM context consists of a host and guest parts that have to be implemented |
11 | for each GPU driver. On a guest side, DRM context presents a virtual GPU as | 7 | for each GPU driver. On a guest side, DRM context presents a virtual GPU as |
12 | a real/native host GPU device for GL/VK applications. | 8 | a real/native host GPU device for GL/VK applications. |
13 | 9 | ||
14 | [2] https://www.youtube.com/watch?v=9sFP_yddLLQ | 10 | [1] https://www.youtube.com/watch?v=9sFP_yddLLQ |
15 | 11 | ||
16 | Today there are four known DRM native context drivers existing in a wild: | 12 | Today there are four DRM native context drivers existing in a wild: |
17 | 13 | ||
18 | - Freedreno (Qualcomm SoC GPUs), completely upstreamed | 14 | - Freedreno (Qualcomm SoC GPUs), completely upstreamed |
19 | - AMDGPU, mostly merged into upstreams | 15 | - AMDGPU, completely upstreamed |
20 | - Intel (i915), merge requests are opened | 16 | - Intel (i915), merge requests are opened |
21 | - Asahi (Apple SoC GPUs), WIP status | 17 | - Asahi (Apple SoC GPUs), partially merged upstream |
22 | |||
23 | 18 | ||
24 | # How to try out DRM context: | 19 | # How to try out DRM context: |
25 | 20 | ||
26 | 1. Like Venus and Virgl context, DRM context requires applying WIP | 21 | 1. DRM context uses host blobs and on host requires latest 6.13 version |
27 | KVM patches [3] to host kernel, otherwise mapping of GPU memory blobs | 22 | of Linux kernel that contains necessary KVM fixes. |
28 | will likely fail. | 23 | |
29 | 24 | 2. Use latest Mesa (both guest and host) and libvirglrenderer versions. | |
30 | [3] https://lore.kernel.org/all/20240726235234.228822-1-seanjc@google.com/ | 25 | Use build flags documented in tha patch #10 of this series. |
31 | 26 | ||
32 | 2. Use latest libvirglrenderer from upstream git/main for Freedreno | 27 | 3. On guest, use latest Linux kernel v6.14-rc or newer. |
33 | and AMDGPU native contexts. For Intel use patches [4]. | ||
34 | |||
35 | [4] https://gitlab.freedesktop.org/virgl/virglrenderer/-/merge_requests/1384 | ||
36 | |||
37 | 3. On guest, use latest Mesa version for Freedreno. For AMDGPU use | ||
38 | Mesa patches [5], for Intel [6]. | ||
39 | |||
40 | [5] https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21658 | ||
41 | [6] https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29870 | ||
42 | |||
43 | 4. On guest, use latest Linux kernel v6.6+. | ||
44 | 28 | ||
45 | Example Qemu cmdline that enables DRM context: | 29 | Example Qemu cmdline that enables DRM context: |
46 | 30 | ||
47 | qemu-system-x86_64 -device virtio-vga-gl,hostmem=4G,blob=true,drm=true \ | 31 | qemu-system-x86_64 -device virtio-vga-gl,hostmem=4G,blob=on,drm_native_context=on \ |
48 | -machine q35,accel=kvm,memory-backend=mem1 \ | 32 | -machine q35,accel=kvm,memory-backend=mem1 \ |
49 | -object memory-backend-memfd,id=mem1,size=8G -m 8G | 33 | -object memory-backend-memfd,id=mem1,size=8G -m 8G |
50 | 34 | ||
51 | |||
52 | # Note about known performance problem in Qemu: | 35 | # Note about known performance problem in Qemu: |
53 | 36 | ||
54 | DRM contexts are mapping host blobs extensively and these mapping | 37 | DRM contexts are mapping host blobs extensively and these mapping |
55 | operations work slowly in Qemu. Exact reason is unkown. Mappings work | 38 | operations work slowly in Qemu. We will need to optimize hostmem |
56 | fast on Crosvm For DRM contexts this problem is more visible than for | 39 | unmapping that currently happens in a deffered RCU work, blocking |
57 | Venus/Virgl. | 40 | GPU for a substantial time [2]. |
58 | 41 | ||
59 | Dmitry Osipenko (5): | 42 | [2] https://lore.kernel.org/qemu-devel/f58d250d-3831-4ff1-a018-f62f9aeb2527@collabora.com/T/#m17ac72336d28a64c793d4e4e0c87fc7dff9aa847 |
43 | |||
44 | Changelog: | ||
45 | |||
46 | v11:- Added column for libvirglrenderer host requrements versions and | ||
47 | corrected Asahi kernel link. Suggested by Akihiko Odaki. | ||
48 | |||
49 | v10:- Added links to Asahi and i915 virglrenderer MRs, link to Asahi host | ||
50 | kernel. Suggested by Akihiko Odaki. | ||
51 | |||
52 | - Renamed gfxstream guest requrements table's colum to match the host | ||
53 | requirements table. Suggested by Akihiko Odaki. | ||
54 | |||
55 | v9: - Updated doc patch by addresing review comments from Akihiko Odaki. | ||
56 | Made kernel requirements section specific to guest kernel and | ||
57 | removed reference to host requirements. Removed examples of | ||
58 | external projects' build flags. | ||
59 | |||
60 | - Added guest kernel minimum versions to the guest requirements table. | ||
61 | |||
62 | v8: - Addressed review comments from Akihiko Odaki on the doc patch. | ||
63 | |||
64 | - Added r-bs from Akihiko Odaki on the doc patches. | ||
65 | |||
66 | - Extended vrend doc with info about hostmem requirement for GL 4.6 | ||
67 | |||
68 | v7: - Added r-b from Alex Bennée to the async fencing patch. | ||
69 | |||
70 | - Updated virtio-gpu doc patch with addressed review comments | ||
71 | from Akihiko Odaki. | ||
72 | |||
73 | v6: - Fixed compilation warning using older version of virglrenderer, | ||
74 | which wasn't fixed properly in v5. | ||
75 | |||
76 | - Added t-bs from Alex Bennée. | ||
77 | |||
78 | - Added patches to improve virgl/venus doc by adding links | ||
79 | to the Mesa doc as was suggested by Akihiko Odaki. | ||
80 | |||
81 | - Updated patch that documents guest/host requirements. Added | ||
82 | links to Asahi nctx and reworked the doc structure by adding | ||
83 | requirements to each context-type section instead of having | ||
84 | one big blob or requirements, which was objected by Akihiko Odaki. | ||
85 | |||
86 | v5: - Added r-bs from Akihiko Odaki. | ||
87 | |||
88 | - Added acks from Michael Tsirkin. | ||
89 | |||
90 | - Fixed compilation warning using older version of virglrenderer that | ||
91 | was reported by Alex Bennée. Noticed that I need to keep old | ||
92 | virgl_write_fence() code around for the older virglrenderer in | ||
93 | "Support asynchronous fencing" patch, so added it back and verified | ||
94 | that old virglrenderer works properly. | ||
95 | |||
96 | - Added new patch from Alex Bennée that adds more virtio-gpu | ||
97 | documentation with a couple corrections and additions to it from me. | ||
98 | |||
99 | - Rebased patches on top of latest staging tree. | ||
100 | |||
101 | v4: - Improved SDL2/dmabuf patch by reusing existing Meson X11 config | ||
102 | option, better handling EGL error and extending comment telling | ||
103 | that it's safe to enable SDL2 EGL preference hint. As was suggested | ||
104 | by Akihiko Odaki. | ||
105 | |||
106 | - Replaced another QSLIST_FOREACH_SAFE with QSLIST_EMPTY+FIRST in | ||
107 | the async-fencing patch for more consistency of the code. As was | ||
108 | suggested by Akihiko Odaki. | ||
109 | |||
110 | - Added missing braces around if-statement that was spotted by | ||
111 | Alex Bennée. | ||
112 | |||
113 | - Renamed 'drm=on' option of virtio-gpu-gl device to | ||
114 | 'drm_native_context=on' for more clarity as was suggested by | ||
115 | Alex Bennée. Haven't added added new context-type option that | ||
116 | was also proposed by Alex, might do it with a separate patch. | ||
117 | This context-type option will duplicate and depecate existing | ||
118 | options, but in a longer run likely will be worthwhile adding | ||
119 | it. | ||
120 | |||
121 | - Dropped Linux headers-update patch as headers has been updated | ||
122 | in the staging tree. | ||
123 | |||
124 | v3: - Improved EGL presence-check code on X11 systems for the SDL2 | ||
125 | hint that prefers EGL over GLX by using better ifdefs and checking | ||
126 | Xlib presence at a build time to avoid build failure if lib SDL2 | ||
127 | and system are configured with a disabled X11 support. Also added | ||
128 | clarifying comment telling that X11 hint doesn't affect Wayland | ||
129 | systems. Suggested by Akihiko Odaki. | ||
130 | |||
131 | - Corrected strerror(err) that used negative error where it should | ||
132 | be positive and vice versa that was caught by Akihiko Odaki. Added | ||
133 | clarifying comment for the case where we get positive error code | ||
134 | from virglrenderer that differs from other virglrenderer API functions. | ||
135 | |||
136 | - Improved QSLIST usage by dropping mutex protecting the async fence | ||
137 | list and using atomic variant of QSLIST helpers instead. Switched away | ||
138 | from using FOREACH helper to improve readability of the code, showing | ||
139 | that we don't precess list in unoptimal way. Like was suggested by | ||
140 | Akihiko Odaki. | ||
141 | |||
142 | - Updated patchset base to Venus v18. | ||
143 | |||
144 | v2: - Updated SDL2-dmabuf patch by making use of error_report() and | ||
145 | checking presense of X11+EGL in the system before making SDL2 | ||
146 | to prefer EGL backend over GLX, suggested by Akihiko Odaki. | ||
147 | |||
148 | - Improved SDL2's dmabuf-presence check that wasn't done properly | ||
149 | in v1, where EGL was set up only after first console was fully | ||
150 | inited, and thus, SDL's display .has_dmabuf callback didn't work | ||
151 | for the first console. Now dmabuf support status is pre-checked | ||
152 | before console is registered. | ||
153 | |||
154 | - Updated commit description of the patch that fixes SDL2's context | ||
155 | switching logic with a more detailed explanation of the problem. | ||
156 | Suggested by Akihiko Odaki. | ||
157 | |||
158 | - Corrected rebase typo in the async-fencing patch and switched | ||
159 | async-fencing to use a sigle-linked list instead of the double, | ||
160 | as was suggested by Akihiko Odaki. | ||
161 | |||
162 | - Replaced "=true" with "=on" in the DRM native context documentation | ||
163 | example and made virtio_gpu_virgl_init() to fail with a error message | ||
164 | if DRM context can't be initialized instead of giving a warning | ||
165 | message, as was suggested by Akihiko Odaki. | ||
166 | |||
167 | - Added patchew's dependecy tag to the cover letter as was suggested by | ||
168 | Akihiko Odaki. | ||
169 | |||
170 | Alex Bennée (1): | ||
171 | docs/system: virtio-gpu: Document host/guest requirements | ||
172 | |||
173 | Dmitry Osipenko (8): | ||
60 | ui/sdl2: Restore original context after new context creation | 174 | ui/sdl2: Restore original context after new context creation |
61 | linux-headers: Update to Linux v6.12-rc1 | ||
62 | virtio-gpu: Handle virgl fence creation errors | 175 | virtio-gpu: Handle virgl fence creation errors |
63 | virtio-gpu: Support asynchronous fencing | 176 | virtio-gpu: Support asynchronous fencing |
64 | virtio-gpu: Support DRM native context | 177 | virtio-gpu: Support DRM native context |
178 | ui/sdl2: Don't disable scanout when display is refreshed | ||
179 | ui/gtk: Don't disable scanout when display is refreshed | ||
180 | docs/system: virtio-gpu: Add link to Mesa VirGL doc | ||
181 | docs/system: virtio-gpu: Update Venus link | ||
65 | 182 | ||
66 | Pierre-Eric Pelloux-Prayer (1): | 183 | Pierre-Eric Pelloux-Prayer (1): |
67 | ui/sdl2: Implement dpy dmabuf functions | 184 | ui/sdl2: Implement dpy dmabuf functions |
68 | 185 | ||
69 | docs/system/devices/virtio-gpu.rst | 11 + | 186 | docs/system/devices/virtio-gpu.rst | 117 +++++++++++++++++++- |
70 | hw/display/virtio-gpu-gl.c | 5 + | 187 | hw/display/virtio-gpu-gl.c | 5 + |
71 | hw/display/virtio-gpu-virgl.c | 153 ++++++++++-- | 188 | hw/display/virtio-gpu-virgl.c | 164 ++++++++++++++++++++++++++++- |
72 | hw/display/virtio-gpu.c | 15 ++ | 189 | hw/display/virtio-gpu.c | 15 +++ |
73 | include/hw/virtio/virtio-gpu.h | 17 ++ | 190 | include/hw/virtio/virtio-gpu.h | 16 +++ |
74 | include/standard-headers/drm/drm_fourcc.h | 43 ++++ | 191 | include/ui/sdl2.h | 7 ++ |
75 | include/standard-headers/linux/const.h | 17 ++ | 192 | meson.build | 6 +- |
76 | include/standard-headers/linux/ethtool.h | 226 ++++++++++++++++++ | 193 | ui/gtk-egl.c | 1 - |
77 | include/standard-headers/linux/fuse.h | 22 +- | 194 | ui/gtk-gl-area.c | 1 - |
78 | .../linux/input-event-codes.h | 2 + | 195 | ui/sdl2-gl.c | 68 +++++++++++- |
79 | include/standard-headers/linux/pci_regs.h | 41 +++- | 196 | ui/sdl2.c | 42 ++++++++ |
80 | .../standard-headers/linux/virtio_balloon.h | 16 +- | 197 | 11 files changed, 429 insertions(+), 13 deletions(-) |
81 | include/standard-headers/linux/virtio_gpu.h | 1 + | ||
82 | include/ui/sdl2.h | 5 + | ||
83 | linux-headers/asm-arm64/mman.h | 9 + | ||
84 | linux-headers/asm-arm64/unistd.h | 25 +- | ||
85 | linux-headers/asm-generic/unistd.h | 6 +- | ||
86 | linux-headers/asm-loongarch/kvm.h | 24 ++ | ||
87 | linux-headers/asm-loongarch/unistd.h | 4 +- | ||
88 | linux-headers/asm-riscv/kvm.h | 7 + | ||
89 | linux-headers/asm-riscv/unistd.h | 41 +--- | ||
90 | linux-headers/asm-x86/kvm.h | 2 + | ||
91 | linux-headers/asm-x86/unistd_64.h | 1 + | ||
92 | linux-headers/asm-x86/unistd_x32.h | 1 + | ||
93 | linux-headers/linux/bits.h | 3 + | ||
94 | linux-headers/linux/const.h | 17 ++ | ||
95 | linux-headers/linux/iommufd.h | 143 +++++++++-- | ||
96 | linux-headers/linux/kvm.h | 23 +- | ||
97 | linux-headers/linux/mman.h | 1 + | ||
98 | linux-headers/linux/psp-sev.h | 28 +++ | ||
99 | ui/sdl2-gl.c | 42 ++++ | ||
100 | ui/sdl2.c | 8 + | ||
101 | 32 files changed, 851 insertions(+), 108 deletions(-) | ||
102 | 198 | ||
103 | -- | 199 | -- |
104 | 2.46.0 | 200 | 2.48.1 |
201 | |||
202 | diff view generated by jsdifflib |
1 | SDL API changes GL context to a newly created GL context, which differs | 1 | SDL API changes GL context to a newly created GL context, which differs |
---|---|---|---|
2 | from other GL providers that don't switch context. Change SDL backend to | 2 | from other GL providers that don't switch context. Change SDL backend to |
3 | restore the original GL context. This allows Qemu's virtio-gpu to support | 3 | restore the original GL context. This allows Qemu's virtio-gpu to support |
4 | new virglrenderer async-fencing feature for Virgl context, otherwise it's | 4 | new virglrenderer async-fencing feature for Virgl contexts, otherwise |
5 | impossible for virglrenderer to switch GL context from a thread that waits | 5 | virglrenderer's vrend creates a fence-sync context on the Qemu's |
6 | for async-fences. | 6 | main-loop thread that erroneously stays in-use by the main-loop after |
7 | creation, not allowing vrend's fence-sync thread switch to this new | ||
8 | context that belongs to it. | ||
7 | 9 | ||
10 | Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com> | ||
11 | Acked-by: Michael S. Tsirkin <mst@redhat.com> | ||
12 | Tested-by: Alex Bennée <alex.bennee@linaro.org> | ||
8 | Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> | 13 | Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> |
9 | --- | 14 | --- |
10 | ui/sdl2-gl.c | 3 +++ | 15 | ui/sdl2-gl.c | 3 +++ |
11 | 1 file changed, 3 insertions(+) | 16 | 1 file changed, 3 insertions(+) |
12 | 17 | ||
... | ... | ||
23 | + | 28 | + |
24 | return (QEMUGLContext)ctx; | 29 | return (QEMUGLContext)ctx; |
25 | } | 30 | } |
26 | 31 | ||
27 | -- | 32 | -- |
28 | 2.46.0 | 33 | 2.48.1 |
34 | |||
35 | diff view generated by jsdifflib |
... | ... | ||
---|---|---|---|
4 | doing copies. | 4 | doing copies. |
5 | 5 | ||
6 | To get this working on X11, we use the existing SDL hint: | 6 | To get this working on X11, we use the existing SDL hint: |
7 | SDL_HINT_VIDEO_X11_FORCE_EGL (because dmabuf can't be used with GLX). | 7 | SDL_HINT_VIDEO_X11_FORCE_EGL (because dmabuf can't be used with GLX). |
8 | 8 | ||
9 | Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com> | ||
10 | Acked-by: Michael S. Tsirkin <mst@redhat.com> | ||
11 | Tested-by: Alex Bennée <alex.bennee@linaro.org> | ||
9 | Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> | 12 | Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> |
10 | Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> | 13 | Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> |
11 | --- | 14 | --- |
12 | include/ui/sdl2.h | 5 +++++ | 15 | include/ui/sdl2.h | 7 ++++++ |
13 | ui/sdl2-gl.c | 39 +++++++++++++++++++++++++++++++++++++++ | 16 | meson.build | 6 ++--- |
14 | ui/sdl2.c | 8 ++++++++ | 17 | ui/sdl2-gl.c | 64 +++++++++++++++++++++++++++++++++++++++++++++++ |
15 | 3 files changed, 52 insertions(+) | 18 | ui/sdl2.c | 42 +++++++++++++++++++++++++++++++ |
19 | 4 files changed, 115 insertions(+), 4 deletions(-) | ||
16 | 20 | ||
17 | diff --git a/include/ui/sdl2.h b/include/ui/sdl2.h | 21 | diff --git a/include/ui/sdl2.h b/include/ui/sdl2.h |
18 | index XXXXXXX..XXXXXXX 100644 | 22 | index XXXXXXX..XXXXXXX 100644 |
19 | --- a/include/ui/sdl2.h | 23 | --- a/include/ui/sdl2.h |
20 | +++ b/include/ui/sdl2.h | 24 | +++ b/include/ui/sdl2.h |
25 | @@ -XXX,XX +XXX,XX @@ struct sdl2_console { | ||
26 | bool gui_keysym; | ||
27 | SDL_GLContext winctx; | ||
28 | QKbdState *kbd; | ||
29 | + bool has_dmabuf; | ||
30 | #ifdef CONFIG_OPENGL | ||
31 | QemuGLShader *gls; | ||
32 | egl_fb guest_fb; | ||
21 | @@ -XXX,XX +XXX,XX @@ void sdl2_gl_scanout_texture(DisplayChangeListener *dcl, | 33 | @@ -XXX,XX +XXX,XX @@ void sdl2_gl_scanout_texture(DisplayChangeListener *dcl, |
22 | void *d3d_tex2d); | 34 | void *d3d_tex2d); |
23 | void sdl2_gl_scanout_flush(DisplayChangeListener *dcl, | 35 | void sdl2_gl_scanout_flush(DisplayChangeListener *dcl, |
24 | uint32_t x, uint32_t y, uint32_t w, uint32_t h); | 36 | uint32_t x, uint32_t y, uint32_t w, uint32_t h); |
25 | +void sdl2_gl_scanout_dmabuf(DisplayChangeListener *dcl, | 37 | +void sdl2_gl_scanout_dmabuf(DisplayChangeListener *dcl, |
26 | + QemuDmaBuf *dmabuf); | 38 | + QemuDmaBuf *dmabuf); |
27 | +void sdl2_gl_release_dmabuf(DisplayChangeListener *dcl, | 39 | +void sdl2_gl_release_dmabuf(DisplayChangeListener *dcl, |
28 | + QemuDmaBuf *dmabuf); | 40 | + QemuDmaBuf *dmabuf); |
29 | +bool sdl2_gl_has_dmabuf(DisplayChangeListener *dcl); | 41 | +bool sdl2_gl_has_dmabuf(DisplayChangeListener *dcl); |
42 | +void sdl2_gl_console_init(struct sdl2_console *scon); | ||
30 | 43 | ||
31 | #endif /* SDL2_H */ | 44 | #endif /* SDL2_H */ |
45 | diff --git a/meson.build b/meson.build | ||
46 | index XXXXXXX..XXXXXXX 100644 | ||
47 | --- a/meson.build | ||
48 | +++ b/meson.build | ||
49 | @@ -XXX,XX +XXX,XX @@ if get_option('gtk') \ | ||
50 | endif | ||
51 | endif | ||
52 | |||
53 | -x11 = not_found | ||
54 | -if gtkx11.found() | ||
55 | - x11 = dependency('x11', method: 'pkg-config', required: gtkx11.found()) | ||
56 | -endif | ||
57 | +x11 = dependency('x11', method: 'pkg-config', required: gtkx11.found()) | ||
58 | + | ||
59 | png = not_found | ||
60 | if get_option('png').allowed() and have_system | ||
61 | png = dependency('libpng', version: '>=1.6.34', required: get_option('png'), | ||
32 | diff --git a/ui/sdl2-gl.c b/ui/sdl2-gl.c | 62 | diff --git a/ui/sdl2-gl.c b/ui/sdl2-gl.c |
33 | index XXXXXXX..XXXXXXX 100644 | 63 | index XXXXXXX..XXXXXXX 100644 |
34 | --- a/ui/sdl2-gl.c | 64 | --- a/ui/sdl2-gl.c |
35 | +++ b/ui/sdl2-gl.c | 65 | +++ b/ui/sdl2-gl.c |
36 | @@ -XXX,XX +XXX,XX @@ | 66 | @@ -XXX,XX +XXX,XX @@ |
37 | */ | 67 | */ |
38 | 68 | ||
39 | #include "qemu/osdep.h" | 69 | #include "qemu/osdep.h" |
40 | +#include "qemu/main-loop.h" | 70 | +#include "qemu/main-loop.h" |
71 | +#include "qemu/error-report.h" | ||
41 | #include "ui/console.h" | 72 | #include "ui/console.h" |
42 | #include "ui/input.h" | 73 | #include "ui/input.h" |
43 | #include "ui/sdl2.h" | 74 | #include "ui/sdl2.h" |
44 | @@ -XXX,XX +XXX,XX @@ void sdl2_gl_scanout_texture(DisplayChangeListener *dcl, | 75 | @@ -XXX,XX +XXX,XX @@ void sdl2_gl_scanout_flush(DisplayChangeListener *dcl, |
45 | backing_id, false); | 76 | |
77 | SDL_GL_SwapWindow(scon->real_window); | ||
46 | } | 78 | } |
47 | 79 | + | |
48 | +void sdl2_gl_scanout_dmabuf(DisplayChangeListener *dcl, | 80 | +void sdl2_gl_scanout_dmabuf(DisplayChangeListener *dcl, |
49 | + QemuDmaBuf *dmabuf) | 81 | + QemuDmaBuf *dmabuf) |
50 | +{ | 82 | +{ |
51 | + struct sdl2_console *scon = container_of(dcl, struct sdl2_console, dcl); | 83 | + struct sdl2_console *scon = container_of(dcl, struct sdl2_console, dcl); |
52 | + | 84 | + |
53 | + assert(scon->opengl); | 85 | + assert(scon->opengl); |
54 | + SDL_GL_MakeCurrent(scon->real_window, scon->winctx); | 86 | + SDL_GL_MakeCurrent(scon->real_window, scon->winctx); |
55 | + | 87 | + |
56 | + egl_dmabuf_import_texture(dmabuf); | 88 | + egl_dmabuf_import_texture(dmabuf); |
57 | + if (!qemu_dmabuf_get_texture(dmabuf)) { | 89 | + if (!qemu_dmabuf_get_texture(dmabuf)) { |
58 | + fprintf(stderr, "sdl2_gl_scanout_dmabuf failed fd=%d\n", | 90 | + error_report("%s: failed fd=%d", __func__, qemu_dmabuf_get_fd(dmabuf)); |
59 | + qemu_dmabuf_get_fd(dmabuf)); | 91 | + return; |
60 | + } | 92 | + } |
61 | + | 93 | + |
62 | + sdl2_gl_scanout_texture(dcl, qemu_dmabuf_get_texture(dmabuf), false, | 94 | + sdl2_gl_scanout_texture(dcl, qemu_dmabuf_get_texture(dmabuf), false, |
63 | + qemu_dmabuf_get_width(dmabuf), | 95 | + qemu_dmabuf_get_width(dmabuf), |
64 | + qemu_dmabuf_get_height(dmabuf), | 96 | + qemu_dmabuf_get_height(dmabuf), |
... | ... | ||
78 | + egl_dmabuf_release_texture(dmabuf); | 110 | + egl_dmabuf_release_texture(dmabuf); |
79 | +} | 111 | +} |
80 | + | 112 | + |
81 | +bool sdl2_gl_has_dmabuf(DisplayChangeListener *dcl) | 113 | +bool sdl2_gl_has_dmabuf(DisplayChangeListener *dcl) |
82 | +{ | 114 | +{ |
83 | + return qemu_egl_has_dmabuf(); | 115 | + struct sdl2_console *scon = container_of(dcl, struct sdl2_console, dcl); |
84 | +} | 116 | + |
85 | + | 117 | + return scon->has_dmabuf; |
86 | void sdl2_gl_scanout_flush(DisplayChangeListener *dcl, | 118 | +} |
87 | uint32_t x, uint32_t y, uint32_t w, uint32_t h) | 119 | + |
88 | { | 120 | +void sdl2_gl_console_init(struct sdl2_console *scon) |
121 | +{ | ||
122 | + bool hidden = scon->hidden; | ||
123 | + | ||
124 | + scon->hidden = true; | ||
125 | + scon->surface = qemu_create_displaysurface(1, 1); | ||
126 | + sdl2_window_create(scon); | ||
127 | + | ||
128 | + /* | ||
129 | + * QEMU checks whether console supports dma-buf before switching | ||
130 | + * to the console. To break this chicken-egg problem we pre-check | ||
131 | + * dma-buf availability beforehand using a dummy SDL window. | ||
132 | + */ | ||
133 | + scon->has_dmabuf = qemu_egl_has_dmabuf(); | ||
134 | + | ||
135 | + sdl2_window_destroy(scon); | ||
136 | + qemu_free_displaysurface(scon->surface); | ||
137 | + | ||
138 | + scon->surface = NULL; | ||
139 | + scon->hidden = hidden; | ||
140 | +} | ||
89 | diff --git a/ui/sdl2.c b/ui/sdl2.c | 141 | diff --git a/ui/sdl2.c b/ui/sdl2.c |
90 | index XXXXXXX..XXXXXXX 100644 | 142 | index XXXXXXX..XXXXXXX 100644 |
91 | --- a/ui/sdl2.c | 143 | --- a/ui/sdl2.c |
92 | +++ b/ui/sdl2.c | 144 | +++ b/ui/sdl2.c |
145 | @@ -XXX,XX +XXX,XX @@ | ||
146 | #include "qemu/log.h" | ||
147 | #include "qemu-main.h" | ||
148 | |||
149 | +#ifdef CONFIG_X11 | ||
150 | +#include <X11/Xlib.h> | ||
151 | +#endif | ||
152 | + | ||
153 | static int sdl2_num_outputs; | ||
154 | static struct sdl2_console *sdl2_console; | ||
155 | |||
93 | @@ -XXX,XX +XXX,XX @@ void sdl2_window_create(struct sdl2_console *scon) | 156 | @@ -XXX,XX +XXX,XX @@ void sdl2_window_create(struct sdl2_console *scon) |
94 | /* The SDL renderer is only used by sdl2-2D, when OpenGL is disabled */ | 157 | /* The SDL renderer is only used by sdl2-2D, when OpenGL is disabled */ |
95 | scon->real_renderer = SDL_CreateRenderer(scon->real_window, -1, 0); | 158 | scon->real_renderer = SDL_CreateRenderer(scon->real_window, -1, 0); |
96 | } | 159 | } |
97 | + | 160 | + |
... | ... | ||
109 | + .dpy_gl_release_dmabuf = sdl2_gl_release_dmabuf, | 172 | + .dpy_gl_release_dmabuf = sdl2_gl_release_dmabuf, |
110 | + .dpy_has_dmabuf = sdl2_gl_has_dmabuf, | 173 | + .dpy_has_dmabuf = sdl2_gl_has_dmabuf, |
111 | }; | 174 | }; |
112 | 175 | ||
113 | static bool | 176 | static bool |
177 | @@ -XXX,XX +XXX,XX @@ static void sdl2_display_early_init(DisplayOptions *o) | ||
178 | } | ||
179 | } | ||
180 | |||
181 | +static void sdl2_set_hint_x11_force_egl(void) | ||
182 | +{ | ||
183 | +#if defined(SDL_HINT_VIDEO_X11_FORCE_EGL) && defined(CONFIG_OPENGL) && \ | ||
184 | + defined(CONFIG_X11) | ||
185 | + Display *x_disp = XOpenDisplay(NULL); | ||
186 | + EGLDisplay egl_display; | ||
187 | + | ||
188 | + if (!x_disp) { | ||
189 | + return; | ||
190 | + } | ||
191 | + | ||
192 | + /* Prefer EGL over GLX to get dma-buf support. */ | ||
193 | + egl_display = eglGetDisplay((EGLNativeDisplayType)x_disp); | ||
194 | + | ||
195 | + if (egl_display != EGL_NO_DISPLAY) { | ||
196 | + /* | ||
197 | + * Setting X11_FORCE_EGL hint doesn't make SDL to prefer X11 over | ||
198 | + * Wayland. SDL will use Wayland driver even if XWayland presents. | ||
199 | + * It's always safe to set the hint even if X11 is not used by SDL. | ||
200 | + * SDL will work regardless of the hint. | ||
201 | + */ | ||
202 | + SDL_SetHint(SDL_HINT_VIDEO_X11_FORCE_EGL, "1"); | ||
203 | + eglTerminate(egl_display); | ||
204 | + } | ||
205 | + | ||
206 | + XCloseDisplay(x_disp); | ||
207 | +#endif | ||
208 | +} | ||
209 | + | ||
210 | static void sdl2_display_init(DisplayState *ds, DisplayOptions *o) | ||
211 | { | ||
212 | uint8_t data = 0; | ||
114 | @@ -XXX,XX +XXX,XX @@ static void sdl2_display_init(DisplayState *ds, DisplayOptions *o) | 213 | @@ -XXX,XX +XXX,XX @@ static void sdl2_display_init(DisplayState *ds, DisplayOptions *o) |
115 | SDL_SetHint(SDL_HINT_ALLOW_ALT_TAB_WHILE_GRABBED, "0"); | 214 | SDL_SetHint(SDL_HINT_ALLOW_ALT_TAB_WHILE_GRABBED, "0"); |
116 | #endif | 215 | #endif |
117 | SDL_SetHint(SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4, "1"); | 216 | SDL_SetHint(SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4, "1"); |
118 | + SDL_SetHint(SDL_HINT_VIDEO_X11_FORCE_EGL, "1"); | 217 | + sdl2_set_hint_x11_force_egl(); |
119 | SDL_EnableScreenSaver(); | 218 | SDL_EnableScreenSaver(); |
120 | memset(&info, 0, sizeof(info)); | 219 | memset(&info, 0, sizeof(info)); |
121 | SDL_VERSION(&info.version); | 220 | SDL_VERSION(&info.version); |
221 | @@ -XXX,XX +XXX,XX @@ static void sdl2_display_init(DisplayState *ds, DisplayOptions *o) | ||
222 | sdl2_console[i].kbd = qkbd_state_init(con); | ||
223 | if (display_opengl) { | ||
224 | qemu_console_set_display_gl_ctx(con, &sdl2_console[i].dgc); | ||
225 | + sdl2_gl_console_init(&sdl2_console[i]); | ||
226 | } | ||
227 | register_displaychangelistener(&sdl2_console[i].dcl); | ||
228 | |||
122 | -- | 229 | -- |
123 | 2.46.0 | 230 | 2.48.1 |
231 | |||
232 | diff view generated by jsdifflib |
1 | Print out error messages when virgl fence creation fails to aid debugging | 1 | Print out error messages when virgl fence creation fails to aid debugging |
---|---|---|---|
2 | of the fence-related bugs. | 2 | of the fence-related bugs. |
3 | 3 | ||
4 | Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com> | ||
5 | Acked-by: Michael S. Tsirkin <mst@redhat.com> | ||
6 | Tested-by: Alex Bennée <alex.bennee@linaro.org> | ||
4 | Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> | 7 | Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> |
5 | --- | 8 | --- |
6 | hw/display/virtio-gpu-virgl.c | 8 +++++++- | 9 | hw/display/virtio-gpu-virgl.c | 13 ++++++++++++- |
7 | 1 file changed, 7 insertions(+), 1 deletion(-) | 10 | 1 file changed, 12 insertions(+), 1 deletion(-) |
8 | 11 | ||
9 | diff --git a/hw/display/virtio-gpu-virgl.c b/hw/display/virtio-gpu-virgl.c | 12 | diff --git a/hw/display/virtio-gpu-virgl.c b/hw/display/virtio-gpu-virgl.c |
10 | index XXXXXXX..XXXXXXX 100644 | 13 | index XXXXXXX..XXXXXXX 100644 |
11 | --- a/hw/display/virtio-gpu-virgl.c | 14 | --- a/hw/display/virtio-gpu-virgl.c |
12 | +++ b/hw/display/virtio-gpu-virgl.c | 15 | +++ b/hw/display/virtio-gpu-virgl.c |
... | ... | ||
22 | } | 25 | } |
23 | 26 | ||
24 | trace_virtio_gpu_fence_ctrl(cmd->cmd_hdr.fence_id, cmd->cmd_hdr.type); | 27 | trace_virtio_gpu_fence_ctrl(cmd->cmd_hdr.fence_id, cmd->cmd_hdr.type); |
25 | - virgl_renderer_create_fence(cmd->cmd_hdr.fence_id, cmd->cmd_hdr.type); | 28 | - virgl_renderer_create_fence(cmd->cmd_hdr.fence_id, cmd->cmd_hdr.type); |
26 | + | 29 | + |
30 | + /* | ||
31 | + * Unlike other virglrenderer functions, this one returns a positive | ||
32 | + * error code. | ||
33 | + */ | ||
27 | + ret = virgl_renderer_create_fence(cmd->cmd_hdr.fence_id, 0); | 34 | + ret = virgl_renderer_create_fence(cmd->cmd_hdr.fence_id, 0); |
28 | + if (ret) | 35 | + if (ret) { |
29 | + qemu_log_mask(LOG_GUEST_ERROR, | 36 | + qemu_log_mask(LOG_GUEST_ERROR, |
30 | + "%s: virgl_renderer_create_fence error: %s", | 37 | + "%s: virgl_renderer_create_fence error: %s", |
31 | + __func__, strerror(-ret)); | 38 | + __func__, strerror(ret)); |
39 | + } | ||
32 | } | 40 | } |
33 | 41 | ||
34 | static void virgl_write_fence(void *opaque, uint32_t fence) | 42 | static void virgl_write_fence(void *opaque, uint32_t fence) |
35 | -- | 43 | -- |
36 | 2.46.0 | 44 | 2.48.1 |
45 | |||
46 | diff view generated by jsdifflib |
1 | Support asynchronous fencing feature of virglrenderer. It allows Qemu to | 1 | Support asynchronous fencing feature of virglrenderer. It allows Qemu to |
---|---|---|---|
2 | handle fence as soon as it's signalled instead of periodically polling | 2 | handle fence as soon as it's signalled instead of periodically polling |
3 | the fence status. This feature is required for enabling DRM context | 3 | the fence status. This feature is required for enabling DRM context |
4 | support in Qemu because legacy fencing mode isn't supported for DRM | 4 | support in Qemu because legacy fencing mode isn't supported for DRM |
5 | contexts in virglrenderer. | 5 | contexts in virglrenderer. |
6 | 6 | ||
7 | Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com> | ||
8 | Acked-by: Michael S. Tsirkin <mst@redhat.com> | ||
9 | Tested-by: Alex Bennée <alex.bennee@linaro.org> | ||
10 | Reviewed-by: Alex Bennée <alex.bennee@linaro.org> | ||
7 | Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> | 11 | Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> |
8 | --- | 12 | --- |
9 | hw/display/virtio-gpu-gl.c | 3 + | 13 | hw/display/virtio-gpu-gl.c | 3 + |
10 | hw/display/virtio-gpu-virgl.c | 143 ++++++++++++++++++++++++++++----- | 14 | hw/display/virtio-gpu-virgl.c | 147 +++++++++++++++++++++++++++++++-- |
11 | include/hw/virtio/virtio-gpu.h | 14 ++++ | 15 | include/hw/virtio/virtio-gpu.h | 13 +++ |
12 | 3 files changed, 141 insertions(+), 19 deletions(-) | 16 | 3 files changed, 154 insertions(+), 9 deletions(-) |
13 | 17 | ||
14 | diff --git a/hw/display/virtio-gpu-gl.c b/hw/display/virtio-gpu-gl.c | 18 | diff --git a/hw/display/virtio-gpu-gl.c b/hw/display/virtio-gpu-gl.c |
15 | index XXXXXXX..XXXXXXX 100644 | 19 | index XXXXXXX..XXXXXXX 100644 |
16 | --- a/hw/display/virtio-gpu-gl.c | 20 | --- a/hw/display/virtio-gpu-gl.c |
17 | +++ b/hw/display/virtio-gpu-gl.c | 21 | +++ b/hw/display/virtio-gpu-gl.c |
... | ... | ||
39 | 43 | ||
40 | @@ -XXX,XX +XXX,XX @@ void virtio_gpu_virgl_process_cmd(VirtIOGPU *g, | 44 | @@ -XXX,XX +XXX,XX @@ void virtio_gpu_virgl_process_cmd(VirtIOGPU *g, |
41 | 45 | ||
42 | trace_virtio_gpu_fence_ctrl(cmd->cmd_hdr.fence_id, cmd->cmd_hdr.type); | 46 | trace_virtio_gpu_fence_ctrl(cmd->cmd_hdr.fence_id, cmd->cmd_hdr.type); |
43 | 47 | ||
48 | - /* | ||
49 | - * Unlike other virglrenderer functions, this one returns a positive | ||
50 | - * error code. | ||
51 | - */ | ||
44 | - ret = virgl_renderer_create_fence(cmd->cmd_hdr.fence_id, 0); | 52 | - ret = virgl_renderer_create_fence(cmd->cmd_hdr.fence_id, 0); |
45 | - if (ret) | 53 | - if (ret) { |
46 | - qemu_log_mask(LOG_GUEST_ERROR, | 54 | - qemu_log_mask(LOG_GUEST_ERROR, |
47 | - "%s: virgl_renderer_create_fence error: %s", | 55 | - "%s: virgl_renderer_create_fence error: %s", |
48 | - __func__, strerror(-ret)); | 56 | - __func__, strerror(ret)); |
49 | + if (gl->context_fence_enabled && | 57 | + if (gl->context_fence_enabled && |
50 | + (cmd->cmd_hdr.flags & VIRTIO_GPU_FLAG_INFO_RING_IDX)) { | 58 | + (cmd->cmd_hdr.flags & VIRTIO_GPU_FLAG_INFO_RING_IDX)) { |
59 | +#if VIRGL_VERSION_MAJOR >= 1 | ||
51 | + uint32_t flags = 0; | 60 | + uint32_t flags = 0; |
52 | + | 61 | + |
53 | + ret = virgl_renderer_context_create_fence(cmd->cmd_hdr.ctx_id, flags, | 62 | + ret = virgl_renderer_context_create_fence(cmd->cmd_hdr.ctx_id, flags, |
54 | + cmd->cmd_hdr.ring_idx, | 63 | + cmd->cmd_hdr.ring_idx, |
55 | + cmd->cmd_hdr.fence_id); | 64 | + cmd->cmd_hdr.fence_id); |
56 | + if (ret) | 65 | + if (ret) { |
57 | + qemu_log_mask(LOG_GUEST_ERROR, | 66 | + qemu_log_mask(LOG_GUEST_ERROR, |
58 | + "%s: virgl_renderer_context_create_fence error: %s", | 67 | + "%s: virgl_renderer_context_create_fence error: %s", |
59 | + __func__, strerror(ret)); | 68 | + __func__, strerror(-ret)); |
69 | + } | ||
70 | +#else | ||
71 | + /* gl->context_fence_enabled cannot be set with older virglrenderer */ | ||
72 | + g_assert_not_reached(); | ||
73 | +#endif | ||
60 | + } else { | 74 | + } else { |
75 | + /* | ||
76 | + * Unlike other virglrenderer functions, this one returns a positive | ||
77 | + * error code. | ||
78 | + */ | ||
61 | + ret = virgl_renderer_create_fence(cmd->cmd_hdr.fence_id, 0); | 79 | + ret = virgl_renderer_create_fence(cmd->cmd_hdr.fence_id, 0); |
62 | + if (ret) | 80 | + if (ret) { |
63 | + qemu_log_mask(LOG_GUEST_ERROR, | 81 | + qemu_log_mask(LOG_GUEST_ERROR, |
64 | + "%s: virgl_renderer_create_fence error: %s", | 82 | + "%s: virgl_renderer_create_fence error: %s", |
65 | + __func__, strerror(-ret)); | 83 | + __func__, strerror(ret)); |
84 | + } | ||
85 | } | ||
86 | } | ||
87 | |||
88 | @@ -XXX,XX +XXX,XX @@ static void virgl_write_fence(void *opaque, uint32_t fence) | ||
89 | } | ||
90 | } | ||
91 | |||
92 | +void virtio_gpu_virgl_reset_async_fences(VirtIOGPU *g) | ||
93 | +{ | ||
94 | + struct virtio_gpu_virgl_context_fence *f; | ||
95 | + VirtIOGPUGL *gl = VIRTIO_GPU_GL(g); | ||
96 | + | ||
97 | + while (!QSLIST_EMPTY(&gl->async_fenceq)) { | ||
98 | + f = QSLIST_FIRST(&gl->async_fenceq); | ||
99 | + | ||
100 | + QSLIST_REMOVE_HEAD(&gl->async_fenceq, next); | ||
101 | + | ||
102 | + g_free(f); | ||
66 | + } | 103 | + } |
67 | } | 104 | +} |
68 | 105 | + | |
69 | -static void virgl_write_fence(void *opaque, uint32_t fence) | 106 | +#if VIRGL_VERSION_MAJOR >= 1 |
70 | +static void virtio_gpu_virgl_async_fence_bh(void *opaque) | 107 | +static void virtio_gpu_virgl_async_fence_bh(void *opaque) |
71 | { | 108 | +{ |
72 | - VirtIOGPU *g = opaque; | 109 | + QSLIST_HEAD(, virtio_gpu_virgl_context_fence) async_fenceq; |
73 | + struct virtio_gpu_virgl_context_fence *f, *f_tmp; | 110 | + struct virtio_gpu_ctrl_command *cmd, *tmp; |
74 | struct virtio_gpu_ctrl_command *cmd, *tmp; | 111 | + struct virtio_gpu_virgl_context_fence *f; |
75 | + VirtIOGPU *g = opaque; | 112 | + VirtIOGPU *g = opaque; |
76 | + VirtIOGPUGL *gl = VIRTIO_GPU_GL(g); | 113 | + VirtIOGPUGL *gl = VIRTIO_GPU_GL(g); |
77 | 114 | + | |
78 | - QTAILQ_FOREACH_SAFE(cmd, &g->fenceq, next, tmp) { | 115 | + QSLIST_MOVE_ATOMIC(&async_fenceq, &gl->async_fenceq); |
79 | - /* | 116 | + |
80 | - * the guest can end up emitting fences out of order | 117 | + while (!QSLIST_EMPTY(&async_fenceq)) { |
81 | - * so we should check all fenced cmds not just the first one. | 118 | + f = QSLIST_FIRST(&async_fenceq); |
82 | - */ | 119 | + |
83 | - if (cmd->cmd_hdr.fence_id > fence) { | 120 | + QSLIST_REMOVE_HEAD(&async_fenceq, next); |
84 | - continue; | 121 | + |
85 | + qemu_mutex_lock(&gl->async_fence_lock); | ||
86 | + | ||
87 | + QTAILQ_FOREACH_SAFE(f, &gl->async_fenceq, next, f_tmp) { | ||
88 | + QTAILQ_FOREACH_SAFE(cmd, &g->fenceq, next, tmp) { | 122 | + QTAILQ_FOREACH_SAFE(cmd, &g->fenceq, next, tmp) { |
89 | + /* | 123 | + /* |
90 | + * the guest can end up emitting fences out of order | 124 | + * the guest can end up emitting fences out of order |
91 | + * so we should check all fenced cmds not just the first one. | 125 | + * so we should check all fenced cmds not just the first one. |
92 | + */ | 126 | + */ |
... | ... | ||
105 | + continue; | 139 | + continue; |
106 | + } | 140 | + } |
107 | + virtio_gpu_ctrl_response_nodata(g, cmd, VIRTIO_GPU_RESP_OK_NODATA); | 141 | + virtio_gpu_ctrl_response_nodata(g, cmd, VIRTIO_GPU_RESP_OK_NODATA); |
108 | + QTAILQ_REMOVE(&g->fenceq, cmd, next); | 142 | + QTAILQ_REMOVE(&g->fenceq, cmd, next); |
109 | + g_free(cmd); | 143 | + g_free(cmd); |
110 | } | 144 | + } |
111 | - trace_virtio_gpu_fence_resp(cmd->cmd_hdr.fence_id); | ||
112 | - virtio_gpu_ctrl_response_nodata(g, cmd, VIRTIO_GPU_RESP_OK_NODATA); | ||
113 | - QTAILQ_REMOVE(&g->fenceq, cmd, next); | ||
114 | - g_free(cmd); | ||
115 | + | 145 | + |
116 | + trace_virtio_gpu_fence_resp(f->fence_id); | 146 | + trace_virtio_gpu_fence_resp(f->fence_id); |
117 | + QTAILQ_REMOVE(&gl->async_fenceq, f, next); | ||
118 | + g_free(f); | 147 | + g_free(f); |
119 | g->inflight--; | 148 | + g->inflight--; |
120 | if (virtio_gpu_stats_enabled(g->parent_obj.conf)) { | 149 | + if (virtio_gpu_stats_enabled(g->parent_obj.conf)) { |
121 | - trace_virtio_gpu_dec_inflight_fences(g->inflight); | 150 | + trace_virtio_gpu_dec_inflight_fences(g->inflight); |
122 | + fprintf(stderr, "inflight: %3d (-)\r", g->inflight); | 151 | + } |
123 | } | ||
124 | } | ||
125 | + | ||
126 | + qemu_mutex_unlock(&gl->async_fence_lock); | ||
127 | +} | ||
128 | + | ||
129 | +void virtio_gpu_virgl_reset_async_fences(VirtIOGPU *g) | ||
130 | +{ | ||
131 | + struct virtio_gpu_virgl_context_fence *f, *f_tmp; | ||
132 | + VirtIOGPUGL *gl = VIRTIO_GPU_GL(g); | ||
133 | + | ||
134 | + QTAILQ_FOREACH_SAFE(f, &gl->async_fenceq, next, f_tmp) { | ||
135 | + QTAILQ_REMOVE(&gl->async_fenceq, f, next); | ||
136 | + g_free(f); | ||
137 | + } | 152 | + } |
138 | +} | 153 | +} |
139 | + | 154 | + |
140 | +static void | 155 | +static void |
141 | +virtio_gpu_virgl_push_async_fence(VirtIOGPU *g, uint32_t ctx_id, | 156 | +virtio_gpu_virgl_push_async_fence(VirtIOGPU *g, uint32_t ctx_id, |
... | ... | ||
147 | + f = g_new(struct virtio_gpu_virgl_context_fence, 1); | 162 | + f = g_new(struct virtio_gpu_virgl_context_fence, 1); |
148 | + f->ctx_id = ctx_id; | 163 | + f->ctx_id = ctx_id; |
149 | + f->ring_idx = ring_idx; | 164 | + f->ring_idx = ring_idx; |
150 | + f->fence_id = fence_id; | 165 | + f->fence_id = fence_id; |
151 | + | 166 | + |
152 | + qemu_mutex_lock(&gl->async_fence_lock); | 167 | + QSLIST_INSERT_HEAD_ATOMIC(&gl->async_fenceq, f, next); |
153 | + QTAILQ_INSERT_TAIL(&gl->async_fenceq, f, next); | ||
154 | + qemu_mutex_unlock(&gl->async_fence_lock); | ||
155 | + | 168 | + |
156 | + qemu_bh_schedule(gl->async_fence_bh); | 169 | + qemu_bh_schedule(gl->async_fence_bh); |
157 | +} | 170 | +} |
158 | + | 171 | + |
159 | +static void virgl_write_fence(void *opaque, uint32_t fence) | 172 | +static void virgl_write_async_fence(void *opaque, uint32_t fence) |
160 | +{ | 173 | +{ |
161 | + VirtIOGPU *g = opaque; | 174 | + VirtIOGPU *g = opaque; |
162 | + | 175 | + |
163 | + virtio_gpu_virgl_push_async_fence(g, 0, -1, fence); | 176 | + virtio_gpu_virgl_push_async_fence(g, 0, -1, fence); |
164 | +} | 177 | +} |
165 | + | 178 | + |
166 | +static void virgl_write_context_fence(void *opaque, uint32_t ctx_id, | 179 | +static void virgl_write_async_context_fence(void *opaque, uint32_t ctx_id, |
167 | + uint32_t ring_idx, uint64_t fence) | 180 | + uint32_t ring_idx, uint64_t fence) |
168 | +{ | 181 | +{ |
169 | + VirtIOGPU *g = opaque; | 182 | + VirtIOGPU *g = opaque; |
170 | + | 183 | + |
171 | + virtio_gpu_virgl_push_async_fence(g, ctx_id, ring_idx, fence); | 184 | + virtio_gpu_virgl_push_async_fence(g, ctx_id, ring_idx, fence); |
172 | } | 185 | +} |
173 | 186 | +#endif | |
187 | + | ||
174 | static virgl_renderer_gl_context | 188 | static virgl_renderer_gl_context |
189 | virgl_create_context(void *opaque, int scanout_idx, | ||
190 | struct virgl_renderer_gl_ctx_param *params) | ||
175 | @@ -XXX,XX +XXX,XX @@ void virtio_gpu_virgl_reset_scanout(VirtIOGPU *g) | 191 | @@ -XXX,XX +XXX,XX @@ void virtio_gpu_virgl_reset_scanout(VirtIOGPU *g) |
176 | dpy_gfx_replace_surface(g->parent_obj.scanout[i].con, NULL); | 192 | dpy_gfx_replace_surface(g->parent_obj.scanout[i].con, NULL); |
177 | dpy_gl_scanout_disable(g->parent_obj.scanout[i].con); | 193 | dpy_gl_scanout_disable(g->parent_obj.scanout[i].con); |
178 | } | 194 | } |
179 | + | 195 | + |
... | ... | ||
184 | @@ -XXX,XX +XXX,XX @@ int virtio_gpu_virgl_init(VirtIOGPU *g) | 200 | @@ -XXX,XX +XXX,XX @@ int virtio_gpu_virgl_init(VirtIOGPU *g) |
185 | if (qemu_egl_display) { | 201 | if (qemu_egl_display) { |
186 | virtio_gpu_3d_cbs.version = 4; | 202 | virtio_gpu_3d_cbs.version = 4; |
187 | virtio_gpu_3d_cbs.get_egl_display = virgl_get_egl_display; | 203 | virtio_gpu_3d_cbs.get_egl_display = virgl_get_egl_display; |
188 | +#if VIRGL_VERSION_MAJOR >= 1 | 204 | +#if VIRGL_VERSION_MAJOR >= 1 |
189 | + virtio_gpu_3d_cbs.write_context_fence = virgl_write_context_fence; | 205 | + virtio_gpu_3d_cbs.write_fence = virgl_write_async_fence; |
206 | + virtio_gpu_3d_cbs.write_context_fence = virgl_write_async_context_fence; | ||
190 | + flags |= VIRGL_RENDERER_ASYNC_FENCE_CB; | 207 | + flags |= VIRGL_RENDERER_ASYNC_FENCE_CB; |
191 | + flags |= VIRGL_RENDERER_THREAD_SYNC; | 208 | + flags |= VIRGL_RENDERER_THREAD_SYNC; |
192 | + gl->context_fence_enabled = true; | 209 | + gl->context_fence_enabled = true; |
193 | +#endif | 210 | +#endif |
194 | } | 211 | } |
... | ... | ||
200 | g); | 217 | g); |
201 | + | 218 | + |
202 | + gl->async_fence_bh = aio_bh_new(qemu_get_aio_context(), | 219 | + gl->async_fence_bh = aio_bh_new(qemu_get_aio_context(), |
203 | + virtio_gpu_virgl_async_fence_bh, | 220 | + virtio_gpu_virgl_async_fence_bh, |
204 | + g); | 221 | + g); |
205 | + | 222 | #endif |
206 | + qemu_mutex_init(&gl->async_fence_lock); | ||
207 | + QTAILQ_INIT(&gl->async_fenceq); | ||
208 | #endif | ||
209 | 223 | ||
210 | return 0; | 224 | return 0; |
211 | @@ -XXX,XX +XXX,XX @@ GArray *virtio_gpu_virgl_get_capsets(VirtIOGPU *g) | ||
212 | } | ||
213 | } | ||
214 | |||
215 | + if (virtio_gpu_drm_enabled(g->parent_obj.conf)) { | ||
216 | + virgl_renderer_get_cap_set(VIRTIO_GPU_CAPSET_DRM, | ||
217 | + &capset_max_ver, | ||
218 | + &capset_max_size); | ||
219 | + if (capset_max_size) { | ||
220 | + virtio_gpu_virgl_add_capset(capset_ids, VIRTIO_GPU_CAPSET_DRM); | ||
221 | + } | ||
222 | + } | ||
223 | + | ||
224 | return capset_ids; | ||
225 | } | ||
226 | diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h | 225 | diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h |
227 | index XXXXXXX..XXXXXXX 100644 | 226 | index XXXXXXX..XXXXXXX 100644 |
228 | --- a/include/hw/virtio/virtio-gpu.h | 227 | --- a/include/hw/virtio/virtio-gpu.h |
229 | +++ b/include/hw/virtio/virtio-gpu.h | 228 | +++ b/include/hw/virtio/virtio-gpu.h |
230 | @@ -XXX,XX +XXX,XX @@ struct VirtIOGPUClass { | 229 | @@ -XXX,XX +XXX,XX @@ struct VirtIOGPUClass { |
... | ... | ||
233 | 232 | ||
234 | +struct virtio_gpu_virgl_context_fence { | 233 | +struct virtio_gpu_virgl_context_fence { |
235 | + uint32_t ctx_id; | 234 | + uint32_t ctx_id; |
236 | + int64_t ring_idx; | 235 | + int64_t ring_idx; |
237 | + uint64_t fence_id; | 236 | + uint64_t fence_id; |
238 | + QTAILQ_ENTRY(virtio_gpu_virgl_context_fence) next; | 237 | + QSLIST_ENTRY(virtio_gpu_virgl_context_fence) next; |
239 | +}; | 238 | +}; |
240 | + | 239 | + |
241 | /* VirtIOGPUGL renderer states */ | 240 | /* VirtIOGPUGL renderer states */ |
242 | typedef enum { | 241 | typedef enum { |
243 | RS_START, /* starting state */ | 242 | RS_START, /* starting state */ |
244 | @@ -XXX,XX +XXX,XX @@ struct VirtIOGPUGL { | 243 | @@ -XXX,XX +XXX,XX @@ struct VirtIOGPUGL { |
245 | QEMUTimer *print_stats; | 244 | QEMUTimer *print_stats; |
246 | 245 | ||
247 | QEMUBH *cmdq_resume_bh; | 246 | QEMUBH *cmdq_resume_bh; |
248 | + | 247 | + |
249 | + QEMUBH *async_fence_bh; | 248 | + QEMUBH *async_fence_bh; |
250 | + QemuMutex async_fence_lock; | 249 | + QSLIST_HEAD(, virtio_gpu_virgl_context_fence) async_fenceq; |
251 | + QTAILQ_HEAD(, virtio_gpu_virgl_context_fence) async_fenceq; | ||
252 | + | 250 | + |
253 | + bool context_fence_enabled; | 251 | + bool context_fence_enabled; |
254 | }; | 252 | }; |
255 | 253 | ||
256 | struct VhostUserGPU { | 254 | struct VhostUserGPU { |
... | ... | ||
260 | GArray *virtio_gpu_virgl_get_capsets(VirtIOGPU *g); | 258 | GArray *virtio_gpu_virgl_get_capsets(VirtIOGPU *g); |
261 | +void virtio_gpu_virgl_reset_async_fences(VirtIOGPU *g); | 259 | +void virtio_gpu_virgl_reset_async_fences(VirtIOGPU *g); |
262 | 260 | ||
263 | #endif | 261 | #endif |
264 | -- | 262 | -- |
265 | 2.46.0 | 263 | 2.48.1 |
264 | |||
265 | diff view generated by jsdifflib |
1 | Add support for DRM native contexts to VirtIO-GPU. DRM context is enabled | 1 | Add support for DRM native contexts to VirtIO-GPU. DRM context is enabled |
---|---|---|---|
2 | using a new virtio-gpu-gl device option "drm=true". | 2 | using a new virtio-gpu-gl device option "drm_native_context=on". |
3 | 3 | ||
4 | Unlike Virgl and Venus contexts that operate on application API level, | 4 | Unlike Virgl and Venus contexts that operate on application API level, |
5 | DRM native contexts work on a kernel UAPI level. This lower level results | 5 | DRM native contexts work on a kernel UAPI level. This lower level results |
6 | in a lightweight context implementations that yield better performance. | 6 | in a lightweight context implementations that yield better performance. |
7 | 7 | ||
8 | Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com> | ||
9 | Acked-by: Michael S. Tsirkin <mst@redhat.com> | ||
10 | Tested-by: Alex Bennée <alex.bennee@linaro.org> | ||
8 | Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> | 11 | Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> |
9 | --- | 12 | --- |
10 | docs/system/devices/virtio-gpu.rst | 11 +++++++++++ | 13 | docs/system/devices/virtio-gpu.rst | 11 +++++++++++ |
11 | hw/display/virtio-gpu-gl.c | 2 ++ | 14 | hw/display/virtio-gpu-gl.c | 2 ++ |
12 | hw/display/virtio-gpu-virgl.c | 12 ++++++++++++ | 15 | hw/display/virtio-gpu-virgl.c | 22 ++++++++++++++++++++++ |
13 | hw/display/virtio-gpu.c | 15 +++++++++++++++ | 16 | hw/display/virtio-gpu.c | 15 +++++++++++++++ |
14 | include/hw/virtio/virtio-gpu.h | 3 +++ | 17 | include/hw/virtio/virtio-gpu.h | 3 +++ |
15 | 5 files changed, 43 insertions(+) | 18 | 5 files changed, 53 insertions(+) |
16 | 19 | ||
17 | diff --git a/docs/system/devices/virtio-gpu.rst b/docs/system/devices/virtio-gpu.rst | 20 | diff --git a/docs/system/devices/virtio-gpu.rst b/docs/system/devices/virtio-gpu.rst |
18 | index XXXXXXX..XXXXXXX 100644 | 21 | index XXXXXXX..XXXXXXX 100644 |
19 | --- a/docs/system/devices/virtio-gpu.rst | 22 | --- a/docs/system/devices/virtio-gpu.rst |
20 | +++ b/docs/system/devices/virtio-gpu.rst | 23 | +++ b/docs/system/devices/virtio-gpu.rst |
21 | @@ -XXX,XX +XXX,XX @@ of virtio-gpu host memory window. This is typically between 256M and 8G. | 24 | @@ -XXX,XX +XXX,XX @@ of virtio-gpu host memory window. This is typically between 256M and 8G. |
22 | 25 | ||
23 | .. _venus: https://gitlab.freedesktop.org/virgl/venus-protocol/ | 26 | .. _venus: https://gitlab.freedesktop.org/virgl/venus-protocol/ |
24 | 27 | ||
25 | +DRM native context is supported since release of `virglrenderer`_ v1.0.0 | 28 | +DRM native context is supported since release of `virglrenderer`_ v1.0.0 |
26 | +using `drm`_ protocol. ``DRM`` virtio-gpu capability set ("capset") requires | 29 | +using `drm`_ protocol. ``DRM`` virtio-gpu capability set ("capset") requires |
27 | +host blob support (``hostmem`` and ``blob`` fields) and should be enabled | 30 | +host blob support (``hostmem`` and ``blob`` fields) and should be enabled |
28 | +using ``drm`` field. The ``hostmem`` field specifies the size of virtio-gpu | 31 | +using ``drm_native_context`` field. The ``hostmem`` field specifies the size |
29 | +host memory window. This is typically between 256M and 8G. | 32 | +of virtio-gpu host memory window. This is typically between 256M and 8G. |
30 | + | 33 | + |
31 | +.. parsed-literal:: | 34 | +.. parsed-literal:: |
32 | + -device virtio-gpu-gl,hostmem=8G,blob=true,drm=true | 35 | + -device virtio-gpu-gl,hostmem=8G,blob=on,drm_native_context=on |
33 | + | 36 | + |
34 | +.. _drm: https://gitlab.freedesktop.org/virgl/virglrenderer/-/tree/main/src/drm | 37 | +.. _drm: https://gitlab.freedesktop.org/virgl/virglrenderer/-/tree/main/src/drm |
35 | + | 38 | + |
36 | virtio-gpu rutabaga | 39 | virtio-gpu rutabaga |
37 | ------------------- | 40 | ------------------- |
38 | 41 | ||
39 | diff --git a/hw/display/virtio-gpu-gl.c b/hw/display/virtio-gpu-gl.c | 42 | diff --git a/hw/display/virtio-gpu-gl.c b/hw/display/virtio-gpu-gl.c |
40 | index XXXXXXX..XXXXXXX 100644 | 43 | index XXXXXXX..XXXXXXX 100644 |
41 | --- a/hw/display/virtio-gpu-gl.c | 44 | --- a/hw/display/virtio-gpu-gl.c |
42 | +++ b/hw/display/virtio-gpu-gl.c | 45 | +++ b/hw/display/virtio-gpu-gl.c |
43 | @@ -XXX,XX +XXX,XX @@ static Property virtio_gpu_gl_properties[] = { | 46 | @@ -XXX,XX +XXX,XX @@ static const Property virtio_gpu_gl_properties[] = { |
44 | VIRTIO_GPU_FLAG_STATS_ENABLED, false), | 47 | VIRTIO_GPU_FLAG_STATS_ENABLED, false), |
45 | DEFINE_PROP_BIT("venus", VirtIOGPU, parent_obj.conf.flags, | 48 | DEFINE_PROP_BIT("venus", VirtIOGPU, parent_obj.conf.flags, |
46 | VIRTIO_GPU_FLAG_VENUS_ENABLED, false), | 49 | VIRTIO_GPU_FLAG_VENUS_ENABLED, false), |
47 | + DEFINE_PROP_BIT("drm", VirtIOGPU, parent_obj.conf.flags, | 50 | + DEFINE_PROP_BIT("drm_native_context", VirtIOGPU, parent_obj.conf.flags, |
48 | + VIRTIO_GPU_FLAG_DRM_ENABLED, false), | 51 | + VIRTIO_GPU_FLAG_DRM_ENABLED, false), |
49 | DEFINE_PROP_END_OF_LIST(), | ||
50 | }; | 52 | }; |
51 | 53 | ||
54 | static void virtio_gpu_gl_device_unrealize(DeviceState *qdev) | ||
52 | diff --git a/hw/display/virtio-gpu-virgl.c b/hw/display/virtio-gpu-virgl.c | 55 | diff --git a/hw/display/virtio-gpu-virgl.c b/hw/display/virtio-gpu-virgl.c |
53 | index XXXXXXX..XXXXXXX 100644 | 56 | index XXXXXXX..XXXXXXX 100644 |
54 | --- a/hw/display/virtio-gpu-virgl.c | 57 | --- a/hw/display/virtio-gpu-virgl.c |
55 | +++ b/hw/display/virtio-gpu-virgl.c | 58 | +++ b/hw/display/virtio-gpu-virgl.c |
56 | @@ -XXX,XX +XXX,XX @@ int virtio_gpu_virgl_init(VirtIOGPU *g) | 59 | @@ -XXX,XX +XXX,XX @@ int virtio_gpu_virgl_init(VirtIOGPU *g) |
... | ... | ||
64 | + /* | 67 | + /* |
65 | + * Virglrenderer skips enabling DRM context support without | 68 | + * Virglrenderer skips enabling DRM context support without |
66 | + * enabled async-fence feature. VirtIO-GPU will initialize | 69 | + * enabled async-fence feature. VirtIO-GPU will initialize |
67 | + * successfully, but DRM context won't be available in guest. | 70 | + * successfully, but DRM context won't be available in guest. |
68 | + */ | 71 | + */ |
69 | + warn_report("DRM native context requires EGL display"); | 72 | + error_report("DRM native context requires EGL display"); |
73 | + return -EINVAL; | ||
70 | + } | 74 | + } |
71 | + } | 75 | + } |
72 | #endif | 76 | #endif |
73 | 77 | ||
74 | ret = virgl_renderer_init(g, flags, &virtio_gpu_3d_cbs); | 78 | ret = virgl_renderer_init(g, flags, &virtio_gpu_3d_cbs); |
79 | @@ -XXX,XX +XXX,XX @@ GArray *virtio_gpu_virgl_get_capsets(VirtIOGPU *g) | ||
80 | } | ||
81 | } | ||
82 | |||
83 | + if (virtio_gpu_drm_enabled(g->parent_obj.conf)) { | ||
84 | + virgl_renderer_get_cap_set(VIRTIO_GPU_CAPSET_DRM, | ||
85 | + &capset_max_ver, | ||
86 | + &capset_max_size); | ||
87 | + if (capset_max_size) { | ||
88 | + virtio_gpu_virgl_add_capset(capset_ids, VIRTIO_GPU_CAPSET_DRM); | ||
89 | + } | ||
90 | + } | ||
91 | + | ||
92 | return capset_ids; | ||
93 | } | ||
75 | diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c | 94 | diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c |
76 | index XXXXXXX..XXXXXXX 100644 | 95 | index XXXXXXX..XXXXXXX 100644 |
77 | --- a/hw/display/virtio-gpu.c | 96 | --- a/hw/display/virtio-gpu.c |
78 | +++ b/hw/display/virtio-gpu.c | 97 | +++ b/hw/display/virtio-gpu.c |
79 | @@ -XXX,XX +XXX,XX @@ void virtio_gpu_device_realize(DeviceState *qdev, Error **errp) | 98 | @@ -XXX,XX +XXX,XX @@ void virtio_gpu_device_realize(DeviceState *qdev, Error **errp) |
... | ... | ||
101 | diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h | 120 | diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h |
102 | index XXXXXXX..XXXXXXX 100644 | 121 | index XXXXXXX..XXXXXXX 100644 |
103 | --- a/include/hw/virtio/virtio-gpu.h | 122 | --- a/include/hw/virtio/virtio-gpu.h |
104 | +++ b/include/hw/virtio/virtio-gpu.h | 123 | +++ b/include/hw/virtio/virtio-gpu.h |
105 | @@ -XXX,XX +XXX,XX @@ enum virtio_gpu_base_conf_flags { | 124 | @@ -XXX,XX +XXX,XX @@ enum virtio_gpu_base_conf_flags { |
106 | VIRTIO_GPU_FLAG_CONTEXT_INIT_ENABLED, | ||
107 | VIRTIO_GPU_FLAG_RUTABAGA_ENABLED, | 125 | VIRTIO_GPU_FLAG_RUTABAGA_ENABLED, |
108 | VIRTIO_GPU_FLAG_VENUS_ENABLED, | 126 | VIRTIO_GPU_FLAG_VENUS_ENABLED, |
127 | VIRTIO_GPU_FLAG_RESOURCE_UUID_ENABLED, | ||
109 | + VIRTIO_GPU_FLAG_DRM_ENABLED, | 128 | + VIRTIO_GPU_FLAG_DRM_ENABLED, |
110 | }; | 129 | }; |
111 | 130 | ||
112 | #define virtio_gpu_virgl_enabled(_cfg) \ | 131 | #define virtio_gpu_virgl_enabled(_cfg) \ |
113 | @@ -XXX,XX +XXX,XX @@ enum virtio_gpu_base_conf_flags { | 132 | @@ -XXX,XX +XXX,XX @@ enum virtio_gpu_base_conf_flags { |
... | ... | ||
118 | + (_cfg.flags & (1 << VIRTIO_GPU_FLAG_DRM_ENABLED)) | 137 | + (_cfg.flags & (1 << VIRTIO_GPU_FLAG_DRM_ENABLED)) |
119 | 138 | ||
120 | struct virtio_gpu_base_conf { | 139 | struct virtio_gpu_base_conf { |
121 | uint32_t max_outputs; | 140 | uint32_t max_outputs; |
122 | -- | 141 | -- |
123 | 2.46.0 | 142 | 2.48.1 |
143 | |||
144 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | Display refreshment is invoked by a timer and it erroneously disables | ||
2 | the active scanout if it happens to be invoked after scanout has been | ||
3 | enabled. This offending scanout-disable race condition with a timer | ||
4 | can be easily hit when Qemu runs with a disabled vsync by using SDL or | ||
5 | GTK displays (with vblank_mode=0 for GTK). Refreshment of display's | ||
6 | content shouldn't disable the active display. Fix it by keeping the | ||
7 | scanout's state unchanged when display is redrawn. | ||
1 | 8 | ||
9 | Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com> | ||
10 | Acked-by: Michael S. Tsirkin <mst@redhat.com> | ||
11 | Tested-by: Alex Bennée <alex.bennee@linaro.org> | ||
12 | Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> | ||
13 | --- | ||
14 | ui/sdl2-gl.c | 1 - | ||
15 | 1 file changed, 1 deletion(-) | ||
16 | |||
17 | diff --git a/ui/sdl2-gl.c b/ui/sdl2-gl.c | ||
18 | index XXXXXXX..XXXXXXX 100644 | ||
19 | --- a/ui/sdl2-gl.c | ||
20 | +++ b/ui/sdl2-gl.c | ||
21 | @@ -XXX,XX +XXX,XX @@ static void sdl2_gl_render_surface(struct sdl2_console *scon) | ||
22 | int ww, wh; | ||
23 | |||
24 | SDL_GL_MakeCurrent(scon->real_window, scon->winctx); | ||
25 | - sdl2_set_scanout_mode(scon, false); | ||
26 | |||
27 | SDL_GetWindowSize(scon->real_window, &ww, &wh); | ||
28 | surface_gl_setup_viewport(scon->gls, scon->surface, ww, wh); | ||
29 | -- | ||
30 | 2.48.1 | ||
31 | |||
32 | diff view generated by jsdifflib |
1 | Update kernel headers to bring new VirtIO-GPU DRM capset. | 1 | Display refreshment is invoked by a timer and it erroneously disables |
---|---|---|---|
2 | the active scanout if it happens to be invoked after scanout has been | ||
3 | enabled. This offending scanout-disable race condition with a timer | ||
4 | can be easily hit when Qemu runs with a disabled vsync by using SDL or | ||
5 | GTK displays (with vblank_mode=0 for GTK). Refreshment of display's | ||
6 | content shouldn't disable the active display. Fix it by keeping the | ||
7 | scanout's state unchanged when display is redrawn. | ||
2 | 8 | ||
9 | Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com> | ||
10 | Acked-by: Michael S. Tsirkin <mst@redhat.com> | ||
11 | Tested-by: Alex Bennée <alex.bennee@linaro.org> | ||
3 | Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> | 12 | Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> |
4 | --- | 13 | --- |
5 | include/standard-headers/drm/drm_fourcc.h | 43 ++++ | 14 | ui/gtk-egl.c | 1 - |
6 | include/standard-headers/linux/const.h | 17 ++ | 15 | ui/gtk-gl-area.c | 1 - |
7 | include/standard-headers/linux/ethtool.h | 226 ++++++++++++++++++ | 16 | 2 files changed, 2 deletions(-) |
8 | include/standard-headers/linux/fuse.h | 22 +- | ||
9 | .../linux/input-event-codes.h | 2 + | ||
10 | include/standard-headers/linux/pci_regs.h | 41 +++- | ||
11 | .../standard-headers/linux/virtio_balloon.h | 16 +- | ||
12 | include/standard-headers/linux/virtio_gpu.h | 1 + | ||
13 | linux-headers/asm-arm64/mman.h | 9 + | ||
14 | linux-headers/asm-arm64/unistd.h | 25 +- | ||
15 | linux-headers/asm-generic/unistd.h | 6 +- | ||
16 | linux-headers/asm-loongarch/kvm.h | 24 ++ | ||
17 | linux-headers/asm-loongarch/unistd.h | 4 +- | ||
18 | linux-headers/asm-riscv/kvm.h | 7 + | ||
19 | linux-headers/asm-riscv/unistd.h | 41 +--- | ||
20 | linux-headers/asm-x86/kvm.h | 2 + | ||
21 | linux-headers/asm-x86/unistd_64.h | 1 + | ||
22 | linux-headers/asm-x86/unistd_x32.h | 1 + | ||
23 | linux-headers/linux/bits.h | 3 + | ||
24 | linux-headers/linux/const.h | 17 ++ | ||
25 | linux-headers/linux/iommufd.h | 143 +++++++++-- | ||
26 | linux-headers/linux/kvm.h | 23 +- | ||
27 | linux-headers/linux/mman.h | 1 + | ||
28 | linux-headers/linux/psp-sev.h | 28 +++ | ||
29 | 24 files changed, 610 insertions(+), 93 deletions(-) | ||
30 | 17 | ||
31 | diff --git a/include/standard-headers/drm/drm_fourcc.h b/include/standard-headers/drm/drm_fourcc.h | 18 | diff --git a/ui/gtk-egl.c b/ui/gtk-egl.c |
32 | index XXXXXXX..XXXXXXX 100644 | 19 | index XXXXXXX..XXXXXXX 100644 |
33 | --- a/include/standard-headers/drm/drm_fourcc.h | 20 | --- a/ui/gtk-egl.c |
34 | +++ b/include/standard-headers/drm/drm_fourcc.h | 21 | +++ b/ui/gtk-egl.c |
35 | @@ -XXX,XX +XXX,XX @@ extern "C" { | 22 | @@ -XXX,XX +XXX,XX @@ void gd_egl_refresh(DisplayChangeListener *dcl) |
36 | */ | 23 | |
37 | #define I915_FORMAT_MOD_4_TILED_MTL_RC_CCS_CC fourcc_mod_code(INTEL, 15) | 24 | if (vc->gfx.glupdates) { |
38 | 25 | vc->gfx.glupdates = 0; | |
39 | +/* | 26 | - gtk_egl_set_scanout_mode(vc, false); |
40 | + * Intel Color Control Surfaces (CCS) for graphics ver. 20 unified compression | 27 | gd_egl_draw(vc); |
41 | + * on integrated graphics | 28 | } |
42 | + * | 29 | } |
43 | + * The main surface is Tile 4 and at plane index 0. For semi-planar formats | 30 | diff --git a/ui/gtk-gl-area.c b/ui/gtk-gl-area.c |
44 | + * like NV12, the Y and UV planes are Tile 4 and are located at plane indices | ||
45 | + * 0 and 1, respectively. The CCS for all planes are stored outside of the | ||
46 | + * GEM object in a reserved memory area dedicated for the storage of the | ||
47 | + * CCS data for all compressible GEM objects. | ||
48 | + */ | ||
49 | +#define I915_FORMAT_MOD_4_TILED_LNL_CCS fourcc_mod_code(INTEL, 16) | ||
50 | + | ||
51 | +/* | ||
52 | + * Intel Color Control Surfaces (CCS) for graphics ver. 20 unified compression | ||
53 | + * on discrete graphics | ||
54 | + * | ||
55 | + * The main surface is Tile 4 and at plane index 0. For semi-planar formats | ||
56 | + * like NV12, the Y and UV planes are Tile 4 and are located at plane indices | ||
57 | + * 0 and 1, respectively. The CCS for all planes are stored outside of the | ||
58 | + * GEM object in a reserved memory area dedicated for the storage of the | ||
59 | + * CCS data for all compressible GEM objects. The GEM object must be stored in | ||
60 | + * contiguous memory with a size aligned to 64KB | ||
61 | + */ | ||
62 | +#define I915_FORMAT_MOD_4_TILED_BMG_CCS fourcc_mod_code(INTEL, 17) | ||
63 | + | ||
64 | /* | ||
65 | * Tiled, NV12MT, grouped in 64 (pixels) x 32 (lines) -sized macroblocks | ||
66 | * | ||
67 | @@ -XXX,XX +XXX,XX @@ drm_fourcc_canonicalize_nvidia_format_mod(uint64_t modifier) | ||
68 | #define AMD_FMT_MOD_TILE_VER_GFX10 2 | ||
69 | #define AMD_FMT_MOD_TILE_VER_GFX10_RBPLUS 3 | ||
70 | #define AMD_FMT_MOD_TILE_VER_GFX11 4 | ||
71 | +#define AMD_FMT_MOD_TILE_VER_GFX12 5 | ||
72 | |||
73 | /* | ||
74 | * 64K_S is the same for GFX9/GFX10/GFX10_RBPLUS and hence has GFX9 as canonical | ||
75 | @@ -XXX,XX +XXX,XX @@ drm_fourcc_canonicalize_nvidia_format_mod(uint64_t modifier) | ||
76 | /* | ||
77 | * 64K_D for non-32 bpp is the same for GFX9/GFX10/GFX10_RBPLUS and hence has | ||
78 | * GFX9 as canonical version. | ||
79 | + * | ||
80 | + * 64K_D_2D on GFX12 is identical to 64K_D on GFX11. | ||
81 | */ | ||
82 | #define AMD_FMT_MOD_TILE_GFX9_64K_D 10 | ||
83 | #define AMD_FMT_MOD_TILE_GFX9_64K_S_X 25 | ||
84 | @@ -XXX,XX +XXX,XX @@ drm_fourcc_canonicalize_nvidia_format_mod(uint64_t modifier) | ||
85 | #define AMD_FMT_MOD_TILE_GFX9_64K_R_X 27 | ||
86 | #define AMD_FMT_MOD_TILE_GFX11_256K_R_X 31 | ||
87 | |||
88 | +/* Gfx12 swizzle modes: | ||
89 | + * 0 - LINEAR | ||
90 | + * 1 - 256B_2D - 2D block dimensions | ||
91 | + * 2 - 4KB_2D | ||
92 | + * 3 - 64KB_2D | ||
93 | + * 4 - 256KB_2D | ||
94 | + * 5 - 4KB_3D - 3D block dimensions | ||
95 | + * 6 - 64KB_3D | ||
96 | + * 7 - 256KB_3D | ||
97 | + */ | ||
98 | +#define AMD_FMT_MOD_TILE_GFX12_256B_2D 1 | ||
99 | +#define AMD_FMT_MOD_TILE_GFX12_4K_2D 2 | ||
100 | +#define AMD_FMT_MOD_TILE_GFX12_64K_2D 3 | ||
101 | +#define AMD_FMT_MOD_TILE_GFX12_256K_2D 4 | ||
102 | + | ||
103 | #define AMD_FMT_MOD_DCC_BLOCK_64B 0 | ||
104 | #define AMD_FMT_MOD_DCC_BLOCK_128B 1 | ||
105 | #define AMD_FMT_MOD_DCC_BLOCK_256B 2 | ||
106 | diff --git a/include/standard-headers/linux/const.h b/include/standard-headers/linux/const.h | ||
107 | index XXXXXXX..XXXXXXX 100644 | 31 | index XXXXXXX..XXXXXXX 100644 |
108 | --- a/include/standard-headers/linux/const.h | 32 | --- a/ui/gtk-gl-area.c |
109 | +++ b/include/standard-headers/linux/const.h | 33 | +++ b/ui/gtk-gl-area.c |
110 | @@ -XXX,XX +XXX,XX @@ | 34 | @@ -XXX,XX +XXX,XX @@ void gd_gl_area_refresh(DisplayChangeListener *dcl) |
111 | #define _BITUL(x) (_UL(1) << (x)) | 35 | |
112 | #define _BITULL(x) (_ULL(1) << (x)) | 36 | if (vc->gfx.glupdates) { |
113 | 37 | vc->gfx.glupdates = 0; | |
114 | +#if !defined(__ASSEMBLY__) | 38 | - gtk_gl_area_set_scanout_mode(vc, false); |
115 | +/* | 39 | gtk_gl_area_queue_render(GTK_GL_AREA(vc->gfx.drawing_area)); |
116 | + * Missing __asm__ support | 40 | } |
117 | + * | ||
118 | + * __BIT128() would not work in the __asm__ code, as it shifts an | ||
119 | + * 'unsigned __init128' data type as direct representation of | ||
120 | + * 128 bit constants is not supported in the gcc compiler, as | ||
121 | + * they get silently truncated. | ||
122 | + * | ||
123 | + * TODO: Please revisit this implementation when gcc compiler | ||
124 | + * starts representing 128 bit constants directly like long | ||
125 | + * and unsigned long etc. Subsequently drop the comment for | ||
126 | + * GENMASK_U128() which would then start supporting __asm__ code. | ||
127 | + */ | ||
128 | +#define _BIT128(x) ((unsigned __int128)(1) << (x)) | ||
129 | +#endif | ||
130 | + | ||
131 | #define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (__typeof__(x))(a) - 1) | ||
132 | #define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask)) | ||
133 | |||
134 | diff --git a/include/standard-headers/linux/ethtool.h b/include/standard-headers/linux/ethtool.h | ||
135 | index XXXXXXX..XXXXXXX 100644 | ||
136 | --- a/include/standard-headers/linux/ethtool.h | ||
137 | +++ b/include/standard-headers/linux/ethtool.h | ||
138 | @@ -XXX,XX +XXX,XX @@ enum ethtool_module_power_mode { | ||
139 | ETHTOOL_MODULE_POWER_MODE_HIGH, | ||
140 | }; | ||
141 | |||
142 | +/** | ||
143 | + * enum ethtool_c33_pse_ext_state - groups of PSE extended states | ||
144 | + * functions. IEEE 802.3-2022 33.2.4.4 Variables | ||
145 | + * | ||
146 | + * @ETHTOOL_C33_PSE_EXT_STATE_ERROR_CONDITION: Group of error_condition states | ||
147 | + * @ETHTOOL_C33_PSE_EXT_STATE_MR_MPS_VALID: Group of mr_mps_valid states | ||
148 | + * @ETHTOOL_C33_PSE_EXT_STATE_MR_PSE_ENABLE: Group of mr_pse_enable states | ||
149 | + * @ETHTOOL_C33_PSE_EXT_STATE_OPTION_DETECT_TED: Group of option_detect_ted | ||
150 | + * states | ||
151 | + * @ETHTOOL_C33_PSE_EXT_STATE_OPTION_VPORT_LIM: Group of option_vport_lim states | ||
152 | + * @ETHTOOL_C33_PSE_EXT_STATE_OVLD_DETECTED: Group of ovld_detected states | ||
153 | + * @ETHTOOL_C33_PSE_EXT_STATE_PD_DLL_POWER_TYPE: Group of pd_dll_power_type | ||
154 | + * states | ||
155 | + * @ETHTOOL_C33_PSE_EXT_STATE_POWER_NOT_AVAILABLE: Group of power_not_available | ||
156 | + * states | ||
157 | + * @ETHTOOL_C33_PSE_EXT_STATE_SHORT_DETECTED: Group of short_detected states | ||
158 | + */ | ||
159 | +enum ethtool_c33_pse_ext_state { | ||
160 | + ETHTOOL_C33_PSE_EXT_STATE_ERROR_CONDITION = 1, | ||
161 | + ETHTOOL_C33_PSE_EXT_STATE_MR_MPS_VALID, | ||
162 | + ETHTOOL_C33_PSE_EXT_STATE_MR_PSE_ENABLE, | ||
163 | + ETHTOOL_C33_PSE_EXT_STATE_OPTION_DETECT_TED, | ||
164 | + ETHTOOL_C33_PSE_EXT_STATE_OPTION_VPORT_LIM, | ||
165 | + ETHTOOL_C33_PSE_EXT_STATE_OVLD_DETECTED, | ||
166 | + ETHTOOL_C33_PSE_EXT_STATE_PD_DLL_POWER_TYPE, | ||
167 | + ETHTOOL_C33_PSE_EXT_STATE_POWER_NOT_AVAILABLE, | ||
168 | + ETHTOOL_C33_PSE_EXT_STATE_SHORT_DETECTED, | ||
169 | +}; | ||
170 | + | ||
171 | +/** | ||
172 | + * enum ethtool_c33_pse_ext_substate_mr_mps_valid - mr_mps_valid states | ||
173 | + * functions. IEEE 802.3-2022 33.2.4.4 Variables | ||
174 | + * | ||
175 | + * @ETHTOOL_C33_PSE_EXT_SUBSTATE_MR_MPS_VALID_DETECTED_UNDERLOAD: Underload | ||
176 | + * state | ||
177 | + * @ETHTOOL_C33_PSE_EXT_SUBSTATE_MR_MPS_VALID_CONNECTION_OPEN: Port is not | ||
178 | + * connected | ||
179 | + * | ||
180 | + * The PSE monitors either the DC or AC Maintain Power Signature | ||
181 | + * (MPS, see 33.2.9.1). This variable indicates the presence or absence of | ||
182 | + * a valid MPS. | ||
183 | + */ | ||
184 | +enum ethtool_c33_pse_ext_substate_mr_mps_valid { | ||
185 | + ETHTOOL_C33_PSE_EXT_SUBSTATE_MR_MPS_VALID_DETECTED_UNDERLOAD = 1, | ||
186 | + ETHTOOL_C33_PSE_EXT_SUBSTATE_MR_MPS_VALID_CONNECTION_OPEN, | ||
187 | +}; | ||
188 | + | ||
189 | +/** | ||
190 | + * enum ethtool_c33_pse_ext_substate_error_condition - error_condition states | ||
191 | + * functions. IEEE 802.3-2022 33.2.4.4 Variables | ||
192 | + * | ||
193 | + * @ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_NON_EXISTING_PORT: Non-existing | ||
194 | + * port number | ||
195 | + * @ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_UNDEFINED_PORT: Undefined port | ||
196 | + * @ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_INTERNAL_HW_FAULT: Internal | ||
197 | + * hardware fault | ||
198 | + * @ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_COMM_ERROR_AFTER_FORCE_ON: | ||
199 | + * Communication error after force on | ||
200 | + * @ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_UNKNOWN_PORT_STATUS: Unknown | ||
201 | + * port status | ||
202 | + * @ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_HOST_CRASH_TURN_OFF: Host | ||
203 | + * crash turn off | ||
204 | + * @ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_HOST_CRASH_FORCE_SHUTDOWN: | ||
205 | + * Host crash force shutdown | ||
206 | + * @ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_CONFIG_CHANGE: Configuration | ||
207 | + * change | ||
208 | + * @ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_DETECTED_OVER_TEMP: Over | ||
209 | + * temperature detected | ||
210 | + * | ||
211 | + * error_condition is a variable indicating the status of | ||
212 | + * implementation-specific fault conditions or optionally other system faults | ||
213 | + * that prevent the PSE from meeting the specifications in Table 33–11 and that | ||
214 | + * require the PSE not to source power. These error conditions are different | ||
215 | + * from those monitored by the state diagrams in Figure 33–10. | ||
216 | + */ | ||
217 | +enum ethtool_c33_pse_ext_substate_error_condition { | ||
218 | + ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_NON_EXISTING_PORT = 1, | ||
219 | + ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_UNDEFINED_PORT, | ||
220 | + ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_INTERNAL_HW_FAULT, | ||
221 | + ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_COMM_ERROR_AFTER_FORCE_ON, | ||
222 | + ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_UNKNOWN_PORT_STATUS, | ||
223 | + ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_HOST_CRASH_TURN_OFF, | ||
224 | + ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_HOST_CRASH_FORCE_SHUTDOWN, | ||
225 | + ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_CONFIG_CHANGE, | ||
226 | + ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_DETECTED_OVER_TEMP, | ||
227 | +}; | ||
228 | + | ||
229 | +/** | ||
230 | + * enum ethtool_c33_pse_ext_substate_mr_pse_enable - mr_pse_enable states | ||
231 | + * functions. IEEE 802.3-2022 33.2.4.4 Variables | ||
232 | + * | ||
233 | + * @ETHTOOL_C33_PSE_EXT_SUBSTATE_MR_PSE_ENABLE_DISABLE_PIN_ACTIVE: Disable | ||
234 | + * pin active | ||
235 | + * | ||
236 | + * mr_pse_enable is control variable that selects PSE operation and test | ||
237 | + * functions. | ||
238 | + */ | ||
239 | +enum ethtool_c33_pse_ext_substate_mr_pse_enable { | ||
240 | + ETHTOOL_C33_PSE_EXT_SUBSTATE_MR_PSE_ENABLE_DISABLE_PIN_ACTIVE = 1, | ||
241 | +}; | ||
242 | + | ||
243 | +/** | ||
244 | + * enum ethtool_c33_pse_ext_substate_option_detect_ted - option_detect_ted | ||
245 | + * states functions. IEEE 802.3-2022 33.2.4.4 Variables | ||
246 | + * | ||
247 | + * @ETHTOOL_C33_PSE_EXT_SUBSTATE_OPTION_DETECT_TED_DET_IN_PROCESS: Detection | ||
248 | + * in process | ||
249 | + * @ETHTOOL_C33_PSE_EXT_SUBSTATE_OPTION_DETECT_TED_CONNECTION_CHECK_ERROR: | ||
250 | + * Connection check error | ||
251 | + * | ||
252 | + * option_detect_ted is a variable indicating if detection can be performed | ||
253 | + * by the PSE during the ted_timer interval. | ||
254 | + */ | ||
255 | +enum ethtool_c33_pse_ext_substate_option_detect_ted { | ||
256 | + ETHTOOL_C33_PSE_EXT_SUBSTATE_OPTION_DETECT_TED_DET_IN_PROCESS = 1, | ||
257 | + ETHTOOL_C33_PSE_EXT_SUBSTATE_OPTION_DETECT_TED_CONNECTION_CHECK_ERROR, | ||
258 | +}; | ||
259 | + | ||
260 | +/** | ||
261 | + * enum ethtool_c33_pse_ext_substate_option_vport_lim - option_vport_lim states | ||
262 | + * functions. IEEE 802.3-2022 33.2.4.4 Variables | ||
263 | + * | ||
264 | + * @ETHTOOL_C33_PSE_EXT_SUBSTATE_OPTION_VPORT_LIM_HIGH_VOLTAGE: Main supply | ||
265 | + * voltage is high | ||
266 | + * @ETHTOOL_C33_PSE_EXT_SUBSTATE_OPTION_VPORT_LIM_LOW_VOLTAGE: Main supply | ||
267 | + * voltage is low | ||
268 | + * @ETHTOOL_C33_PSE_EXT_SUBSTATE_OPTION_VPORT_LIM_VOLTAGE_INJECTION: Voltage | ||
269 | + * injection into the port | ||
270 | + * | ||
271 | + * option_vport_lim is an optional variable indicates if VPSE is out of the | ||
272 | + * operating range during normal operating state. | ||
273 | + */ | ||
274 | +enum ethtool_c33_pse_ext_substate_option_vport_lim { | ||
275 | + ETHTOOL_C33_PSE_EXT_SUBSTATE_OPTION_VPORT_LIM_HIGH_VOLTAGE = 1, | ||
276 | + ETHTOOL_C33_PSE_EXT_SUBSTATE_OPTION_VPORT_LIM_LOW_VOLTAGE, | ||
277 | + ETHTOOL_C33_PSE_EXT_SUBSTATE_OPTION_VPORT_LIM_VOLTAGE_INJECTION, | ||
278 | +}; | ||
279 | + | ||
280 | +/** | ||
281 | + * enum ethtool_c33_pse_ext_substate_ovld_detected - ovld_detected states | ||
282 | + * functions. IEEE 802.3-2022 33.2.4.4 Variables | ||
283 | + * | ||
284 | + * @ETHTOOL_C33_PSE_EXT_SUBSTATE_OVLD_DETECTED_OVERLOAD: Overload state | ||
285 | + * | ||
286 | + * ovld_detected is a variable indicating if the PSE output current has been | ||
287 | + * in an overload condition (see 33.2.7.6) for at least TCUT of a one-second | ||
288 | + * sliding time. | ||
289 | + */ | ||
290 | +enum ethtool_c33_pse_ext_substate_ovld_detected { | ||
291 | + ETHTOOL_C33_PSE_EXT_SUBSTATE_OVLD_DETECTED_OVERLOAD = 1, | ||
292 | +}; | ||
293 | + | ||
294 | +/** | ||
295 | + * enum ethtool_c33_pse_ext_substate_power_not_available - power_not_available | ||
296 | + * states functions. IEEE 802.3-2022 33.2.4.4 Variables | ||
297 | + * | ||
298 | + * @ETHTOOL_C33_PSE_EXT_SUBSTATE_POWER_NOT_AVAILABLE_BUDGET_EXCEEDED: Power | ||
299 | + * budget exceeded for the controller | ||
300 | + * @ETHTOOL_C33_PSE_EXT_SUBSTATE_POWER_NOT_AVAILABLE_PORT_PW_LIMIT_EXCEEDS_CONTROLLER_BUDGET: | ||
301 | + * Configured port power limit exceeded controller power budget | ||
302 | + * @ETHTOOL_C33_PSE_EXT_SUBSTATE_POWER_NOT_AVAILABLE_PD_REQUEST_EXCEEDS_PORT_LIMIT: | ||
303 | + * Power request from PD exceeds port limit | ||
304 | + * @ETHTOOL_C33_PSE_EXT_SUBSTATE_POWER_NOT_AVAILABLE_HW_PW_LIMIT: Power | ||
305 | + * denied due to Hardware power limit | ||
306 | + * | ||
307 | + * power_not_available is a variable that is asserted in an | ||
308 | + * implementation-dependent manner when the PSE is no longer capable of | ||
309 | + * sourcing sufficient power to support the attached PD. Sufficient power | ||
310 | + * is defined by classification; see 33.2.6. | ||
311 | + */ | ||
312 | +enum ethtool_c33_pse_ext_substate_power_not_available { | ||
313 | + ETHTOOL_C33_PSE_EXT_SUBSTATE_POWER_NOT_AVAILABLE_BUDGET_EXCEEDED = 1, | ||
314 | + ETHTOOL_C33_PSE_EXT_SUBSTATE_POWER_NOT_AVAILABLE_PORT_PW_LIMIT_EXCEEDS_CONTROLLER_BUDGET, | ||
315 | + ETHTOOL_C33_PSE_EXT_SUBSTATE_POWER_NOT_AVAILABLE_PD_REQUEST_EXCEEDS_PORT_LIMIT, | ||
316 | + ETHTOOL_C33_PSE_EXT_SUBSTATE_POWER_NOT_AVAILABLE_HW_PW_LIMIT, | ||
317 | +}; | ||
318 | + | ||
319 | +/** | ||
320 | + * enum ethtool_c33_pse_ext_substate_short_detected - short_detected states | ||
321 | + * functions. IEEE 802.3-2022 33.2.4.4 Variables | ||
322 | + * | ||
323 | + * @ETHTOOL_C33_PSE_EXT_SUBSTATE_SHORT_DETECTED_SHORT_CONDITION: Short | ||
324 | + * condition was detected | ||
325 | + * | ||
326 | + * short_detected is a variable indicating if the PSE output current has been | ||
327 | + * in a short circuit condition for TLIM within a sliding window (see 33.2.7.7). | ||
328 | + */ | ||
329 | +enum ethtool_c33_pse_ext_substate_short_detected { | ||
330 | + ETHTOOL_C33_PSE_EXT_SUBSTATE_SHORT_DETECTED_SHORT_CONDITION = 1, | ||
331 | +}; | ||
332 | + | ||
333 | /** | ||
334 | * enum ethtool_pse_types - Types of PSE controller. | ||
335 | * @ETHTOOL_PSE_UNKNOWN: Type of PSE controller is unknown | ||
336 | @@ -XXX,XX +XXX,XX @@ enum ethtool_mm_verify_status { | ||
337 | ETHTOOL_MM_VERIFY_STATUS_DISABLED, | ||
338 | }; | ||
339 | |||
340 | +/** | ||
341 | + * enum ethtool_module_fw_flash_status - plug-in module firmware flashing status | ||
342 | + * @ETHTOOL_MODULE_FW_FLASH_STATUS_STARTED: The firmware flashing process has | ||
343 | + * started. | ||
344 | + * @ETHTOOL_MODULE_FW_FLASH_STATUS_IN_PROGRESS: The firmware flashing process | ||
345 | + * is in progress. | ||
346 | + * @ETHTOOL_MODULE_FW_FLASH_STATUS_COMPLETED: The firmware flashing process was | ||
347 | + * completed successfully. | ||
348 | + * @ETHTOOL_MODULE_FW_FLASH_STATUS_ERROR: The firmware flashing process was | ||
349 | + * stopped due to an error. | ||
350 | + */ | ||
351 | +enum ethtool_module_fw_flash_status { | ||
352 | + ETHTOOL_MODULE_FW_FLASH_STATUS_STARTED = 1, | ||
353 | + ETHTOOL_MODULE_FW_FLASH_STATUS_IN_PROGRESS, | ||
354 | + ETHTOOL_MODULE_FW_FLASH_STATUS_COMPLETED, | ||
355 | + ETHTOOL_MODULE_FW_FLASH_STATUS_ERROR, | ||
356 | +}; | ||
357 | + | ||
358 | /** | ||
359 | * struct ethtool_gstrings - string set for data tagging | ||
360 | * @cmd: Command number = %ETHTOOL_GSTRINGS | ||
361 | @@ -XXX,XX +XXX,XX @@ enum ethtool_link_mode_bit_indices { | ||
362 | ETHTOOL_LINK_MODE_10baseT1S_Full_BIT = 99, | ||
363 | ETHTOOL_LINK_MODE_10baseT1S_Half_BIT = 100, | ||
364 | ETHTOOL_LINK_MODE_10baseT1S_P2MP_Half_BIT = 101, | ||
365 | + ETHTOOL_LINK_MODE_10baseT1BRR_Full_BIT = 102, | ||
366 | |||
367 | /* must be last entry */ | ||
368 | __ETHTOOL_LINK_MODE_MASK_NBITS | ||
369 | @@ -XXX,XX +XXX,XX @@ struct ethtool_link_settings { | ||
370 | * uint32_t map_lp_advertising[link_mode_masks_nwords]; | ||
371 | */ | ||
372 | }; | ||
373 | + | ||
374 | +/** | ||
375 | + * enum phy_upstream - Represents the upstream component a given PHY device | ||
376 | + * is connected to, as in what is on the other end of the MII bus. Most PHYs | ||
377 | + * will be attached to an Ethernet MAC controller, but in some cases, there's | ||
378 | + * an intermediate PHY used as a media-converter, which will driver another | ||
379 | + * MII interface as its output. | ||
380 | + * @PHY_UPSTREAM_MAC: Upstream component is a MAC (a switch port, | ||
381 | + * or ethernet controller) | ||
382 | + * @PHY_UPSTREAM_PHY: Upstream component is a PHY (likely a media converter) | ||
383 | + */ | ||
384 | +enum phy_upstream { | ||
385 | + PHY_UPSTREAM_MAC, | ||
386 | + PHY_UPSTREAM_PHY, | ||
387 | +}; | ||
388 | + | ||
389 | #endif /* _LINUX_ETHTOOL_H */ | ||
390 | diff --git a/include/standard-headers/linux/fuse.h b/include/standard-headers/linux/fuse.h | ||
391 | index XXXXXXX..XXXXXXX 100644 | ||
392 | --- a/include/standard-headers/linux/fuse.h | ||
393 | +++ b/include/standard-headers/linux/fuse.h | ||
394 | @@ -XXX,XX +XXX,XX @@ | ||
395 | * - add backing_id to fuse_open_out, add FOPEN_PASSTHROUGH open flag | ||
396 | * - add FUSE_NO_EXPORT_SUPPORT init flag | ||
397 | * - add FUSE_NOTIFY_RESEND, add FUSE_HAS_RESEND init flag | ||
398 | + * | ||
399 | + * 7.41 | ||
400 | + * - add FUSE_ALLOW_IDMAP | ||
401 | */ | ||
402 | |||
403 | #ifndef _LINUX_FUSE_H | ||
404 | @@ -XXX,XX +XXX,XX @@ | ||
405 | #define FUSE_KERNEL_VERSION 7 | ||
406 | |||
407 | /** Minor version number of this interface */ | ||
408 | -#define FUSE_KERNEL_MINOR_VERSION 40 | ||
409 | +#define FUSE_KERNEL_MINOR_VERSION 41 | ||
410 | |||
411 | /** The node ID of the root inode */ | ||
412 | #define FUSE_ROOT_ID 1 | ||
413 | @@ -XXX,XX +XXX,XX @@ struct fuse_file_lock { | ||
414 | * FUSE_NO_EXPORT_SUPPORT: explicitly disable export support | ||
415 | * FUSE_HAS_RESEND: kernel supports resending pending requests, and the high bit | ||
416 | * of the request ID indicates resend requests | ||
417 | + * FUSE_ALLOW_IDMAP: allow creation of idmapped mounts | ||
418 | */ | ||
419 | #define FUSE_ASYNC_READ (1 << 0) | ||
420 | #define FUSE_POSIX_LOCKS (1 << 1) | ||
421 | @@ -XXX,XX +XXX,XX @@ struct fuse_file_lock { | ||
422 | |||
423 | /* Obsolete alias for FUSE_DIRECT_IO_ALLOW_MMAP */ | ||
424 | #define FUSE_DIRECT_IO_RELAX FUSE_DIRECT_IO_ALLOW_MMAP | ||
425 | +#define FUSE_ALLOW_IDMAP (1ULL << 40) | ||
426 | |||
427 | /** | ||
428 | * CUSE INIT request/reply flags | ||
429 | @@ -XXX,XX +XXX,XX @@ struct fuse_fallocate_in { | ||
430 | */ | ||
431 | #define FUSE_UNIQUE_RESEND (1ULL << 63) | ||
432 | |||
433 | +/** | ||
434 | + * This value will be set by the kernel to | ||
435 | + * (struct fuse_in_header).{uid,gid} fields in | ||
436 | + * case when: | ||
437 | + * - fuse daemon enabled FUSE_ALLOW_IDMAP | ||
438 | + * - idmapping information is not available and uid/gid | ||
439 | + * can not be mapped in accordance with an idmapping. | ||
440 | + * | ||
441 | + * Note: an idmapping information always available | ||
442 | + * for inode creation operations like: | ||
443 | + * FUSE_MKNOD, FUSE_SYMLINK, FUSE_MKDIR, FUSE_TMPFILE, | ||
444 | + * FUSE_CREATE and FUSE_RENAME2 (with RENAME_WHITEOUT). | ||
445 | + */ | ||
446 | +#define FUSE_INVALID_UIDGID ((uint32_t)(-1)) | ||
447 | + | ||
448 | struct fuse_in_header { | ||
449 | uint32_t len; | ||
450 | uint32_t opcode; | ||
451 | diff --git a/include/standard-headers/linux/input-event-codes.h b/include/standard-headers/linux/input-event-codes.h | ||
452 | index XXXXXXX..XXXXXXX 100644 | ||
453 | --- a/include/standard-headers/linux/input-event-codes.h | ||
454 | +++ b/include/standard-headers/linux/input-event-codes.h | ||
455 | @@ -XXX,XX +XXX,XX @@ | ||
456 | #define KEY_CAMERA_ACCESS_ENABLE 0x24b /* Enables programmatic access to camera devices. (HUTRR72) */ | ||
457 | #define KEY_CAMERA_ACCESS_DISABLE 0x24c /* Disables programmatic access to camera devices. (HUTRR72) */ | ||
458 | #define KEY_CAMERA_ACCESS_TOGGLE 0x24d /* Toggles the current state of the camera access control. (HUTRR72) */ | ||
459 | +#define KEY_ACCESSIBILITY 0x24e /* Toggles the system bound accessibility UI/command (HUTRR116) */ | ||
460 | +#define KEY_DO_NOT_DISTURB 0x24f /* Toggles the system-wide "Do Not Disturb" control (HUTRR94)*/ | ||
461 | |||
462 | #define KEY_BRIGHTNESS_MIN 0x250 /* Set Brightness to Minimum */ | ||
463 | #define KEY_BRIGHTNESS_MAX 0x251 /* Set Brightness to Maximum */ | ||
464 | diff --git a/include/standard-headers/linux/pci_regs.h b/include/standard-headers/linux/pci_regs.h | ||
465 | index XXXXXXX..XXXXXXX 100644 | ||
466 | --- a/include/standard-headers/linux/pci_regs.h | ||
467 | +++ b/include/standard-headers/linux/pci_regs.h | ||
468 | @@ -XXX,XX +XXX,XX @@ | ||
469 | #define PCI_EXP_RTCTL_SENFEE 0x0002 /* System Error on Non-Fatal Error */ | ||
470 | #define PCI_EXP_RTCTL_SEFEE 0x0004 /* System Error on Fatal Error */ | ||
471 | #define PCI_EXP_RTCTL_PMEIE 0x0008 /* PME Interrupt Enable */ | ||
472 | -#define PCI_EXP_RTCTL_CRSSVE 0x0010 /* CRS Software Visibility Enable */ | ||
473 | +#define PCI_EXP_RTCTL_RRS_SVE 0x0010 /* Config RRS Software Visibility Enable */ | ||
474 | +#define PCI_EXP_RTCTL_CRSSVE PCI_EXP_RTCTL_RRS_SVE /* compatibility */ | ||
475 | #define PCI_EXP_RTCAP 0x1e /* Root Capabilities */ | ||
476 | -#define PCI_EXP_RTCAP_CRSVIS 0x0001 /* CRS Software Visibility capability */ | ||
477 | +#define PCI_EXP_RTCAP_RRS_SV 0x0001 /* Config RRS Software Visibility */ | ||
478 | +#define PCI_EXP_RTCAP_CRSVIS PCI_EXP_RTCAP_RRS_SV /* compatibility */ | ||
479 | #define PCI_EXP_RTSTA 0x20 /* Root Status */ | ||
480 | #define PCI_EXP_RTSTA_PME_RQ_ID 0x0000ffff /* PME Requester ID */ | ||
481 | #define PCI_EXP_RTSTA_PME 0x00010000 /* PME status */ | ||
482 | @@ -XXX,XX +XXX,XX @@ | ||
483 | #define PCI_EXT_CAP_ID_DVSEC 0x23 /* Designated Vendor-Specific */ | ||
484 | #define PCI_EXT_CAP_ID_DLF 0x25 /* Data Link Feature */ | ||
485 | #define PCI_EXT_CAP_ID_PL_16GT 0x26 /* Physical Layer 16.0 GT/s */ | ||
486 | +#define PCI_EXT_CAP_ID_NPEM 0x29 /* Native PCIe Enclosure Management */ | ||
487 | #define PCI_EXT_CAP_ID_PL_32GT 0x2A /* Physical Layer 32.0 GT/s */ | ||
488 | #define PCI_EXT_CAP_ID_DOE 0x2E /* Data Object Exchange */ | ||
489 | #define PCI_EXT_CAP_ID_MAX PCI_EXT_CAP_ID_DOE | ||
490 | @@ -XXX,XX +XXX,XX @@ | ||
491 | #define PCI_PL_16GT_LE_CTRL_USP_TX_PRESET_MASK 0x000000F0 | ||
492 | #define PCI_PL_16GT_LE_CTRL_USP_TX_PRESET_SHIFT 4 | ||
493 | |||
494 | +/* Native PCIe Enclosure Management */ | ||
495 | +#define PCI_NPEM_CAP 0x04 /* NPEM capability register */ | ||
496 | +#define PCI_NPEM_CAP_CAPABLE 0x00000001 /* NPEM Capable */ | ||
497 | + | ||
498 | +#define PCI_NPEM_CTRL 0x08 /* NPEM control register */ | ||
499 | +#define PCI_NPEM_CTRL_ENABLE 0x00000001 /* NPEM Enable */ | ||
500 | + | ||
501 | +/* | ||
502 | + * Native PCIe Enclosure Management indication bits and Reset command bit | ||
503 | + * are corresponding for capability and control registers. | ||
504 | + */ | ||
505 | +#define PCI_NPEM_CMD_RESET 0x00000002 /* Reset Command */ | ||
506 | +#define PCI_NPEM_IND_OK 0x00000004 /* OK */ | ||
507 | +#define PCI_NPEM_IND_LOCATE 0x00000008 /* Locate */ | ||
508 | +#define PCI_NPEM_IND_FAIL 0x00000010 /* Fail */ | ||
509 | +#define PCI_NPEM_IND_REBUILD 0x00000020 /* Rebuild */ | ||
510 | +#define PCI_NPEM_IND_PFA 0x00000040 /* Predicted Failure Analysis */ | ||
511 | +#define PCI_NPEM_IND_HOTSPARE 0x00000080 /* Hot Spare */ | ||
512 | +#define PCI_NPEM_IND_ICA 0x00000100 /* In Critical Array */ | ||
513 | +#define PCI_NPEM_IND_IFA 0x00000200 /* In Failed Array */ | ||
514 | +#define PCI_NPEM_IND_IDT 0x00000400 /* Device Type */ | ||
515 | +#define PCI_NPEM_IND_DISABLED 0x00000800 /* Disabled */ | ||
516 | +#define PCI_NPEM_IND_SPEC_0 0x01000000 | ||
517 | +#define PCI_NPEM_IND_SPEC_1 0x02000000 | ||
518 | +#define PCI_NPEM_IND_SPEC_2 0x04000000 | ||
519 | +#define PCI_NPEM_IND_SPEC_3 0x08000000 | ||
520 | +#define PCI_NPEM_IND_SPEC_4 0x10000000 | ||
521 | +#define PCI_NPEM_IND_SPEC_5 0x20000000 | ||
522 | +#define PCI_NPEM_IND_SPEC_6 0x40000000 | ||
523 | +#define PCI_NPEM_IND_SPEC_7 0x80000000 | ||
524 | + | ||
525 | +#define PCI_NPEM_STATUS 0x0c /* NPEM status register */ | ||
526 | +#define PCI_NPEM_STATUS_CC 0x00000001 /* Command Completed */ | ||
527 | + | ||
528 | /* Data Object Exchange */ | ||
529 | #define PCI_DOE_CAP 0x04 /* DOE Capabilities Register */ | ||
530 | #define PCI_DOE_CAP_INT_SUP 0x00000001 /* Interrupt Support */ | ||
531 | diff --git a/include/standard-headers/linux/virtio_balloon.h b/include/standard-headers/linux/virtio_balloon.h | ||
532 | index XXXXXXX..XXXXXXX 100644 | ||
533 | --- a/include/standard-headers/linux/virtio_balloon.h | ||
534 | +++ b/include/standard-headers/linux/virtio_balloon.h | ||
535 | @@ -XXX,XX +XXX,XX @@ struct virtio_balloon_config { | ||
536 | #define VIRTIO_BALLOON_S_CACHES 7 /* Disk caches */ | ||
537 | #define VIRTIO_BALLOON_S_HTLB_PGALLOC 8 /* Hugetlb page allocations */ | ||
538 | #define VIRTIO_BALLOON_S_HTLB_PGFAIL 9 /* Hugetlb page allocation failures */ | ||
539 | -#define VIRTIO_BALLOON_S_NR 10 | ||
540 | +#define VIRTIO_BALLOON_S_OOM_KILL 10 /* OOM killer invocations */ | ||
541 | +#define VIRTIO_BALLOON_S_ALLOC_STALL 11 /* Stall count of memory allocatoin */ | ||
542 | +#define VIRTIO_BALLOON_S_ASYNC_SCAN 12 /* Amount of memory scanned asynchronously */ | ||
543 | +#define VIRTIO_BALLOON_S_DIRECT_SCAN 13 /* Amount of memory scanned directly */ | ||
544 | +#define VIRTIO_BALLOON_S_ASYNC_RECLAIM 14 /* Amount of memory reclaimed asynchronously */ | ||
545 | +#define VIRTIO_BALLOON_S_DIRECT_RECLAIM 15 /* Amount of memory reclaimed directly */ | ||
546 | +#define VIRTIO_BALLOON_S_NR 16 | ||
547 | |||
548 | #define VIRTIO_BALLOON_S_NAMES_WITH_PREFIX(VIRTIO_BALLOON_S_NAMES_prefix) { \ | ||
549 | VIRTIO_BALLOON_S_NAMES_prefix "swap-in", \ | ||
550 | @@ -XXX,XX +XXX,XX @@ struct virtio_balloon_config { | ||
551 | VIRTIO_BALLOON_S_NAMES_prefix "available-memory", \ | ||
552 | VIRTIO_BALLOON_S_NAMES_prefix "disk-caches", \ | ||
553 | VIRTIO_BALLOON_S_NAMES_prefix "hugetlb-allocations", \ | ||
554 | - VIRTIO_BALLOON_S_NAMES_prefix "hugetlb-failures" \ | ||
555 | + VIRTIO_BALLOON_S_NAMES_prefix "hugetlb-failures", \ | ||
556 | + VIRTIO_BALLOON_S_NAMES_prefix "oom-kills", \ | ||
557 | + VIRTIO_BALLOON_S_NAMES_prefix "alloc-stalls", \ | ||
558 | + VIRTIO_BALLOON_S_NAMES_prefix "async-scans", \ | ||
559 | + VIRTIO_BALLOON_S_NAMES_prefix "direct-scans", \ | ||
560 | + VIRTIO_BALLOON_S_NAMES_prefix "async-reclaims", \ | ||
561 | + VIRTIO_BALLOON_S_NAMES_prefix "direct-reclaims" \ | ||
562 | } | 41 | } |
563 | |||
564 | #define VIRTIO_BALLOON_S_NAMES VIRTIO_BALLOON_S_NAMES_WITH_PREFIX("") | ||
565 | diff --git a/include/standard-headers/linux/virtio_gpu.h b/include/standard-headers/linux/virtio_gpu.h | ||
566 | index XXXXXXX..XXXXXXX 100644 | ||
567 | --- a/include/standard-headers/linux/virtio_gpu.h | ||
568 | +++ b/include/standard-headers/linux/virtio_gpu.h | ||
569 | @@ -XXX,XX +XXX,XX @@ struct virtio_gpu_cmd_submit { | ||
570 | #define VIRTIO_GPU_CAPSET_VIRGL2 2 | ||
571 | /* 3 is reserved for gfxstream */ | ||
572 | #define VIRTIO_GPU_CAPSET_VENUS 4 | ||
573 | +#define VIRTIO_GPU_CAPSET_DRM 6 | ||
574 | |||
575 | /* VIRTIO_GPU_CMD_GET_CAPSET_INFO */ | ||
576 | struct virtio_gpu_get_capset_info { | ||
577 | diff --git a/linux-headers/asm-arm64/mman.h b/linux-headers/asm-arm64/mman.h | ||
578 | index XXXXXXX..XXXXXXX 100644 | ||
579 | --- a/linux-headers/asm-arm64/mman.h | ||
580 | +++ b/linux-headers/asm-arm64/mman.h | ||
581 | @@ -XXX,XX +XXX,XX @@ | ||
582 | #define PROT_BTI 0x10 /* BTI guarded page */ | ||
583 | #define PROT_MTE 0x20 /* Normal Tagged mapping */ | ||
584 | |||
585 | +/* Override any generic PKEY permission defines */ | ||
586 | +#define PKEY_DISABLE_EXECUTE 0x4 | ||
587 | +#define PKEY_DISABLE_READ 0x8 | ||
588 | +#undef PKEY_ACCESS_MASK | ||
589 | +#define PKEY_ACCESS_MASK (PKEY_DISABLE_ACCESS |\ | ||
590 | + PKEY_DISABLE_WRITE |\ | ||
591 | + PKEY_DISABLE_READ |\ | ||
592 | + PKEY_DISABLE_EXECUTE) | ||
593 | + | ||
594 | #endif /* ! _UAPI__ASM_MMAN_H */ | ||
595 | diff --git a/linux-headers/asm-arm64/unistd.h b/linux-headers/asm-arm64/unistd.h | ||
596 | index XXXXXXX..XXXXXXX 100644 | ||
597 | --- a/linux-headers/asm-arm64/unistd.h | ||
598 | +++ b/linux-headers/asm-arm64/unistd.h | ||
599 | @@ -XXX,XX +XXX,XX @@ | ||
600 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ | ||
601 | -/* | ||
602 | - * Copyright (C) 2012 ARM Ltd. | ||
603 | - * | ||
604 | - * This program is free software; you can redistribute it and/or modify | ||
605 | - * it under the terms of the GNU General Public License version 2 as | ||
606 | - * published by the Free Software Foundation. | ||
607 | - * | ||
608 | - * This program is distributed in the hope that it will be useful, | ||
609 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
610 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
611 | - * GNU General Public License for more details. | ||
612 | - * | ||
613 | - * You should have received a copy of the GNU General Public License | ||
614 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
615 | - */ | ||
616 | - | ||
617 | -#define __ARCH_WANT_RENAMEAT | ||
618 | -#define __ARCH_WANT_NEW_STAT | ||
619 | -#define __ARCH_WANT_SET_GET_RLIMIT | ||
620 | -#define __ARCH_WANT_TIME32_SYSCALLS | ||
621 | -#define __ARCH_WANT_SYS_CLONE3 | ||
622 | -#define __ARCH_WANT_MEMFD_SECRET | ||
623 | - | ||
624 | -#include <asm-generic/unistd.h> | ||
625 | +#include <asm/unistd_64.h> | ||
626 | diff --git a/linux-headers/asm-generic/unistd.h b/linux-headers/asm-generic/unistd.h | ||
627 | index XXXXXXX..XXXXXXX 100644 | ||
628 | --- a/linux-headers/asm-generic/unistd.h | ||
629 | +++ b/linux-headers/asm-generic/unistd.h | ||
630 | @@ -XXX,XX +XXX,XX @@ __SC_COMP(__NR_pselect6_time64, sys_pselect6, compat_sys_pselect6_time64) | ||
631 | #define __NR_ppoll_time64 414 | ||
632 | __SC_COMP(__NR_ppoll_time64, sys_ppoll, compat_sys_ppoll_time64) | ||
633 | #define __NR_io_pgetevents_time64 416 | ||
634 | -__SYSCALL(__NR_io_pgetevents_time64, sys_io_pgetevents) | ||
635 | +__SC_COMP(__NR_io_pgetevents_time64, sys_io_pgetevents, compat_sys_io_pgetevents_time64) | ||
636 | #define __NR_recvmmsg_time64 417 | ||
637 | __SC_COMP(__NR_recvmmsg_time64, sys_recvmmsg, compat_sys_recvmmsg_time64) | ||
638 | #define __NR_mq_timedsend_time64 418 | ||
639 | @@ -XXX,XX +XXX,XX @@ __SYSCALL(__NR_fsmount, sys_fsmount) | ||
640 | __SYSCALL(__NR_fspick, sys_fspick) | ||
641 | #define __NR_pidfd_open 434 | ||
642 | __SYSCALL(__NR_pidfd_open, sys_pidfd_open) | ||
643 | - | ||
644 | -#ifdef __ARCH_WANT_SYS_CLONE3 | ||
645 | #define __NR_clone3 435 | ||
646 | __SYSCALL(__NR_clone3, sys_clone3) | ||
647 | -#endif | ||
648 | - | ||
649 | #define __NR_close_range 436 | ||
650 | __SYSCALL(__NR_close_range, sys_close_range) | ||
651 | #define __NR_openat2 437 | ||
652 | diff --git a/linux-headers/asm-loongarch/kvm.h b/linux-headers/asm-loongarch/kvm.h | ||
653 | index XXXXXXX..XXXXXXX 100644 | ||
654 | --- a/linux-headers/asm-loongarch/kvm.h | ||
655 | +++ b/linux-headers/asm-loongarch/kvm.h | ||
656 | @@ -XXX,XX +XXX,XX @@ struct kvm_fpu { | ||
657 | #define KVM_REG_LOONGARCH_KVM (KVM_REG_LOONGARCH | 0x20000ULL) | ||
658 | #define KVM_REG_LOONGARCH_FPSIMD (KVM_REG_LOONGARCH | 0x30000ULL) | ||
659 | #define KVM_REG_LOONGARCH_CPUCFG (KVM_REG_LOONGARCH | 0x40000ULL) | ||
660 | +#define KVM_REG_LOONGARCH_LBT (KVM_REG_LOONGARCH | 0x50000ULL) | ||
661 | #define KVM_REG_LOONGARCH_MASK (KVM_REG_LOONGARCH | 0x70000ULL) | ||
662 | #define KVM_CSR_IDX_MASK 0x7fff | ||
663 | #define KVM_CPUCFG_IDX_MASK 0x7fff | ||
664 | @@ -XXX,XX +XXX,XX @@ struct kvm_fpu { | ||
665 | /* Debugging: Special instruction for software breakpoint */ | ||
666 | #define KVM_REG_LOONGARCH_DEBUG_INST (KVM_REG_LOONGARCH_KVM | KVM_REG_SIZE_U64 | 3) | ||
667 | |||
668 | +/* LBT registers */ | ||
669 | +#define KVM_REG_LOONGARCH_LBT_SCR0 (KVM_REG_LOONGARCH_LBT | KVM_REG_SIZE_U64 | 1) | ||
670 | +#define KVM_REG_LOONGARCH_LBT_SCR1 (KVM_REG_LOONGARCH_LBT | KVM_REG_SIZE_U64 | 2) | ||
671 | +#define KVM_REG_LOONGARCH_LBT_SCR2 (KVM_REG_LOONGARCH_LBT | KVM_REG_SIZE_U64 | 3) | ||
672 | +#define KVM_REG_LOONGARCH_LBT_SCR3 (KVM_REG_LOONGARCH_LBT | KVM_REG_SIZE_U64 | 4) | ||
673 | +#define KVM_REG_LOONGARCH_LBT_EFLAGS (KVM_REG_LOONGARCH_LBT | KVM_REG_SIZE_U64 | 5) | ||
674 | +#define KVM_REG_LOONGARCH_LBT_FTOP (KVM_REG_LOONGARCH_LBT | KVM_REG_SIZE_U64 | 6) | ||
675 | + | ||
676 | #define LOONGARCH_REG_SHIFT 3 | ||
677 | #define LOONGARCH_REG_64(TYPE, REG) (TYPE | KVM_REG_SIZE_U64 | (REG << LOONGARCH_REG_SHIFT)) | ||
678 | #define KVM_IOC_CSRID(REG) LOONGARCH_REG_64(KVM_REG_LOONGARCH_CSR, REG) | ||
679 | #define KVM_IOC_CPUCFG(REG) LOONGARCH_REG_64(KVM_REG_LOONGARCH_CPUCFG, REG) | ||
680 | + | ||
681 | +/* Device Control API on vm fd */ | ||
682 | +#define KVM_LOONGARCH_VM_FEAT_CTRL 0 | ||
683 | +#define KVM_LOONGARCH_VM_FEAT_LSX 0 | ||
684 | +#define KVM_LOONGARCH_VM_FEAT_LASX 1 | ||
685 | +#define KVM_LOONGARCH_VM_FEAT_X86BT 2 | ||
686 | +#define KVM_LOONGARCH_VM_FEAT_ARMBT 3 | ||
687 | +#define KVM_LOONGARCH_VM_FEAT_MIPSBT 4 | ||
688 | +#define KVM_LOONGARCH_VM_FEAT_PMU 5 | ||
689 | +#define KVM_LOONGARCH_VM_FEAT_PV_IPI 6 | ||
690 | +#define KVM_LOONGARCH_VM_FEAT_PV_STEALTIME 7 | ||
691 | + | ||
692 | +/* Device Control API on vcpu fd */ | ||
693 | #define KVM_LOONGARCH_VCPU_CPUCFG 0 | ||
694 | +#define KVM_LOONGARCH_VCPU_PVTIME_CTRL 1 | ||
695 | +#define KVM_LOONGARCH_VCPU_PVTIME_GPA 0 | ||
696 | |||
697 | struct kvm_debug_exit_arch { | ||
698 | }; | ||
699 | diff --git a/linux-headers/asm-loongarch/unistd.h b/linux-headers/asm-loongarch/unistd.h | ||
700 | index XXXXXXX..XXXXXXX 100644 | ||
701 | --- a/linux-headers/asm-loongarch/unistd.h | ||
702 | +++ b/linux-headers/asm-loongarch/unistd.h | ||
703 | @@ -XXX,XX +XXX,XX @@ | ||
704 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ | ||
705 | -#define __ARCH_WANT_SYS_CLONE | ||
706 | -#define __ARCH_WANT_SYS_CLONE3 | ||
707 | |||
708 | -#include <asm-generic/unistd.h> | ||
709 | +#include <asm/unistd_64.h> | ||
710 | diff --git a/linux-headers/asm-riscv/kvm.h b/linux-headers/asm-riscv/kvm.h | ||
711 | index XXXXXXX..XXXXXXX 100644 | ||
712 | --- a/linux-headers/asm-riscv/kvm.h | ||
713 | +++ b/linux-headers/asm-riscv/kvm.h | ||
714 | @@ -XXX,XX +XXX,XX @@ enum KVM_RISCV_ISA_EXT_ID { | ||
715 | KVM_RISCV_ISA_EXT_ZTSO, | ||
716 | KVM_RISCV_ISA_EXT_ZACAS, | ||
717 | KVM_RISCV_ISA_EXT_SSCOFPMF, | ||
718 | + KVM_RISCV_ISA_EXT_ZIMOP, | ||
719 | + KVM_RISCV_ISA_EXT_ZCA, | ||
720 | + KVM_RISCV_ISA_EXT_ZCB, | ||
721 | + KVM_RISCV_ISA_EXT_ZCD, | ||
722 | + KVM_RISCV_ISA_EXT_ZCF, | ||
723 | + KVM_RISCV_ISA_EXT_ZCMOP, | ||
724 | + KVM_RISCV_ISA_EXT_ZAWRS, | ||
725 | KVM_RISCV_ISA_EXT_MAX, | ||
726 | }; | ||
727 | |||
728 | diff --git a/linux-headers/asm-riscv/unistd.h b/linux-headers/asm-riscv/unistd.h | ||
729 | index XXXXXXX..XXXXXXX 100644 | ||
730 | --- a/linux-headers/asm-riscv/unistd.h | ||
731 | +++ b/linux-headers/asm-riscv/unistd.h | ||
732 | @@ -XXX,XX +XXX,XX @@ | ||
733 | * You should have received a copy of the GNU General Public License | ||
734 | * along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
735 | */ | ||
736 | +#include <asm/bitsperlong.h> | ||
737 | |||
738 | -#if defined(__LP64__) && !defined(__SYSCALL_COMPAT) | ||
739 | -#define __ARCH_WANT_NEW_STAT | ||
740 | -#define __ARCH_WANT_SET_GET_RLIMIT | ||
741 | -#endif /* __LP64__ */ | ||
742 | - | ||
743 | -#define __ARCH_WANT_SYS_CLONE3 | ||
744 | -#define __ARCH_WANT_MEMFD_SECRET | ||
745 | - | ||
746 | -#include <asm-generic/unistd.h> | ||
747 | - | ||
748 | -/* | ||
749 | - * Allows the instruction cache to be flushed from userspace. Despite RISC-V | ||
750 | - * having a direct 'fence.i' instruction available to userspace (which we | ||
751 | - * can't trap!), that's not actually viable when running on Linux because the | ||
752 | - * kernel might schedule a process on another hart. There is no way for | ||
753 | - * userspace to handle this without invoking the kernel (as it doesn't know the | ||
754 | - * thread->hart mappings), so we've defined a RISC-V specific system call to | ||
755 | - * flush the instruction cache. | ||
756 | - * | ||
757 | - * __NR_riscv_flush_icache is defined to flush the instruction cache over an | ||
758 | - * address range, with the flush applying to either all threads or just the | ||
759 | - * caller. We don't currently do anything with the address range, that's just | ||
760 | - * in there for forwards compatibility. | ||
761 | - */ | ||
762 | -#ifndef __NR_riscv_flush_icache | ||
763 | -#define __NR_riscv_flush_icache (__NR_arch_specific_syscall + 15) | ||
764 | -#endif | ||
765 | -__SYSCALL(__NR_riscv_flush_icache, sys_riscv_flush_icache) | ||
766 | - | ||
767 | -/* | ||
768 | - * Allows userspace to query the kernel for CPU architecture and | ||
769 | - * microarchitecture details across a given set of CPUs. | ||
770 | - */ | ||
771 | -#ifndef __NR_riscv_hwprobe | ||
772 | -#define __NR_riscv_hwprobe (__NR_arch_specific_syscall + 14) | ||
773 | +#if __BITS_PER_LONG == 64 | ||
774 | +#include <asm/unistd_64.h> | ||
775 | +#else | ||
776 | +#include <asm/unistd_32.h> | ||
777 | #endif | ||
778 | -__SYSCALL(__NR_riscv_hwprobe, sys_riscv_hwprobe) | ||
779 | diff --git a/linux-headers/asm-x86/kvm.h b/linux-headers/asm-x86/kvm.h | ||
780 | index XXXXXXX..XXXXXXX 100644 | ||
781 | --- a/linux-headers/asm-x86/kvm.h | ||
782 | +++ b/linux-headers/asm-x86/kvm.h | ||
783 | @@ -XXX,XX +XXX,XX @@ struct kvm_ioapic_state { | ||
784 | |||
785 | #define KVM_RUN_X86_SMM (1 << 0) | ||
786 | #define KVM_RUN_X86_BUS_LOCK (1 << 1) | ||
787 | +#define KVM_RUN_X86_GUEST_MODE (1 << 2) | ||
788 | |||
789 | /* for KVM_GET_REGS and KVM_SET_REGS */ | ||
790 | struct kvm_regs { | ||
791 | @@ -XXX,XX +XXX,XX @@ struct kvm_sync_regs { | ||
792 | #define KVM_X86_QUIRK_MISC_ENABLE_NO_MWAIT (1 << 4) | ||
793 | #define KVM_X86_QUIRK_FIX_HYPERCALL_INSN (1 << 5) | ||
794 | #define KVM_X86_QUIRK_MWAIT_NEVER_UD_FAULTS (1 << 6) | ||
795 | +#define KVM_X86_QUIRK_SLOT_ZAP_ALL (1 << 7) | ||
796 | |||
797 | #define KVM_STATE_NESTED_FORMAT_VMX 0 | ||
798 | #define KVM_STATE_NESTED_FORMAT_SVM 1 | ||
799 | diff --git a/linux-headers/asm-x86/unistd_64.h b/linux-headers/asm-x86/unistd_64.h | ||
800 | index XXXXXXX..XXXXXXX 100644 | ||
801 | --- a/linux-headers/asm-x86/unistd_64.h | ||
802 | +++ b/linux-headers/asm-x86/unistd_64.h | ||
803 | @@ -XXX,XX +XXX,XX @@ | ||
804 | #define __NR_statx 332 | ||
805 | #define __NR_io_pgetevents 333 | ||
806 | #define __NR_rseq 334 | ||
807 | +#define __NR_uretprobe 335 | ||
808 | #define __NR_pidfd_send_signal 424 | ||
809 | #define __NR_io_uring_setup 425 | ||
810 | #define __NR_io_uring_enter 426 | ||
811 | diff --git a/linux-headers/asm-x86/unistd_x32.h b/linux-headers/asm-x86/unistd_x32.h | ||
812 | index XXXXXXX..XXXXXXX 100644 | ||
813 | --- a/linux-headers/asm-x86/unistd_x32.h | ||
814 | +++ b/linux-headers/asm-x86/unistd_x32.h | ||
815 | @@ -XXX,XX +XXX,XX @@ | ||
816 | #define __NR_statx (__X32_SYSCALL_BIT + 332) | ||
817 | #define __NR_io_pgetevents (__X32_SYSCALL_BIT + 333) | ||
818 | #define __NR_rseq (__X32_SYSCALL_BIT + 334) | ||
819 | +#define __NR_uretprobe (__X32_SYSCALL_BIT + 335) | ||
820 | #define __NR_pidfd_send_signal (__X32_SYSCALL_BIT + 424) | ||
821 | #define __NR_io_uring_setup (__X32_SYSCALL_BIT + 425) | ||
822 | #define __NR_io_uring_enter (__X32_SYSCALL_BIT + 426) | ||
823 | diff --git a/linux-headers/linux/bits.h b/linux-headers/linux/bits.h | ||
824 | index XXXXXXX..XXXXXXX 100644 | ||
825 | --- a/linux-headers/linux/bits.h | ||
826 | +++ b/linux-headers/linux/bits.h | ||
827 | @@ -XXX,XX +XXX,XX @@ | ||
828 | (((~_ULL(0)) - (_ULL(1) << (l)) + 1) & \ | ||
829 | (~_ULL(0) >> (__BITS_PER_LONG_LONG - 1 - (h)))) | ||
830 | |||
831 | +#define __GENMASK_U128(h, l) \ | ||
832 | + ((_BIT128((h)) << 1) - (_BIT128(l))) | ||
833 | + | ||
834 | #endif /* _LINUX_BITS_H */ | ||
835 | diff --git a/linux-headers/linux/const.h b/linux-headers/linux/const.h | ||
836 | index XXXXXXX..XXXXXXX 100644 | ||
837 | --- a/linux-headers/linux/const.h | ||
838 | +++ b/linux-headers/linux/const.h | ||
839 | @@ -XXX,XX +XXX,XX @@ | ||
840 | #define _BITUL(x) (_UL(1) << (x)) | ||
841 | #define _BITULL(x) (_ULL(1) << (x)) | ||
842 | |||
843 | +#if !defined(__ASSEMBLY__) | ||
844 | +/* | ||
845 | + * Missing __asm__ support | ||
846 | + * | ||
847 | + * __BIT128() would not work in the __asm__ code, as it shifts an | ||
848 | + * 'unsigned __init128' data type as direct representation of | ||
849 | + * 128 bit constants is not supported in the gcc compiler, as | ||
850 | + * they get silently truncated. | ||
851 | + * | ||
852 | + * TODO: Please revisit this implementation when gcc compiler | ||
853 | + * starts representing 128 bit constants directly like long | ||
854 | + * and unsigned long etc. Subsequently drop the comment for | ||
855 | + * GENMASK_U128() which would then start supporting __asm__ code. | ||
856 | + */ | ||
857 | +#define _BIT128(x) ((unsigned __int128)(1) << (x)) | ||
858 | +#endif | ||
859 | + | ||
860 | #define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (__typeof__(x))(a) - 1) | ||
861 | #define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask)) | ||
862 | |||
863 | diff --git a/linux-headers/linux/iommufd.h b/linux-headers/linux/iommufd.h | ||
864 | index XXXXXXX..XXXXXXX 100644 | ||
865 | --- a/linux-headers/linux/iommufd.h | ||
866 | +++ b/linux-headers/linux/iommufd.h | ||
867 | @@ -XXX,XX +XXX,XX @@ | ||
868 | #ifndef _IOMMUFD_H | ||
869 | #define _IOMMUFD_H | ||
870 | |||
871 | -#include <linux/types.h> | ||
872 | #include <linux/ioctl.h> | ||
873 | +#include <linux/types.h> | ||
874 | |||
875 | #define IOMMUFD_TYPE (';') | ||
876 | |||
877 | @@ -XXX,XX +XXX,XX @@ | ||
878 | enum { | ||
879 | IOMMUFD_CMD_BASE = 0x80, | ||
880 | IOMMUFD_CMD_DESTROY = IOMMUFD_CMD_BASE, | ||
881 | - IOMMUFD_CMD_IOAS_ALLOC, | ||
882 | - IOMMUFD_CMD_IOAS_ALLOW_IOVAS, | ||
883 | - IOMMUFD_CMD_IOAS_COPY, | ||
884 | - IOMMUFD_CMD_IOAS_IOVA_RANGES, | ||
885 | - IOMMUFD_CMD_IOAS_MAP, | ||
886 | - IOMMUFD_CMD_IOAS_UNMAP, | ||
887 | - IOMMUFD_CMD_OPTION, | ||
888 | - IOMMUFD_CMD_VFIO_IOAS, | ||
889 | - IOMMUFD_CMD_HWPT_ALLOC, | ||
890 | - IOMMUFD_CMD_GET_HW_INFO, | ||
891 | - IOMMUFD_CMD_HWPT_SET_DIRTY_TRACKING, | ||
892 | - IOMMUFD_CMD_HWPT_GET_DIRTY_BITMAP, | ||
893 | - IOMMUFD_CMD_HWPT_INVALIDATE, | ||
894 | + IOMMUFD_CMD_IOAS_ALLOC = 0x81, | ||
895 | + IOMMUFD_CMD_IOAS_ALLOW_IOVAS = 0x82, | ||
896 | + IOMMUFD_CMD_IOAS_COPY = 0x83, | ||
897 | + IOMMUFD_CMD_IOAS_IOVA_RANGES = 0x84, | ||
898 | + IOMMUFD_CMD_IOAS_MAP = 0x85, | ||
899 | + IOMMUFD_CMD_IOAS_UNMAP = 0x86, | ||
900 | + IOMMUFD_CMD_OPTION = 0x87, | ||
901 | + IOMMUFD_CMD_VFIO_IOAS = 0x88, | ||
902 | + IOMMUFD_CMD_HWPT_ALLOC = 0x89, | ||
903 | + IOMMUFD_CMD_GET_HW_INFO = 0x8a, | ||
904 | + IOMMUFD_CMD_HWPT_SET_DIRTY_TRACKING = 0x8b, | ||
905 | + IOMMUFD_CMD_HWPT_GET_DIRTY_BITMAP = 0x8c, | ||
906 | + IOMMUFD_CMD_HWPT_INVALIDATE = 0x8d, | ||
907 | + IOMMUFD_CMD_FAULT_QUEUE_ALLOC = 0x8e, | ||
908 | }; | ||
909 | |||
910 | /** | ||
911 | @@ -XXX,XX +XXX,XX @@ struct iommu_vfio_ioas { | ||
912 | * the parent HWPT in a nesting configuration. | ||
913 | * @IOMMU_HWPT_ALLOC_DIRTY_TRACKING: Dirty tracking support for device IOMMU is | ||
914 | * enforced on device attachment | ||
915 | + * @IOMMU_HWPT_FAULT_ID_VALID: The fault_id field of hwpt allocation data is | ||
916 | + * valid. | ||
917 | */ | ||
918 | enum iommufd_hwpt_alloc_flags { | ||
919 | IOMMU_HWPT_ALLOC_NEST_PARENT = 1 << 0, | ||
920 | IOMMU_HWPT_ALLOC_DIRTY_TRACKING = 1 << 1, | ||
921 | + IOMMU_HWPT_FAULT_ID_VALID = 1 << 2, | ||
922 | }; | ||
923 | |||
924 | /** | ||
925 | @@ -XXX,XX +XXX,XX @@ struct iommu_hwpt_vtd_s1 { | ||
926 | * @IOMMU_HWPT_DATA_VTD_S1: Intel VT-d stage-1 page table | ||
927 | */ | ||
928 | enum iommu_hwpt_data_type { | ||
929 | - IOMMU_HWPT_DATA_NONE, | ||
930 | - IOMMU_HWPT_DATA_VTD_S1, | ||
931 | + IOMMU_HWPT_DATA_NONE = 0, | ||
932 | + IOMMU_HWPT_DATA_VTD_S1 = 1, | ||
933 | }; | ||
934 | |||
935 | /** | ||
936 | @@ -XXX,XX +XXX,XX @@ enum iommu_hwpt_data_type { | ||
937 | * @data_type: One of enum iommu_hwpt_data_type | ||
938 | * @data_len: Length of the type specific data | ||
939 | * @data_uptr: User pointer to the type specific data | ||
940 | + * @fault_id: The ID of IOMMUFD_FAULT object. Valid only if flags field of | ||
941 | + * IOMMU_HWPT_FAULT_ID_VALID is set. | ||
942 | + * @__reserved2: Padding to 64-bit alignment. Must be 0. | ||
943 | * | ||
944 | * Explicitly allocate a hardware page table object. This is the same object | ||
945 | * type that is returned by iommufd_device_attach() and represents the | ||
946 | @@ -XXX,XX +XXX,XX @@ struct iommu_hwpt_alloc { | ||
947 | __u32 data_type; | ||
948 | __u32 data_len; | ||
949 | __aligned_u64 data_uptr; | ||
950 | + __u32 fault_id; | ||
951 | + __u32 __reserved2; | ||
952 | }; | ||
953 | #define IOMMU_HWPT_ALLOC _IO(IOMMUFD_TYPE, IOMMUFD_CMD_HWPT_ALLOC) | ||
954 | |||
955 | @@ -XXX,XX +XXX,XX @@ struct iommu_hw_info_vtd { | ||
956 | * @IOMMU_HW_INFO_TYPE_INTEL_VTD: Intel VT-d iommu info type | ||
957 | */ | ||
958 | enum iommu_hw_info_type { | ||
959 | - IOMMU_HW_INFO_TYPE_NONE, | ||
960 | - IOMMU_HW_INFO_TYPE_INTEL_VTD, | ||
961 | + IOMMU_HW_INFO_TYPE_NONE = 0, | ||
962 | + IOMMU_HW_INFO_TYPE_INTEL_VTD = 1, | ||
963 | }; | ||
964 | |||
965 | /** | ||
966 | @@ -XXX,XX +XXX,XX @@ struct iommu_hwpt_get_dirty_bitmap { | ||
967 | * @IOMMU_HWPT_INVALIDATE_DATA_VTD_S1: Invalidation data for VTD_S1 | ||
968 | */ | ||
969 | enum iommu_hwpt_invalidate_data_type { | ||
970 | - IOMMU_HWPT_INVALIDATE_DATA_VTD_S1, | ||
971 | + IOMMU_HWPT_INVALIDATE_DATA_VTD_S1 = 0, | ||
972 | }; | ||
973 | |||
974 | /** | ||
975 | @@ -XXX,XX +XXX,XX @@ struct iommu_hwpt_invalidate { | ||
976 | __u32 __reserved; | ||
977 | }; | ||
978 | #define IOMMU_HWPT_INVALIDATE _IO(IOMMUFD_TYPE, IOMMUFD_CMD_HWPT_INVALIDATE) | ||
979 | + | ||
980 | +/** | ||
981 | + * enum iommu_hwpt_pgfault_flags - flags for struct iommu_hwpt_pgfault | ||
982 | + * @IOMMU_PGFAULT_FLAGS_PASID_VALID: The pasid field of the fault data is | ||
983 | + * valid. | ||
984 | + * @IOMMU_PGFAULT_FLAGS_LAST_PAGE: It's the last fault of a fault group. | ||
985 | + */ | ||
986 | +enum iommu_hwpt_pgfault_flags { | ||
987 | + IOMMU_PGFAULT_FLAGS_PASID_VALID = (1 << 0), | ||
988 | + IOMMU_PGFAULT_FLAGS_LAST_PAGE = (1 << 1), | ||
989 | +}; | ||
990 | + | ||
991 | +/** | ||
992 | + * enum iommu_hwpt_pgfault_perm - perm bits for struct iommu_hwpt_pgfault | ||
993 | + * @IOMMU_PGFAULT_PERM_READ: request for read permission | ||
994 | + * @IOMMU_PGFAULT_PERM_WRITE: request for write permission | ||
995 | + * @IOMMU_PGFAULT_PERM_EXEC: (PCIE 10.4.1) request with a PASID that has the | ||
996 | + * Execute Requested bit set in PASID TLP Prefix. | ||
997 | + * @IOMMU_PGFAULT_PERM_PRIV: (PCIE 10.4.1) request with a PASID that has the | ||
998 | + * Privileged Mode Requested bit set in PASID TLP | ||
999 | + * Prefix. | ||
1000 | + */ | ||
1001 | +enum iommu_hwpt_pgfault_perm { | ||
1002 | + IOMMU_PGFAULT_PERM_READ = (1 << 0), | ||
1003 | + IOMMU_PGFAULT_PERM_WRITE = (1 << 1), | ||
1004 | + IOMMU_PGFAULT_PERM_EXEC = (1 << 2), | ||
1005 | + IOMMU_PGFAULT_PERM_PRIV = (1 << 3), | ||
1006 | +}; | ||
1007 | + | ||
1008 | +/** | ||
1009 | + * struct iommu_hwpt_pgfault - iommu page fault data | ||
1010 | + * @flags: Combination of enum iommu_hwpt_pgfault_flags | ||
1011 | + * @dev_id: id of the originated device | ||
1012 | + * @pasid: Process Address Space ID | ||
1013 | + * @grpid: Page Request Group Index | ||
1014 | + * @perm: Combination of enum iommu_hwpt_pgfault_perm | ||
1015 | + * @addr: Fault address | ||
1016 | + * @length: a hint of how much data the requestor is expecting to fetch. For | ||
1017 | + * example, if the PRI initiator knows it is going to do a 10MB | ||
1018 | + * transfer, it could fill in 10MB and the OS could pre-fault in | ||
1019 | + * 10MB of IOVA. It's default to 0 if there's no such hint. | ||
1020 | + * @cookie: kernel-managed cookie identifying a group of fault messages. The | ||
1021 | + * cookie number encoded in the last page fault of the group should | ||
1022 | + * be echoed back in the response message. | ||
1023 | + */ | ||
1024 | +struct iommu_hwpt_pgfault { | ||
1025 | + __u32 flags; | ||
1026 | + __u32 dev_id; | ||
1027 | + __u32 pasid; | ||
1028 | + __u32 grpid; | ||
1029 | + __u32 perm; | ||
1030 | + __u64 addr; | ||
1031 | + __u32 length; | ||
1032 | + __u32 cookie; | ||
1033 | +}; | ||
1034 | + | ||
1035 | +/** | ||
1036 | + * enum iommufd_page_response_code - Return status of fault handlers | ||
1037 | + * @IOMMUFD_PAGE_RESP_SUCCESS: Fault has been handled and the page tables | ||
1038 | + * populated, retry the access. This is the | ||
1039 | + * "Success" defined in PCI 10.4.2.1. | ||
1040 | + * @IOMMUFD_PAGE_RESP_INVALID: Could not handle this fault, don't retry the | ||
1041 | + * access. This is the "Invalid Request" in PCI | ||
1042 | + * 10.4.2.1. | ||
1043 | + */ | ||
1044 | +enum iommufd_page_response_code { | ||
1045 | + IOMMUFD_PAGE_RESP_SUCCESS = 0, | ||
1046 | + IOMMUFD_PAGE_RESP_INVALID = 1, | ||
1047 | +}; | ||
1048 | + | ||
1049 | +/** | ||
1050 | + * struct iommu_hwpt_page_response - IOMMU page fault response | ||
1051 | + * @cookie: The kernel-managed cookie reported in the fault message. | ||
1052 | + * @code: One of response code in enum iommufd_page_response_code. | ||
1053 | + */ | ||
1054 | +struct iommu_hwpt_page_response { | ||
1055 | + __u32 cookie; | ||
1056 | + __u32 code; | ||
1057 | +}; | ||
1058 | + | ||
1059 | +/** | ||
1060 | + * struct iommu_fault_alloc - ioctl(IOMMU_FAULT_QUEUE_ALLOC) | ||
1061 | + * @size: sizeof(struct iommu_fault_alloc) | ||
1062 | + * @flags: Must be 0 | ||
1063 | + * @out_fault_id: The ID of the new FAULT | ||
1064 | + * @out_fault_fd: The fd of the new FAULT | ||
1065 | + * | ||
1066 | + * Explicitly allocate a fault handling object. | ||
1067 | + */ | ||
1068 | +struct iommu_fault_alloc { | ||
1069 | + __u32 size; | ||
1070 | + __u32 flags; | ||
1071 | + __u32 out_fault_id; | ||
1072 | + __u32 out_fault_fd; | ||
1073 | +}; | ||
1074 | +#define IOMMU_FAULT_QUEUE_ALLOC _IO(IOMMUFD_TYPE, IOMMUFD_CMD_FAULT_QUEUE_ALLOC) | ||
1075 | #endif | ||
1076 | diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h | ||
1077 | index XXXXXXX..XXXXXXX 100644 | ||
1078 | --- a/linux-headers/linux/kvm.h | ||
1079 | +++ b/linux-headers/linux/kvm.h | ||
1080 | @@ -XXX,XX +XXX,XX @@ struct kvm_xen_exit { | ||
1081 | /* Flags that describe what fields in emulation_failure hold valid data. */ | ||
1082 | #define KVM_INTERNAL_ERROR_EMULATION_FLAG_INSTRUCTION_BYTES (1ULL << 0) | ||
1083 | |||
1084 | +/* | ||
1085 | + * struct kvm_run can be modified by userspace at any time, so KVM must be | ||
1086 | + * careful to avoid TOCTOU bugs. In order to protect KVM, HINT_UNSAFE_IN_KVM() | ||
1087 | + * renames fields in struct kvm_run from <symbol> to <symbol>__unsafe when | ||
1088 | + * compiled into the kernel, ensuring that any use within KVM is obvious and | ||
1089 | + * gets extra scrutiny. | ||
1090 | + */ | ||
1091 | +#define HINT_UNSAFE_IN_KVM(_symbol) _symbol | ||
1092 | + | ||
1093 | /* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */ | ||
1094 | struct kvm_run { | ||
1095 | /* in */ | ||
1096 | __u8 request_interrupt_window; | ||
1097 | - __u8 immediate_exit; | ||
1098 | + __u8 HINT_UNSAFE_IN_KVM(immediate_exit); | ||
1099 | __u8 padding1[6]; | ||
1100 | |||
1101 | /* out */ | ||
1102 | @@ -XXX,XX +XXX,XX @@ struct kvm_enable_cap { | ||
1103 | #define KVM_CAP_MEMORY_ATTRIBUTES 233 | ||
1104 | #define KVM_CAP_GUEST_MEMFD 234 | ||
1105 | #define KVM_CAP_VM_TYPES 235 | ||
1106 | +#define KVM_CAP_PRE_FAULT_MEMORY 236 | ||
1107 | +#define KVM_CAP_X86_APIC_BUS_CYCLES_NS 237 | ||
1108 | +#define KVM_CAP_X86_GUEST_MODE 238 | ||
1109 | |||
1110 | struct kvm_irq_routing_irqchip { | ||
1111 | __u32 irqchip; | ||
1112 | @@ -XXX,XX +XXX,XX @@ struct kvm_create_guest_memfd { | ||
1113 | __u64 reserved[6]; | ||
1114 | }; | ||
1115 | |||
1116 | +#define KVM_PRE_FAULT_MEMORY _IOWR(KVMIO, 0xd5, struct kvm_pre_fault_memory) | ||
1117 | + | ||
1118 | +struct kvm_pre_fault_memory { | ||
1119 | + __u64 gpa; | ||
1120 | + __u64 size; | ||
1121 | + __u64 flags; | ||
1122 | + __u64 padding[5]; | ||
1123 | +}; | ||
1124 | + | ||
1125 | #endif /* __LINUX_KVM_H */ | ||
1126 | diff --git a/linux-headers/linux/mman.h b/linux-headers/linux/mman.h | ||
1127 | index XXXXXXX..XXXXXXX 100644 | ||
1128 | --- a/linux-headers/linux/mman.h | ||
1129 | +++ b/linux-headers/linux/mman.h | ||
1130 | @@ -XXX,XX +XXX,XX @@ | ||
1131 | #define MAP_SHARED 0x01 /* Share changes */ | ||
1132 | #define MAP_PRIVATE 0x02 /* Changes are private */ | ||
1133 | #define MAP_SHARED_VALIDATE 0x03 /* share + validate extension flags */ | ||
1134 | +#define MAP_DROPPABLE 0x08 /* Zero memory under memory pressure. */ | ||
1135 | |||
1136 | /* | ||
1137 | * Huge page size encoding when MAP_HUGETLB is specified, and a huge page | ||
1138 | diff --git a/linux-headers/linux/psp-sev.h b/linux-headers/linux/psp-sev.h | ||
1139 | index XXXXXXX..XXXXXXX 100644 | ||
1140 | --- a/linux-headers/linux/psp-sev.h | ||
1141 | +++ b/linux-headers/linux/psp-sev.h | ||
1142 | @@ -XXX,XX +XXX,XX @@ enum { | ||
1143 | SNP_PLATFORM_STATUS, | ||
1144 | SNP_COMMIT, | ||
1145 | SNP_SET_CONFIG, | ||
1146 | + SNP_VLEK_LOAD, | ||
1147 | |||
1148 | SEV_MAX, | ||
1149 | }; | ||
1150 | @@ -XXX,XX +XXX,XX @@ typedef enum { | ||
1151 | SEV_RET_INVALID_PLATFORM_STATE, | ||
1152 | SEV_RET_INVALID_GUEST_STATE, | ||
1153 | SEV_RET_INAVLID_CONFIG, | ||
1154 | + SEV_RET_INVALID_CONFIG = SEV_RET_INAVLID_CONFIG, | ||
1155 | SEV_RET_INVALID_LEN, | ||
1156 | SEV_RET_ALREADY_OWNED, | ||
1157 | SEV_RET_INVALID_CERTIFICATE, | ||
1158 | @@ -XXX,XX +XXX,XX @@ struct sev_user_data_snp_config { | ||
1159 | __u8 rsvd1[52]; | ||
1160 | } __attribute__((packed)); | ||
1161 | |||
1162 | +/** | ||
1163 | + * struct sev_data_snp_vlek_load - SNP_VLEK_LOAD structure | ||
1164 | + * | ||
1165 | + * @len: length of the command buffer read by the PSP | ||
1166 | + * @vlek_wrapped_version: version of wrapped VLEK hashstick (Must be 0h) | ||
1167 | + * @rsvd: reserved | ||
1168 | + * @vlek_wrapped_address: address of a wrapped VLEK hashstick | ||
1169 | + * (struct sev_user_data_snp_wrapped_vlek_hashstick) | ||
1170 | + */ | ||
1171 | +struct sev_user_data_snp_vlek_load { | ||
1172 | + __u32 len; /* In */ | ||
1173 | + __u8 vlek_wrapped_version; /* In */ | ||
1174 | + __u8 rsvd[3]; /* In */ | ||
1175 | + __u64 vlek_wrapped_address; /* In */ | ||
1176 | +} __attribute__((packed)); | ||
1177 | + | ||
1178 | +/** | ||
1179 | + * struct sev_user_data_snp_vlek_wrapped_vlek_hashstick - Wrapped VLEK data | ||
1180 | + * | ||
1181 | + * @data: Opaque data provided by AMD KDS (as described in SEV-SNP Firmware ABI | ||
1182 | + * 1.54, SNP_VLEK_LOAD) | ||
1183 | + */ | ||
1184 | +struct sev_user_data_snp_wrapped_vlek_hashstick { | ||
1185 | + __u8 data[432]; /* In */ | ||
1186 | +} __attribute__((packed)); | ||
1187 | + | ||
1188 | /** | ||
1189 | * struct sev_issue_cmd - SEV ioctl parameters | ||
1190 | * | ||
1191 | -- | 42 | -- |
1192 | 2.46.0 | 43 | 2.48.1 |
1193 | 44 | ||
1194 | 45 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | Extend virtio-gpu documentation with a link to the Mesa VirGL | ||
2 | documentation. | ||
1 | 3 | ||
4 | Suggested-by: Akihiko Odaki <akihiko.odaki@daynix.com> | ||
5 | Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com> | ||
6 | Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> | ||
7 | --- | ||
8 | docs/system/devices/virtio-gpu.rst | 3 ++- | ||
9 | 1 file changed, 2 insertions(+), 1 deletion(-) | ||
10 | |||
11 | diff --git a/docs/system/devices/virtio-gpu.rst b/docs/system/devices/virtio-gpu.rst | ||
12 | index XXXXXXX..XXXXXXX 100644 | ||
13 | --- a/docs/system/devices/virtio-gpu.rst | ||
14 | +++ b/docs/system/devices/virtio-gpu.rst | ||
15 | @@ -XXX,XX +XXX,XX @@ on typical modern Linux distributions. | ||
16 | virtio-gpu virglrenderer | ||
17 | ------------------------ | ||
18 | |||
19 | -When using virgl accelerated graphics mode in the guest, OpenGL API calls | ||
20 | +When using `virgl`_ accelerated graphics mode in the guest, OpenGL API calls | ||
21 | are translated into an intermediate representation (see `Gallium3D`_). The | ||
22 | intermediate representation is communicated to the host and the | ||
23 | `virglrenderer`_ library on the host translates the intermediate | ||
24 | @@ -XXX,XX +XXX,XX @@ representation back to OpenGL API calls. | ||
25 | .. parsed-literal:: | ||
26 | -device virtio-gpu-gl | ||
27 | |||
28 | +.. _virgl: https://docs.mesa3d.org/drivers/virgl.html | ||
29 | .. _Gallium3D: https://www.freedesktop.org/wiki/Software/gallium/ | ||
30 | .. _virglrenderer: https://gitlab.freedesktop.org/virgl/virglrenderer/ | ||
31 | |||
32 | -- | ||
33 | 2.48.1 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | Change virtio-gpu Venus link, pointing it at the Mesa Venus | ||
2 | documentation instead of the protocol. The Mesa doc provides more | ||
3 | information and also has a link to the protocol. | ||
1 | 4 | ||
5 | Suggested-by: Akihiko Odaki <akihiko.odaki@daynix.com> | ||
6 | Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com> | ||
7 | Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> | ||
8 | --- | ||
9 | docs/system/devices/virtio-gpu.rst | 2 +- | ||
10 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
11 | |||
12 | diff --git a/docs/system/devices/virtio-gpu.rst b/docs/system/devices/virtio-gpu.rst | ||
13 | index XXXXXXX..XXXXXXX 100644 | ||
14 | --- a/docs/system/devices/virtio-gpu.rst | ||
15 | +++ b/docs/system/devices/virtio-gpu.rst | ||
16 | @@ -XXX,XX +XXX,XX @@ of virtio-gpu host memory window. This is typically between 256M and 8G. | ||
17 | .. parsed-literal:: | ||
18 | -device virtio-gpu-gl,hostmem=8G,blob=true,venus=true | ||
19 | |||
20 | -.. _venus: https://gitlab.freedesktop.org/virgl/venus-protocol/ | ||
21 | +.. _venus: https://docs.mesa3d.org/drivers/venus.html | ||
22 | |||
23 | DRM native context is supported since release of `virglrenderer`_ v1.0.0 | ||
24 | using `drm`_ protocol. ``DRM`` virtio-gpu capability set ("capset") requires | ||
25 | -- | ||
26 | 2.48.1 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Alex Bennée <alex.bennee@linaro.org> | ||
1 | 2 | ||
3 | This attempts to tidy up the VirtIO GPU documentation to make the list | ||
4 | of requirements clearer. There are still a lot of moving parts and the | ||
5 | distros have some catching up to do before this is all handled | ||
6 | automatically. | ||
7 | |||
8 | Signed-off-by: Alex Bennée <alex.bennee@linaro.org> | ||
9 | Cc: Sergio Lopez Pascual <slp@redhat.com> | ||
10 | Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> | ||
11 | [dmitry.osipenko@collabora.com: Extended and corrected doc] | ||
12 | --- | ||
13 | docs/system/devices/virtio-gpu.rst | 101 ++++++++++++++++++++++++++++- | ||
14 | 1 file changed, 98 insertions(+), 3 deletions(-) | ||
15 | |||
16 | diff --git a/docs/system/devices/virtio-gpu.rst b/docs/system/devices/virtio-gpu.rst | ||
17 | index XXXXXXX..XXXXXXX 100644 | ||
18 | --- a/docs/system/devices/virtio-gpu.rst | ||
19 | +++ b/docs/system/devices/virtio-gpu.rst | ||
20 | @@ -XXX,XX +XXX,XX @@ virtio-gpu | ||
21 | ========== | ||
22 | |||
23 | This document explains the setup and usage of the virtio-gpu device. | ||
24 | -The virtio-gpu device paravirtualizes the GPU and display controller. | ||
25 | +The virtio-gpu device provides a GPU and display controller | ||
26 | +paravirtualized using VirtIO. It supports a number of different modes | ||
27 | +from simple 2D displays to fully accelerated 3D graphics. | ||
28 | |||
29 | -Linux kernel support | ||
30 | --------------------- | ||
31 | +Linux guest kernel support | ||
32 | +-------------------------- | ||
33 | |||
34 | virtio-gpu requires a guest Linux kernel built with the | ||
35 | ``CONFIG_DRM_VIRTIO_GPU`` option. | ||
36 | |||
37 | +3D acceleration | ||
38 | +--------------- | ||
39 | + | ||
40 | +3D acceleration of a virtualized GPU is still an evolving field. | ||
41 | +Depending on the 3D mode you are running you may need to override | ||
42 | +distribution supplied libraries with more recent versions or enable | ||
43 | +build options. There are a number of requirements the host must meet | ||
44 | +to be able to be able to support guests. QEMU must be able to access the | ||
45 | +host's GPU and for the best performance be able to reliably share GPU | ||
46 | +memory with the guest. Details of 3D acceleration requirements are | ||
47 | +described in a further sections. | ||
48 | + | ||
49 | QEMU virtio-gpu variants | ||
50 | ------------------------ | ||
51 | |||
52 | @@ -XXX,XX +XXX,XX @@ intermediate representation is communicated to the host and the | ||
53 | `virglrenderer`_ library on the host translates the intermediate | ||
54 | representation back to OpenGL API calls. | ||
55 | |||
56 | +By default OpenGL version on guest is limited to 4.3. In order to enable | ||
57 | +OpenGL 4.6 support, virtio-gpu host blobs feature (``hostmem`` and ``blob`` | ||
58 | +fields) should be enabled. The ``hostmem`` field specifies the size of | ||
59 | +virtio-gpu host memory window. This is typically between 256M and 8G. | ||
60 | + | ||
61 | .. parsed-literal:: | ||
62 | -device virtio-gpu-gl | ||
63 | + -device virtio-gpu-gl,hostmem=8G,blob=true | ||
64 | |||
65 | .. _virgl: https://docs.mesa3d.org/drivers/virgl.html | ||
66 | .. _Gallium3D: https://www.freedesktop.org/wiki/Software/gallium/ | ||
67 | @@ -XXX,XX +XXX,XX @@ of virtio-gpu host memory window. This is typically between 256M and 8G. | ||
68 | |||
69 | .. _drm: https://gitlab.freedesktop.org/virgl/virglrenderer/-/tree/main/src/drm | ||
70 | |||
71 | +.. list-table:: Linux Host Requirements | ||
72 | + :header-rows: 1 | ||
73 | + | ||
74 | + * - Capability | ||
75 | + - Kernel Version | ||
76 | + - Libvirglrenderer Version | ||
77 | + * - OpenGL pass-through | ||
78 | + - Any Linux version compatible with QEMU if not using host blobs feature, | ||
79 | + Linux 6.13+ otherwise | ||
80 | + - 0.8.2+ | ||
81 | + * - Vulkan pass-through | ||
82 | + - Linux 6.13+ | ||
83 | + - 1.0.0+ | ||
84 | + * - AMDGPU DRM native context | ||
85 | + - Linux 6.13+ | ||
86 | + - 1.1.0+ | ||
87 | + * - Freedreno DRM native context | ||
88 | + - Linux 6.4+ | ||
89 | + - 1.0.0+ | ||
90 | + * - Intel i915 DRM native context | ||
91 | + - Linux 6.13+ | ||
92 | + - `mr1384`_ | ||
93 | + * - Asahi DRM native context | ||
94 | + - `Downstream version`_ of Asahi Linux kernel | ||
95 | + - `mr1274`_ | ||
96 | + | ||
97 | +.. _mr1384: https://gitlab.freedesktop.org/virgl/virglrenderer/-/merge_requests/1384 | ||
98 | +.. _mr1274: https://gitlab.freedesktop.org/virgl/virglrenderer/-/merge_requests/1274 | ||
99 | +.. _Downstream version: https://github.com/AsahiLinux/linux | ||
100 | + | ||
101 | +.. list-table:: Linux Guest Requirements | ||
102 | + :header-rows: 1 | ||
103 | + | ||
104 | + * - Capability | ||
105 | + - Kernel Version | ||
106 | + - Mesa Version | ||
107 | + * - OpenGL pass-through | ||
108 | + - Any Linux version supporting virtio-gpu | ||
109 | + - 16.0.0+ | ||
110 | + * - Vulkan pass-through | ||
111 | + - Linux 5.16+ | ||
112 | + - 24.2.0+ | ||
113 | + * - AMDGPU DRM native context | ||
114 | + - Linux 6.14+ | ||
115 | + - 25.0.0+ | ||
116 | + * - Freedreno DRM native context | ||
117 | + - Linux 6.14+ | ||
118 | + - 23.1.0+ | ||
119 | + * - Intel i915 DRM native context | ||
120 | + - Linux 6.14+ | ||
121 | + - `mr29870`_ | ||
122 | + * - Asahi DRM native context | ||
123 | + - Linux 6.14+ | ||
124 | + - 24.2.0+ | ||
125 | + | ||
126 | +.. _mr29870: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29870 | ||
127 | + | ||
128 | virtio-gpu rutabaga | ||
129 | ------------------- | ||
130 | |||
131 | @@ -XXX,XX +XXX,XX @@ Surfaceless is the default if ``wsi`` is not specified. | ||
132 | .. _Wayland display passthrough: https://www.youtube.com/watch?v=OZJiHMtIQ2M | ||
133 | .. _gfxstream-enabled rutabaga: https://crosvm.dev/book/appendix/rutabaga_gfx.html | ||
134 | .. _guest Wayland proxy: https://crosvm.dev/book/devices/wayland.html | ||
135 | + | ||
136 | +.. list-table:: Linux Host Requirements | ||
137 | + :header-rows: 1 | ||
138 | + | ||
139 | + * - Capability | ||
140 | + - Kernel Version | ||
141 | + * - Vulkan+Wayland pass-through | ||
142 | + - Linux 6.13+ | ||
143 | + | ||
144 | +.. list-table:: Linux Guest Requirements | ||
145 | + :header-rows: 1 | ||
146 | + | ||
147 | + * - Capability | ||
148 | + - Kernel Version | ||
149 | + - Mesa Version | ||
150 | + * - Vulkan+Wayland pass-through | ||
151 | + - Linux 5.16+ | ||
152 | + - 24.3.0+ | ||
153 | -- | ||
154 | 2.48.1 | ||
155 | |||
156 | diff view generated by jsdifflib |