Aside from the exception of allowing tearing (which is in development for Wayland), both X11 and Wayland have the exact same input lag assuming direct scan-out is working correctly.
Xaver himself wrote an excellent article explaining and testing the input lag of X11 vs Wayland, even going as far as adding XWayland to the mix. I recommend you check it out:
As you can see, Wayland, and even XWayland have the exact same latency as X11.
You’ll probably notice that FIFO latency seems higher on Wayland, but that’s exactly what I was talking about previously. As Xaver points out on the notes below the latency tables, at the time of testing, dmabuf
was not implemented yet:
due to increased buffer bloat (the queue for presentation being one frame bigger) the latency with
fifo
is higher by one frame than on uncomposited X. This should disappear once all the necessary parts for dmabuf feedback are implemented in Mesa
The thing is, I believe dmabuf
is now already implemented in Mesa and Kwin, so direct scan-out should be working with RetroArch and should have the exact same latency as uncomposited X11, or even better. Or am I wrong?
I conducted X11 measurements to corroborate what I’m talking about. Here are the averages together with my previous results:
- X composited: 95ms (5.7 frames at 60fps)
- X uncomposited: 65ms (3.9 frames at 60fps)
- KMS: 53ms (3.2 frames at 60fps)
- Wayland: 77ms (4.6 frames at 60fps)
So there’s a difference of 12ms between uncomposited X and Wayland on RetroArch, which might be that missing frame from direct scan-out. I don’t know why uncomposited X can’t match the low latency of KMS though (53ms). Might be an error on my part, or some driver shenanigans.
Anyone here versed with how RetroArch works internally knows if there is anything missing to trigger direct scan-out? Also, does RetroArch use FIFO or Mailbox?
Or does anyone knows how to verify that an app is triggering direct scan-out on Wayland?