From d196a79b6c493d74d0057d74238353180d717255 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Wed, 3 May 2017 21:28:44 +1200 Subject: Changed backend to accept wl_display. --- include/backend/drm/backend.h | 14 ++------------ include/backend/drm/drm.h | 5 ++--- include/backend/drm/udev.h | 5 ++++- 3 files changed, 8 insertions(+), 16 deletions(-) (limited to 'include/backend/drm') diff --git a/include/backend/drm/backend.h b/include/backend/drm/backend.h index d6093bc2..8689c010 100644 --- a/include/backend/drm/backend.h +++ b/include/backend/drm/backend.h @@ -20,12 +20,7 @@ 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 wl_event_source *drm_event; struct { struct wl_signal output_add; @@ -33,17 +28,12 @@ struct wlr_drm_backend { struct wl_signal output_render; } signals; - list_t *outputs; - uint32_t taken_crtcs; + list_t *outputs; 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 diff --git a/include/backend/drm/drm.h b/include/backend/drm/drm.h index 6c3bb49f..3373f024 100644 --- a/include/backend/drm/drm.h +++ b/include/backend/drm/drm.h @@ -21,8 +21,7 @@ struct wlr_drm_renderer { struct wlr_egl egl; }; -bool wlr_drm_renderer_init(struct wlr_drm_renderer *renderer, - struct wlr_drm_backend *backend, int fd); +bool wlr_drm_renderer_init(struct wlr_drm_renderer *renderer, int fd); void wlr_drm_renderer_free(struct wlr_drm_renderer *renderer); enum wlr_drm_output_state { @@ -62,6 +61,6 @@ void wlr_drm_output_begin(struct wlr_drm_output *out); void wlr_drm_output_end(struct wlr_drm_output *out); void wlr_drm_scan_connectors(struct wlr_drm_backend *backend); -void wlr_drm_event(int fd); +int wlr_drm_event(int fd, uint32_t mask, void *data); #endif diff --git a/include/backend/drm/udev.h b/include/backend/drm/udev.h index a09ee218..99c2c403 100644 --- a/include/backend/drm/udev.h +++ b/include/backend/drm/udev.h @@ -4,15 +4,18 @@ #include #include +#include struct wlr_udev { struct udev *udev; struct udev_monitor *mon; char *drm_path; + + struct wl_event_source *event; }; struct wlr_drm_backend; -bool wlr_udev_init(struct wlr_drm_backend *backend); +bool wlr_udev_init(struct wl_display *display, struct wlr_udev *udev); void wlr_udev_free(struct wlr_udev *udev); int wlr_udev_find_gpu(struct wlr_udev *udev, struct wlr_session *session); -- cgit v1.2.3