render/allocator: add wlr_allocator.buffer_caps

This allows users to know the capabilities of the buffers that
will be allocated. The buffer capability is important to
know when negotiating buffer formats.
This commit is contained in:
Simon Ser 2021-05-31 20:16:32 +02:00 committed by Simon Zeni
parent 5c30cf3d94
commit 766a24fa77
5 changed files with 33 additions and 10 deletions

View file

@ -7,6 +7,7 @@
#include <wlr/util/log.h>
#include <xf86drm.h>
#include "render/gbm_allocator.h"
#include "types/wlr_buffer.h"
static const struct wlr_buffer_impl buffer_impl;
@ -181,7 +182,7 @@ struct wlr_allocator *wlr_gbm_allocator_create(int drm_fd) {
if (alloc == NULL) {
return NULL;
}
wlr_allocator_init(&alloc->base, &allocator_impl);
wlr_allocator_init(&alloc->base, &allocator_impl, WLR_BUFFER_CAP_DMABUF);
alloc->fd = fd;
wl_list_init(&alloc->buffers);