From 3044d8ed7259c600b3410c91ddcaf23482401245 Mon Sep 17 00:00:00 2001 From: marius vlad Date: Mon, 3 Jul 2023 11:34:39 +0300 Subject: [PATCH] backend-drm: Use resize_output to allow changing the fb A video mode change would be needed to change the underlying renderer framebuffer. All other backends make uses of this so let's do it for the DRM-backend as well. This would also be needed for the output capture to function properly as we need call weston_output_update_capture_info() when a new mode set has set. Otherwise we'd run into mismatched dimensions for the current mode versus the dimensions set-up initially in weston_output_capture_source_info. Signed-off-by: marius vlad --- libweston/backend-drm/drm.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libweston/backend-drm/drm.c b/libweston/backend-drm/drm.c index 647e3dc70..0f8bb7ef4 100644 --- a/libweston/backend-drm/drm.c +++ b/libweston/backend-drm/drm.c @@ -930,6 +930,7 @@ drm_output_apply_mode(struct drm_output *output) { struct drm_device *device = output->device; struct drm_backend *b = device->backend; + struct weston_size fb_size; /* XXX: This drops our current buffer too early, before we've started * displaying it. Ideally this should be much more atomic and @@ -939,6 +940,11 @@ drm_output_apply_mode(struct drm_output *output) */ device->state_invalid = true; + fb_size.width = output->base.current_mode->width; + fb_size.height = output->base.current_mode->height; + + weston_renderer_resize_output(&output->base, &fb_size, NULL); + if (b->compositor->renderer->type == WESTON_RENDERER_PIXMAN) { drm_output_fini_pixman(output); if (drm_output_init_pixman(output, b) < 0) {