wlr_drm_format: Change wlr_drm_format_dup to copy

This commit is contained in:
Alexander Orzechowski 2023-05-10 16:00:22 -04:00 committed by Simon Ser
parent 099a147439
commit 340700cb70
6 changed files with 31 additions and 24 deletions

View file

@ -210,8 +210,13 @@ struct wlr_drm_format *output_pick_format(struct wlr_output *output,
}
format = wlr_drm_format_intersect(display_format, render_format);
} else {
format = calloc(1, sizeof(*format));
if (!format) {
return false;
}
// The output can display any format
format = wlr_drm_format_dup(render_format);
wlr_drm_format_copy(format, render_format);
}
if (format == NULL) {

View file

@ -76,7 +76,7 @@ bool wlr_output_configure_primary_swapchain(struct wlr_output *output,
struct wlr_swapchain *old_swapchain = *swapchain_ptr;
if (old_swapchain != NULL &&
old_swapchain->width == width && old_swapchain->height == height &&
old_swapchain->format->format == output->render_format) {
old_swapchain->format.format == output->render_format) {
return true;
}