backend/drm: log failures in drm_surface_blit()

Can make issues like [1] easier to debug.

[1]: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3451
This commit is contained in:
Simon Ser 2022-10-18 16:39:22 +02:00
parent a2063c93ea
commit b475190327
1 changed files with 3 additions and 0 deletions

View File

@ -92,11 +92,13 @@ struct wlr_buffer *drm_surface_blit(struct wlr_drm_surface *surf,
struct wlr_texture *tex = wlr_texture_from_buffer(renderer, buffer);
if (tex == NULL) {
wlr_log(WLR_ERROR, "Failed to import source buffer into multi-GPU renderer");
return NULL;
}
struct wlr_buffer *dst = wlr_swapchain_acquire(surf->swapchain, NULL);
if (!dst) {
wlr_log(WLR_ERROR, "Failed to acquire multi-GPU swapchain buffer");
wlr_texture_destroy(tex);
return NULL;
}
@ -106,6 +108,7 @@ struct wlr_buffer *drm_surface_blit(struct wlr_drm_surface *surf,
wlr_matrix_scale(mat, surf->swapchain->width, surf->swapchain->height);
if (!wlr_renderer_begin_with_buffer(renderer, dst)) {
wlr_log(WLR_ERROR, "Failed to bind multi-GPU destination buffer");
wlr_buffer_unlock(dst);
wlr_texture_destroy(tex);
return NULL;