aboutsummaryrefslogtreecommitdiff
path: root/include/backend/drm
diff options
context:
space:
mode:
authorChris Chamberlain <chris@chamberlain.id.au>2021-12-10 21:14:57 +0100
committerSimon Ser <contact@emersion.fr>2021-12-13 14:55:16 +0100
commitd8ca4945581577f570c02ad46878571c48a08c79 (patch)
treed033761a9e3da63f504520923fd628eb77c7e44b /include/backend/drm
parentf6d3efbf4b76a2100949fb0b88662a1324d4af54 (diff)
backend/drm: add wlr_drm_backend_monitor
This helper is responsible for listening for new DRM devices and create new child DRM backends as necessary.
Diffstat (limited to 'include/backend/drm')
-rw-r--r--include/backend/drm/monitor.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/backend/drm/monitor.h b/include/backend/drm/monitor.h
new file mode 100644
index 00000000..51817193
--- /dev/null
+++ b/include/backend/drm/monitor.h
@@ -0,0 +1,24 @@
+#ifndef BACKEND_DRM_MONITOR_H
+#define BACKEND_DRM_MONITOR_H
+
+#include <wlr/backend/drm.h>
+
+/**
+ * Helper to create new DRM sub-backends on GPU hotplug.
+ */
+struct wlr_drm_backend_monitor {
+ struct wlr_backend *multi;
+ struct wlr_backend *primary_drm;
+ struct wlr_session *session;
+
+ struct wl_listener multi_destroy;
+ struct wl_listener primary_drm_destroy;
+ struct wl_listener session_destroy;
+ struct wl_listener session_add_drm_card;
+};
+
+struct wlr_drm_backend_monitor *drm_backend_monitor_create(
+ struct wlr_backend *multi, struct wlr_backend *primary_drm,
+ struct wlr_session *session);
+
+#endif