pixman-renderer: update capture info on output creation

Move the call to weston_output_update_capture_info() from the headless
backend into pixman_renderer_output_create(). For this, add an
uint32_t drm_format parameter to struct pixman_renderer_output_options.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
This commit is contained in:
Philipp Zabel 2023-01-18 13:55:25 +01:00 committed by Daniel Stone
parent af5acbc9cb
commit a782040368
3 changed files with 8 additions and 6 deletions

View File

@ -301,6 +301,7 @@ headless_output_enable_pixman(struct headless_output *output)
.width = output->base.current_mode->width,
.height = output->base.current_mode->height
},
.drm_format = headless_formats[0]
};
pixman = output->base.compositor->renderer->pixman;
@ -317,12 +318,6 @@ headless_output_enable_pixman(struct headless_output *output)
if (!output->renderbuffer)
goto err_renderer;
weston_output_update_capture_info(&output->base,
WESTON_OUTPUT_CAPTURE_SOURCE_FRAMEBUFFER,
output->base.current_mode->width,
output->base.current_mode->height,
pfmt->format);
return 0;
err_renderer:

View File

@ -1106,6 +1106,11 @@ pixman_renderer_output_create(struct weston_output *output,
wl_list_init(&po->renderbuffer_list);
weston_output_update_capture_info(output,
WESTON_OUTPUT_CAPTURE_SOURCE_FRAMEBUFFER,
area.width, area.height,
options->drm_format);
return 0;
}

View File

@ -38,6 +38,8 @@ struct pixman_renderer_output_options {
bool use_shadow;
/** Initial framebuffer size */
struct weston_size fb_size;
/** Initial DRM pixel format */
uint32_t drm_format;
};
struct pixman_renderer_interface {