aboutsummaryrefslogtreecommitdiff
path: root/backend/drm
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-02-13 08:30:54 -0500
committerGitHub <noreply@github.com>2018-02-13 08:30:54 -0500
commit71cba94e73022d8cef8651055204a4706377ae11 (patch)
tree8ea1a2b6a0414fd7904824ffac330cd4e1e96ca2 /backend/drm
parent3497e53516d96ad67b26115e2e06218f68e1114d (diff)
parentc2e147401048aa53aebd52f1851b1da8c91043a3 (diff)
Merge pull request #627 from emersion/wlr-signal-emit-safe
Remove wlr_backend.events.{output_remove,device_remove}
Diffstat (limited to 'backend/drm')
-rw-r--r--backend/drm/atomic.c4
-rw-r--r--backend/drm/backend.c17
-rw-r--r--backend/drm/drm.c32
-rw-r--r--backend/drm/legacy.c2
-rw-r--r--backend/drm/properties.c2
-rw-r--r--backend/drm/renderer.c16
-rw-r--r--backend/drm/util.c8
7 files changed, 40 insertions, 41 deletions
diff --git a/backend/drm/atomic.c b/backend/drm/atomic.c
index 526b2731..29b5ccb1 100644
--- a/backend/drm/atomic.c
+++ b/backend/drm/atomic.c
@@ -1,8 +1,8 @@
-#include <stdlib.h>
#include <gbm.h>
+#include <stdlib.h>
+#include <wlr/util/log.h>
#include <xf86drm.h>
#include <xf86drmMode.h>
-#include <wlr/util/log.h>
#include "backend/drm/drm.h"
#include "backend/drm/iface.h"
#include "backend/drm/util.h"
diff --git a/backend/drm/backend.c b/backend/drm/backend.c
index 3782817c..47dff227 100644
--- a/backend/drm/backend.c
+++ b/backend/drm/backend.c
@@ -1,18 +1,19 @@
-#include <unistd.h>
-#include <stdlib.h>
+#include <assert.h>
+#include <errno.h>
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
-#include <errno.h>
-#include <assert.h>
+#include <unistd.h>
#include <wayland-server.h>
-#include <xf86drm.h>
-#include <wlr/backend/session.h>
#include <wlr/backend/interface.h>
+#include <wlr/backend/session.h>
#include <wlr/interfaces/wlr_output.h>
+#include <wlr/render/egl.h>
#include <wlr/types/wlr_list.h>
#include <wlr/util/log.h>
-#include <wlr/render/egl.h>
+#include <xf86drm.h>
#include "backend/drm/drm.h"
+#include "util/signal.h"
static bool wlr_drm_backend_start(struct wlr_backend *backend) {
struct wlr_drm_backend *drm = (struct wlr_drm_backend *)backend;
@@ -34,7 +35,7 @@ static void wlr_drm_backend_destroy(struct wlr_backend *backend) {
wlr_output_destroy(&conn->output);
}
- wl_signal_emit(&backend->events.destroy, backend);
+ wlr_signal_emit_safe(&backend->events.destroy, backend);
wl_list_remove(&drm->display_destroy.link);
wl_list_remove(&drm->session_signal.link);
diff --git a/backend/drm/drm.c b/backend/drm/drm.c
index 56a78851..e60b7e1c 100644
--- a/backend/drm/drm.c
+++ b/backend/drm/drm.c
@@ -1,29 +1,30 @@
#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <inttypes.h>
-#include <errno.h>
-#include <time.h>
-#include <xf86drm.h>
-#include <xf86drmMode.h>
#include <drm_mode.h>
#include <EGL/egl.h>
#include <EGL/eglext.h>
+#include <errno.h>
#include <gbm.h>
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
+#include <inttypes.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
#include <wayland-server.h>
#include <wayland-util.h>
#include <wlr/backend/interface.h>
#include <wlr/interfaces/wlr_output.h>
-#include <wlr/util/log.h>
-#include <wlr/render/matrix.h>
-#include <wlr/render/gles2.h>
#include <wlr/render.h>
+#include <wlr/render/gles2.h>
+#include <wlr/render/matrix.h>
+#include <wlr/util/log.h>
+#include <xf86drm.h>
+#include <xf86drmMode.h>
#include "backend/drm/drm.h"
#include "backend/drm/iface.h"
#include "backend/drm/util.h"
+#include "util/signal.h"
bool wlr_drm_check_features(struct wlr_drm_backend *drm) {
if (drmSetClientCap(drm->fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1)) {
@@ -870,7 +871,8 @@ void wlr_drm_scan_connectors(struct wlr_drm_backend *drm) {
wlr_conn->state = WLR_DRM_CONN_NEEDS_MODESET;
wlr_log(L_INFO, "Sending modesetting signal for '%s'",
wlr_conn->output.name);
- wl_signal_emit(&drm->backend.events.output_add, &wlr_conn->output);
+ wlr_signal_emit_safe(&drm->backend.events.new_output,
+ &wlr_conn->output);
} else if (wlr_conn->state == WLR_DRM_CONN_CONNECTED &&
drm_conn->connection != DRM_MODE_CONNECTED) {
wlr_log(L_INFO, "'%s' disconnected", wlr_conn->output.name);
@@ -978,8 +980,6 @@ void wlr_drm_connector_cleanup(struct wlr_drm_connector *conn) {
return;
}
- struct wlr_drm_backend *drm = (struct wlr_drm_backend *)conn->output.backend;
-
switch (conn->state) {
case WLR_DRM_CONN_CONNECTED:
case WLR_DRM_CONN_CLEANUP:;
@@ -1013,8 +1013,8 @@ void wlr_drm_connector_cleanup(struct wlr_drm_connector *conn) {
/* Fallthrough */
case WLR_DRM_CONN_NEEDS_MODESET:
wlr_log(L_INFO, "Emitting destruction signal for '%s'",
- conn->output.name);
- wl_signal_emit(&drm->backend.events.output_remove, &conn->output);
+ conn->output.name);
+ wlr_signal_emit_safe(&conn->output.events.destroy, &conn->output);
break;
case WLR_DRM_CONN_DISCONNECTED:
break;
diff --git a/backend/drm/legacy.c b/backend/drm/legacy.c
index eec8c642..88a01b89 100644
--- a/backend/drm/legacy.c
+++ b/backend/drm/legacy.c
@@ -1,7 +1,7 @@
#include <gbm.h>
+#include <wlr/util/log.h>
#include <xf86drm.h>
#include <xf86drmMode.h>
-#include <wlr/util/log.h>
#include "backend/drm/drm.h"
#include "backend/drm/iface.h"
#include "backend/drm/util.h"
diff --git a/backend/drm/properties.c b/backend/drm/properties.c
index 153e845e..3d35beb5 100644
--- a/backend/drm/properties.c
+++ b/backend/drm/properties.c
@@ -2,9 +2,9 @@
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
+#include <wlr/util/log.h>
#include <xf86drm.h>
#include <xf86drmMode.h>
-#include <wlr/util/log.h>
#include "backend/drm/properties.h"
/*
diff --git a/backend/drm/renderer.c b/backend/drm/renderer.c
index 80d3bd9a..f3e570f7 100644
--- a/backend/drm/renderer.c
+++ b/backend/drm/renderer.c
@@ -1,18 +1,16 @@
+#include <EGL/egl.h>
+#include <EGL/eglext.h>
+#include <gbm.h>
+#include <GLES2/gl2.h>
#include <stdbool.h>
#include <stdlib.h>
#include <unistd.h>
-
-#include <gbm.h>
-#include <GLES2/gl2.h>
-#include <EGL/egl.h>
-#include <EGL/eglext.h>
#include <wayland-util.h>
-
-#include <wlr/util/log.h>
+#include <wlr/render.h>
#include <wlr/render/egl.h>
-#include <wlr/render/matrix.h>
#include <wlr/render/gles2.h>
-#include <wlr/render.h>
+#include <wlr/render/matrix.h>
+#include <wlr/util/log.h>
#include "backend/drm/drm.h"
#include "glapi.h"
diff --git a/backend/drm/util.c b/backend/drm/util.c
index 37d99aa8..41ba47d1 100644
--- a/backend/drm/util.c
+++ b/backend/drm/util.c
@@ -1,10 +1,10 @@
-#include <stdio.h>
-#include <string.h>
-#include <drm.h>
#include <drm_mode.h>
+#include <drm.h>
#include <gbm.h>
-#include "backend/drm/util.h"
+#include <stdio.h>
+#include <string.h>
#include <wlr/util/log.h>
+#include "backend/drm/util.h"
int32_t calculate_refresh_rate(drmModeModeInfo *mode) {
int32_t refresh = (mode->clock * 1000000LL / mode->htotal +