2017-05-01 07:49:18 +02:00
|
|
|
#ifndef DRM_BACKEND_H
|
|
|
|
#define DRM_BACKEND_H
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stddef.h>
|
|
|
|
#include <EGL/egl.h>
|
|
|
|
#include <gbm.h>
|
|
|
|
#include <libudev.h>
|
2017-05-02 04:08:34 +02:00
|
|
|
#include <wayland-server.h>
|
2017-05-01 07:49:18 +02:00
|
|
|
|
2017-05-03 06:23:07 +02:00
|
|
|
#include <wlr/session.h>
|
2017-05-02 04:34:33 +02:00
|
|
|
#include <wlr/common/list.h>
|
2017-05-02 08:13:17 +02:00
|
|
|
#include <wlr/backend/drm.h>
|
2017-05-02 04:34:33 +02:00
|
|
|
|
2017-05-01 07:49:18 +02:00
|
|
|
#include "udev.h"
|
|
|
|
#include "event.h"
|
|
|
|
#include "drm.h"
|
|
|
|
|
|
|
|
struct wlr_drm_backend {
|
|
|
|
int fd;
|
|
|
|
bool paused;
|
|
|
|
|
2017-05-02 04:08:34 +02:00
|
|
|
struct wl_event_loop *event_loop;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
struct wl_event_source *drm;
|
|
|
|
struct wl_event_source *udev;
|
|
|
|
} event_src;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
struct wl_signal display_add;
|
|
|
|
struct wl_signal display_rem;
|
|
|
|
struct wl_signal display_render;
|
|
|
|
} signals;
|
2017-05-01 07:49:18 +02:00
|
|
|
|
2017-05-02 04:34:33 +02:00
|
|
|
list_t *displays;
|
2017-05-01 07:49:18 +02:00
|
|
|
|
|
|
|
uint32_t taken_crtcs;
|
|
|
|
|
|
|
|
struct wlr_drm_renderer renderer;
|
2017-05-03 06:23:07 +02:00
|
|
|
struct wlr_session *session;
|
2017-05-01 07:49:18 +02:00
|
|
|
struct wlr_udev udev;
|
|
|
|
};
|
|
|
|
|
2017-05-03 06:23:07 +02:00
|
|
|
struct wlr_drm_backend *wlr_drm_backend_init(struct wlr_session *session,
|
|
|
|
struct wl_listener *add, struct wl_listener *rem, struct wl_listener *render);
|
2017-05-01 07:49:18 +02:00
|
|
|
void wlr_drm_backend_free(struct wlr_drm_backend *backend);
|
|
|
|
|
|
|
|
#endif
|