mpv icon indicating copy to clipboard operation
mpv copied to clipboard

WIP: single-pixel-buffer-v1

Open LaserEyess opened this issue 2 years ago • 5 comments

This commit implements single-pixel-buffer-v1 for optimizing the use of the wl_shm 1x1 pixel case.

WIP because:

  1. ~~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
  2. ~The protocol itself is WIP~
  3. ~I probably messed something up~

LaserEyess avatar Jun 05 '22 14:06 LaserEyess

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)

LaserEyess avatar Jun 05 '22 18:06 LaserEyess

Added a second commit removing the wl_shm code path, since it's technically redundant. Can be squashed/dropped later if needed.

LaserEyess avatar Jun 05 '22 21:06 LaserEyess

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).

Dudemanguy avatar Jun 05 '22 22:06 Dudemanguy

loosely rebased on the fixes merged yesterday. Will need to be tested again once the protocol is merged.

LaserEyess avatar Jun 16 '22 12:06 LaserEyess

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

LaserEyess avatar Aug 09 '22 17:08 LaserEyess