output-swapchain-manager: Reject zero resolution

If an output with no mode and no valid pending resolution is attempted
enabled, it will trigger an assert in swapchain allocation instead of
failing on a rejected atomic commit or pre-commit test.

We can sometimes get such broken outputs if e.g., the underlying driver
failed to retrieve EDID, and so crashing on assert is suboptimal.

Reject zero-sized swapchains early and log the issue.
This commit is contained in:
Kenny Levinsen 2026-01-22 11:21:29 +01:00
parent 91c08d5a53
commit 5661ac1cd2

View file

@ -108,6 +108,10 @@ static bool manager_output_prepare(struct wlr_output_swapchain_manager_output *m
int width, height;
output_pending_resolution(output, state, &width, &height);
if (width == 0 || height == 0) {
wlr_log(WLR_DEBUG, "Cannot allocate swapchain for zero resolution (%dx%d)", width, height);
return false;
}
uint32_t fmt = output->render_format;
if (state->committed & WLR_OUTPUT_STATE_RENDER_FORMAT) {