mpv
mpv copied to clipboard
WIP: single-pixel-buffer-v1
This commit implements single-pixel-buffer-v1
for optimizing the use of the wl_shm 1x1 pixel case.
WIP because:
- ~~I did not test this (waiting for some compositors to update their patches to implement this protocol)~~ This is tested and it works as expected
- ~The protocol itself is WIP~
- ~I probably messed something up~
Poached a commit from #10262 for local testing and overriding wayland-protocols
.
Currently it seems to be working with a patched sway/wlroots:
[2258739.179] [email protected](31, "wp_single_pixel_buffer_manager_v1", 1)
[2258739.184] -> [email protected](31, "wp_single_pixel_buffer_manager_v1", 1, new id [unknown]@18)
....
[2258778.398] -> [email protected]_u32_rgba_buffer(new id wl_buffer@32, 0, 0, 0, 4294967295)
Added a second commit removing the wl_shm code path, since it's technically redundant. Can be squashed/dropped later if needed.
Just noting this here for the future, but the shm usage in this vo for the black border will be replaced by single-pixel-buffer
. This needs a fatal error if the compositor doesn't support single-pixel-buffer
however (currently, it segfaults).
loosely rebased on the fixes merged yesterday. Will need to be tested again once the protocol is merged.
I think this is ready for review, but as of right now builds are going to fail without a wide release of wayland-protocols
1.26. There is also the question on whether to restrict this to single-pixel-buffer-v1
or not. Current support:
- wlroots 0.16 (not released) https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3428
- GNOME 43 (not released) https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2246
- weston (not released)https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/769
- Plasma: ???
@boxerab