wlr_scene: Implement Output Layers
based on: !4253 (merged)
Lots of hw today have the ability to offload composition using hw planes. It'd be nice to take advantage of that for power savings.
This is based upon work by @Nefsen402 in !4015, rebased on latest, plus some fixes from my tests using:
- sway wlr_scene PR (https://github.com/swaywm/sway/pull/6844)
- MPV:
mpv --vo=dmabuf-wayland --hwdec=vaapi bbb_sunflower_1080p_30fps_normal.mp4
- Kernel: amdgpu currently disallows video formats as top plane, workaround is to drop this if block: https://elixir.bootlin.com/linux/latest/source/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c#L9784
- AMD Ryzen 5 7520C
Note that with this MR, libliftoff will likely deadline before it finds a layer to offload, resulting in this MR to seemingly do nothing. Increasing the liblifotff deadline from 1ms to 5ms will help with testing. Reverting the top-most patch in this MR will also help, but result in unreliable offload (see commit wlr_scene: Don't drop output_layers using damage
for details).
I think the proper solution here is to find some room for optimization in libliftoff, which is next on my list.
I was also made aware that there's debate on the current output_layers api. I didn't come across anything particularly jarring, so do let me know your concerns.