Commit 5385302
feat: MSI interrupt-driven VirtIO GPU + VirGL command encoding fixes
Replace busy-polling with MSI interrupt + WFI completion for VirtIO GPU
commands. Each VirGL frame previously burned ~50ms spinning in a tight
poll loop with SeqCst fences. Now the guest halts with WFI, Parallels
processes the command immediately, and delivers an MSI interrupt to wake
the vCPU. Result: 10 FPS → 2000-3000 FPS.
Key changes:
- SPI allocation infrastructure (allocate_msi_spi) so GPU and xHCI
don't collide on the same GICv2m SPI
- Cached queue notify addresses — single write_volatile instead of
3 MMIO ops per notification
- MSI setup + interrupt handler with WFI completion loop
- GPU MSI dispatch in aarch64 exception handler
VirGL command encoding fixes:
- Rasterizer fill mode was POINT (2) instead of FILL (0) — all
triangles rendered as invisible 1-pixel dots
- SET_VERTEX_BUFFERS had spurious start_slot DWORD making length%3!=0,
causing silent EINVAL from host (vertex buffers never bound)
- SHADER_FRAGMENT constant was 4 (TESS_EVAL) instead of 1
- Shader compilation never triggered (bit 31 not set in offset field)
Also adds VirGL command encoder module (virgl.rs), Linux reference
implementations for Parallels VirGL benchmarking, and minor cleanups.
Co-Authored-By: Ryan Breen <rbreen@gmail.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent add8de8 commit 5385302
17 files changed
Lines changed: 3282 additions & 105 deletions
File tree
- kernel/src
- arch_impl/aarch64
- drivers
- usb
- virtio
- graphics
- signal
- syscall
- libs/libbreenix/src
- scripts/parallels
- userspace/programs/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1028 | 1028 | | |
1029 | 1029 | | |
1030 | 1030 | | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
1031 | 1037 | | |
1032 | 1038 | | |
1033 | 1039 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | 171 | | |
177 | 172 | | |
178 | 173 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
101 | 108 | | |
102 | 109 | | |
103 | 110 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4122 | 4122 | | |
4123 | 4123 | | |
4124 | 4124 | | |
4125 | | - | |
| 4125 | + | |
4126 | 4126 | | |
4127 | 4127 | | |
4128 | 4128 | | |
| |||
4146 | 4146 | | |
4147 | 4147 | | |
4148 | 4148 | | |
4149 | | - | |
4150 | | - | |
| 4149 | + | |
| 4150 | + | |
| 4151 | + | |
| 4152 | + | |
| 4153 | + | |
| 4154 | + | |
4151 | 4155 | | |
4152 | 4156 | | |
4153 | 4157 | | |
| |||
0 commit comments