aboutsummaryrefslogtreecommitdiff
path: root/include/backend/drm/backend.h
blob: d6093bc28ac3960cc8fe8c41e574d696ffaf0142 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef DRM_BACKEND_H
#define DRM_BACKEND_H

#include <stdbool.h>
#include <stddef.h>
#include <EGL/egl.h>
#include <gbm.h>
#include <libudev.h>
#include <wayland-server.h>

#include <wlr/session.h>
#include <wlr/common/list.h>
#include <wlr/backend/drm.h>

#include "udev.h"
#include "event.h"
#include "drm.h"

struct wlr_drm_backend {
	int fd;
	bool paused;

	struct wl_event_loop *event_loop;

	struct {
		struct wl_event_source *drm;
		struct wl_event_source *udev;
	} event_src;

	struct {
		struct wl_signal output_add;
		struct wl_signal output_rem;
		struct wl_signal output_render;
	} signals;

	list_t *outputs;

	uint32_t taken_crtcs;

	struct wlr_drm_renderer renderer;
	struct wlr_session *session;
	struct wlr_udev udev;
};

struct wlr_drm_backend *wlr_drm_backend_init(struct wlr_session *session,
	struct wl_listener *add, struct wl_listener *rem, struct wl_listener *render);
void wlr_drm_backend_free(struct wlr_drm_backend *backend);

#endif