render/allocator/gbm: add bo_flags arg to create function

This allows callers to opt out of SCANOUT, for instance.
This commit is contained in:
Simon Ser 2023-11-30 21:10:31 +01:00
parent bf75706555
commit a245201dad
3 changed files with 10 additions and 4 deletions

View file

@ -16,6 +16,7 @@
#include "render/wlr_renderer.h"
#if WLR_HAS_GBM_ALLOCATOR
#include <gbm.h>
#include "render/allocator/gbm.h"
#endif
@ -109,7 +110,8 @@ struct wlr_allocator *allocator_autocreate_with_drm_fd(
if (gbm_fd < 0) {
return NULL;
}
if ((alloc = wlr_gbm_allocator_create_with_drm_fd(gbm_fd)) != NULL) {
uint32_t bo_flags = GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING;
if ((alloc = wlr_gbm_allocator_create_with_drm_fd(gbm_fd, bo_flags)) != NULL) {
return alloc;
}
close(gbm_fd);