aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2020-12-01 16:00:12 +0100
committerSimon Ser <contact@emersion.fr>2021-01-16 08:57:42 +0100
commita53ab146feaf01a93bf5a4e38d99d84d8858591b (patch)
tree5e7cb89a4b20da830d805c3ccca7c4bc15f23e30 /backend
parent87293d1b15f539aae59219fa1e1b367bf55382dc (diff)
backend: add get_drm_fd to interface
This function allows backends to return the DRM FD they are using. This will allow the allocator and the renderer to use the right device.
Diffstat (limited to 'backend')
-rw-r--r--backend/backend.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/backend/backend.c b/backend/backend.c
index 7e299f9d..245bd429 100644
--- a/backend/backend.c
+++ b/backend/backend.c
@@ -16,6 +16,7 @@
#include <wlr/backend/wayland.h>
#include <wlr/config.h>
#include <wlr/util/log.h>
+#include "backend/backend.h"
#include "backend/multi.h"
#if WLR_HAS_X11_BACKEND
@@ -71,6 +72,13 @@ clockid_t wlr_backend_get_presentation_clock(struct wlr_backend *backend) {
return CLOCK_MONOTONIC;
}
+int backend_get_drm_fd(struct wlr_backend *backend) {
+ if (!backend->impl->get_drm_fd) {
+ return -1;
+ }
+ return backend->impl->get_drm_fd(backend);
+}
+
static size_t parse_outputs_env(const char *name) {
const char *outputs_str = getenv(name);
if (outputs_str == NULL) {