diff options
author | Simon Zeni <simon@bl4ckb0ne.ca> | 2021-04-28 10:09:33 -0400 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2021-04-28 20:55:57 +0200 |
commit | 144189674edbf908d72467cd497a0250b3d80b8b (patch) | |
tree | c71455402e227053381aaed7038ba3a477a6079b /backend/x11 | |
parent | 6ec652785587b9027512f1a1bc141c5ed27c3ddb (diff) |
backend: introduce backend_get_buffer_caps
Diffstat (limited to 'backend/x11')
-rw-r--r-- | backend/x11/backend.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/backend/x11/backend.c b/backend/x11/backend.c index 743f19ff..9ffdfb2d 100644 --- a/backend/x11/backend.c +++ b/backend/x11/backend.c @@ -35,6 +35,7 @@ #include "render/gbm_allocator.h" #include "render/shm_allocator.h" #include "render/wlr_renderer.h" +#include "types/wlr_buffer.h" #include "util/signal.h" // See dri2_format_for_depth in mesa @@ -223,11 +224,18 @@ static int backend_get_drm_fd(struct wlr_backend *backend) { return x11->drm_fd; } +static uint32_t backend_get_buffer_caps(struct wlr_backend *backend) { + struct wlr_x11_backend *x11 = get_x11_backend_from_backend(backend); + return (x11->have_dri3 ? WLR_BUFFER_CAP_DMABUF : 0) + | (x11->have_shm ? WLR_BUFFER_CAP_SHM : 0); +} + static const struct wlr_backend_impl backend_impl = { .start = backend_start, .destroy = backend_destroy, .get_renderer = backend_get_renderer, .get_drm_fd = backend_get_drm_fd, + .get_buffer_caps = backend_get_buffer_caps, }; bool wlr_backend_is_x11(struct wlr_backend *backend) { |