Painting to screencast DMABUF for OBS takes unusually long on the GPU
Affected version
Fedora 39 Silverblue, Wayland, 45.1, both AMD and Intel iGPUs
Bug summary
Painting or blitting to a screencast DMABUF for OBS takes much longer compared to painting for monitor display or painting to a screencast DMABUF for the built-in recorder.
Steps to reproduce
- Try to record a monitor with OBS.
Relevant logs, screenshots, screencasts etc.
Here's an example from an Intel iGPU laptop.
The red rectangles at the top are GPU work, it happens asynchronously from CPU work below. The small red rectangle on the left is painting the stage for the monitor display normally, it takes about 8.6 ms. The big red rectangle to the right is painting the same stage into an OBS screencast DMABUF. For whatever reason, it takes 44.5 ms.
When using the built-in screen recorder, which uses the same DMABUF screencasting, both paints take about the same time (as they should):
This problem also manifests on my AMD iGPU laptop. It's a bit faster, so the numbers are lower, but relatively the same, or even bigger, difference can be observed:
The OBS screencast paint takes 5.6 ms, compared to the regular paint taking 0.3 ms.
!3406 (merged) makes screencast blit, instead of fully repainting, if possible. This helps things, but even this blit takes longer (1.3 ms) than the usual stage paint (0.3 ms):
cc @daenzer