From 115d4ae637673e348d5542740a158e6dcee0cf80 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Tue, 2 May 2017 14:08:34 +1200 Subject: Changed events to use wayland functions. --- include/backend/drm/backend.h | 17 +++++++++++++---- include/backend/drm/event.h | 25 ------------------------- include/backend/drm/udev.h | 5 ++--- 3 files changed, 15 insertions(+), 32 deletions(-) delete mode 100644 include/backend/drm/event.h (limited to 'include') diff --git a/include/backend/drm/backend.h b/include/backend/drm/backend.h index caa18bcc..25a42c37 100644 --- a/include/backend/drm/backend.h +++ b/include/backend/drm/backend.h @@ -6,6 +6,7 @@ #include #include #include +#include #include "session.h" #include "udev.h" @@ -16,10 +17,18 @@ struct wlr_drm_backend { int fd; bool paused; - // Priority Queue (Max-heap) - size_t event_cap; - size_t event_len; - struct wlr_drm_event *events; + 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; size_t display_len; struct wlr_drm_display *displays; diff --git a/include/backend/drm/event.h b/include/backend/drm/event.h deleted file mode 100644 index 2155bd32..00000000 --- a/include/backend/drm/event.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef EVENT_H -#define EVENT_H - -#include -#include "drm.h" - -enum wlr_drm_event_type { - DRM_EV_NONE, - DRM_EV_RENDER, - DRM_EV_DISPLAY_REM, - DRM_EV_DISPLAY_ADD, -}; - -struct wlr_drm_event { - enum wlr_drm_event_type type; - struct wlr_drm_display *display; -}; - -struct wlr_drm_backend; -bool wlr_drm_get_event(struct wlr_drm_backend *backend, - struct wlr_drm_event *restrict ret); -bool wlr_drm_add_event(struct wlr_drm_backend *backend, - struct wlr_drm_display *disp, enum wlr_drm_event_type type); - -#endif diff --git a/include/backend/drm/udev.h b/include/backend/drm/udev.h index 6b10c9ec..576b5d6e 100644 --- a/include/backend/drm/udev.h +++ b/include/backend/drm/udev.h @@ -8,15 +8,14 @@ struct wlr_udev { struct udev *udev; struct udev_monitor *mon; - int mon_fd; char *drm_path; }; -bool wlr_udev_init(struct wlr_udev *udev); +struct wlr_drm_backend; +bool wlr_udev_init(struct wlr_drm_backend *backend); void wlr_udev_free(struct wlr_udev *udev); int wlr_udev_find_gpu(struct wlr_udev *udev, struct wlr_session *session); -struct wlr_drm_backend; void wlr_udev_event(struct wlr_drm_backend *backend); #endif -- cgit v1.2.3