diff options
author | Simon Ser <contact@emersion.fr> | 2020-12-01 16:05:23 +0100 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2021-01-16 08:57:42 +0100 |
commit | ad3a455db95e2c5c1823b98e0019a0000f6287fe (patch) | |
tree | a0afd01f48958087d93c4dc8e515c01a0b4c6fc5 | |
parent | a53ab146feaf01a93bf5a4e38d99d84d8858591b (diff) |
backend/multi: implement get_drm_fd
Just like get_renderer, iterate over all sub-backends until we find one
that implements get_drm_fd.
-rw-r--r-- | backend/multi/backend.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/backend/multi/backend.c b/backend/multi/backend.c index 6289f107..ddefc0ce 100644 --- a/backend/multi/backend.c +++ b/backend/multi/backend.c @@ -6,6 +6,7 @@ #include <wlr/backend/interface.h> #include <wlr/backend/session.h> #include <wlr/util/log.h> +#include "backend/backend.h" #include "backend/multi.h" #include "util/signal.h" @@ -96,12 +97,26 @@ static clockid_t multi_backend_get_presentation_clock( return CLOCK_MONOTONIC; } +static int multi_backend_get_drm_fd(struct wlr_backend *backend) { + struct wlr_multi_backend *multi = multi_backend_from_backend(backend); + + struct subbackend_state *sub; + wl_list_for_each(sub, &multi->backends, link) { + if (sub->backend->impl->get_drm_fd) { + return backend_get_drm_fd(sub->backend); + } + } + + return -1; +} + struct wlr_backend_impl backend_impl = { .start = multi_backend_start, .destroy = multi_backend_destroy, .get_renderer = multi_backend_get_renderer, .get_session = multi_backend_get_session, .get_presentation_clock = multi_backend_get_presentation_clock, + .get_drm_fd = multi_backend_get_drm_fd, }; static void handle_display_destroy(struct wl_listener *listener, void *data) { |