Improve screenshooting interfaces for test suite usage
With both writeback connectors and color management & HDR coming, we need the test suite to be more flexible with screenshots. Particularly:
- different screenshot sources (blending space, framebuffer, writeback)
- compositor chosen pixel format
- proper failure events
CM & HDR tests could make use of shooting the blending buffer. KMS tests want to make sure to use writeback. Both of these may require using a particular pixel format, so tell the client to use the right format in advance. Retry and failure events solve a race and blank/garbage screenshot issues.
I made a protocol draft here: https://gitlab.freedesktop.org/pq/weston/-/blob/wip/better-shooter/protocol/weston-output-capture.xml
The draft replaces !331 (closed) (cc @marius.vlad0).
The draft could help test !394 as it would be possible to take a shot from the renderer buffer as it is, without needing the enlarge it just for the shot in the compositor. That might need a bit further consideration though, but it's certainly easier when the compositor says what size the buffer needs to be. (cc @daniels)
Maybe #146 could be implemented by adding yet another screenshot source meaning "copy from the existing FB, don't paint a new one", plus the writeback source is already listed. "Copy from existing FB" could also not force all KMS color management properties to be reset to identity and replaced with renderer processing. It could even be taken as far as not disabling KMS planes which means it would only capture the primary plane contents, but I'm not sure if that's useful, because regions occluded by overlay planes are supposed to be garbage (outdated).
(When color management arrives, any KMS functionality used for color management needs to be temporarily executed by the renderer for it to affect screenshots correctly. Screenshots need to have an explicit or output color space.)
Cc @leandrohrb who is working on the writeback screenshooting and tests.