This MR takes @ajax code from !36 and enhances it to handle errors and rotated outputs better. I've split the changes into commits at a high granularity so that it's easier to catch errors when reviewing. When reviewing, it would be great if the commit messages could be checked for anything that even vaguely indicates lack of understanding, as that may be hiding more significant issues here or in subsequent MRs.
I did some smoke testing on i915 with 2 monitors which didn't yield any significant issues: calling
xrandr and changing VTs back and forth, changing
Monitor configuration to set corresponding layout settings. Only the last meaningfully tests whole screen atomic modeset with rotation.
Things of interest that I've noticed:
The KDE environment that I was using doesn't stretch the wallpaper to fill the output after certain sequences of
xrandr --rotate XYZ --reflect XYZ, so it's possible we're reporting something back incorrectly. This would be a regression compared to 1.20.9 on the same hardware.
I couldn't force both outputs on a single CRTC, the kernel was returning "Invalid argument". This needs more testing, but since same hardware had the same issue on 1.20.9 it's probably hardware limitation.
At full resolution the outputs create a screen that's apparently too large for the hardware/kernel driver (got
[drm] Reducing the compressed framebuffer size. This may lead to less power savings than a non-reduced-size. Try to increase stolen memory size if available in BIOS.from the kernel). As a result we can't do page flips which is likely a different bug.
I will do more testing with more interesting configurations.
Also, gamma handling is currently missing as well.
- Do we also need to do atomic modeset for whole screen at a time when doing page flips? It seems that not implementing it as part of this PR just leads to lower efficiency.