backend/drm: add support for buffer scaling
This is somewhat related to buffer cropping (mentioned in https://github.com/swaywm/wlroots/issues/1580) and rotation (https://github.com/swaywm/wlroots/issues/1058).
KMS can scale buffers by setting the CRTC_W
and CRTC_H
plane properties to values that don't match the FB's size. This can be useful when a compositor needs to display a scaled fullscreen client: direct scan-out can be used instead of GL composition.
We'd need to introduce a new wlr_output
API to set the buffer scaling, e.g.
/**
* Set the destination geometry for the buffer. This allows scaling the buffer
* set with wlr_output_attach_buffer. This is double-buffered state.
*/
void wlr_output_set_destination_size(struct wlr_output *output, int width, int height);
Edited by Simon Ser