mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2024-12-17 19:32:24 +00:00
backend/drm: Bail if renderer cannot import DMA-BUFs
We create a renderer for the sole purpose of blitting buffers from a primary renderer that we might not be able to scan-out from. If we end up with the pixman renderer, it either won't work becuase it cannot import dmabufs from the primary renderer, or won't have any effect because the primary renderer already uses dumb buffers. We test for DMA-BUF capabilities specifically to make it clear what our interest is, rather than focusing too much on the pixman renderer.
This commit is contained in:
parent
55f15d1abd
commit
1dd05437bf
@ -20,6 +20,12 @@ bool init_drm_renderer(struct wlr_drm_backend *drm,
|
||||
wlr_log(WLR_ERROR, "Failed to create renderer");
|
||||
return false;
|
||||
}
|
||||
if (wlr_renderer_get_texture_formats(renderer->wlr_rend, WLR_BUFFER_CAP_DMABUF) == NULL) {
|
||||
wlr_log(WLR_ERROR, "Renderer did not support importing DMA-BUFs");
|
||||
wlr_renderer_destroy(renderer->wlr_rend);
|
||||
renderer->wlr_rend = NULL;
|
||||
return false;
|
||||
}
|
||||
|
||||
renderer->allocator = wlr_allocator_autocreate(&drm->backend, renderer->wlr_rend);
|
||||
if (renderer->allocator == NULL) {
|
||||
|
Loading…
Reference in New Issue
Block a user