aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
Diffstat (limited to 'backend')
-rw-r--r--backend/drm/drm.c11
-rw-r--r--backend/libinput/backend.c6
-rw-r--r--backend/libinput/events.c4
3 files changed, 11 insertions, 10 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c
index 94923d04..441ba24e 100644
--- a/backend/drm/drm.c
+++ b/backend/drm/drm.c
@@ -211,13 +211,13 @@ static void wlr_drm_connector_swap_buffers(struct wlr_output *output) {
}
static void wlr_drm_connector_set_gamma(struct wlr_output *output,
- uint16_t size, uint16_t *r, uint16_t *g, uint16_t *b) {
+ uint32_t size, uint16_t *r, uint16_t *g, uint16_t *b) {
struct wlr_drm_connector *conn = (struct wlr_drm_connector *)output;
struct wlr_drm_backend *drm = (struct wlr_drm_backend *)output->backend;
drmModeCrtcSetGamma(drm->fd, conn->crtc->id, size, r, g, b);
}
-static uint16_t wlr_drm_connector_get_gamma_size(struct wlr_output *output) {
+static uint32_t wlr_drm_connector_get_gamma_size(struct wlr_output *output) {
struct wlr_drm_connector *conn = (struct wlr_drm_connector *)output;
drmModeCrtc *crtc = conn->old_crtc;
return crtc ? crtc->gamma_size : 0;
@@ -770,7 +770,6 @@ void wlr_drm_scan_connectors(struct wlr_drm_backend *drm) {
free(edid);
wl_list_insert(&drm->outputs, &wlr_conn->link);
- wlr_output_create_global(&wlr_conn->output, drm->display);
wlr_log(L_INFO, "Found display '%s'", wlr_conn->output.name);
} else {
seen[index] = true;
@@ -789,7 +788,6 @@ void wlr_drm_scan_connectors(struct wlr_drm_backend *drm) {
if (wlr_conn->state == WLR_DRM_CONN_DISCONNECTED &&
drm_conn->connection == DRM_MODE_CONNECTED) {
-
wlr_log(L_INFO, "'%s' connected", wlr_conn->output.name);
wlr_log(L_INFO, "Detected modes:");
@@ -811,14 +809,17 @@ void wlr_drm_scan_connectors(struct wlr_drm_backend *drm) {
wl_list_insert(&wlr_conn->output.modes, &mode->wlr_mode.link);
}
+ wlr_output_create_global(&wlr_conn->output, drm->display);
+
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);
} 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);
+
+ wlr_output_destroy_global(&wlr_conn->output);
wlr_drm_connector_cleanup(wlr_conn);
}
diff --git a/backend/libinput/backend.c b/backend/libinput/backend.c
index b278b8f7..781314a3 100644
--- a/backend/libinput/backend.c
+++ b/backend/libinput/backend.c
@@ -105,9 +105,9 @@ static void wlr_libinput_backend_destroy(struct wlr_backend *_backend) {
wl_signal_emit(&backend->backend.events.input_remove, wlr_dev);
wlr_input_device_destroy(wlr_dev);
}
- list_free(wlr_devices);
+ wlr_list_free(wlr_devices);
}
- list_free(backend->wlr_device_lists);
+ wlr_list_free(backend->wlr_device_lists);
wl_event_source_remove(backend->input_event);
libinput_unref(backend->libinput_context);
free(backend);
@@ -148,7 +148,7 @@ struct wlr_backend *wlr_libinput_backend_create(struct wl_display *display,
}
wlr_backend_init(&backend->backend, &backend_impl);
- if (!(backend->wlr_device_lists = list_create())) {
+ if (!(backend->wlr_device_lists = wlr_list_create())) {
wlr_log(L_ERROR, "Allocation failed: %s", strerror(errno));
goto error_backend;
}
diff --git a/backend/libinput/events.c b/backend/libinput/events.c
index f6634814..053cab02 100644
--- a/backend/libinput/events.c
+++ b/backend/libinput/events.c
@@ -145,7 +145,7 @@ static void handle_device_added(struct wlr_libinput_backend *backend,
if (wl_list_length(wlr_devices) > 0) {
libinput_device_set_user_data(libinput_dev, wlr_devices);
- list_add(backend->wlr_device_lists, wlr_devices);
+ wlr_list_add(backend->wlr_device_lists, wlr_devices);
} else {
free(wlr_devices);
}
@@ -177,7 +177,7 @@ static void handle_device_removed(struct wlr_libinput_backend *backend,
}
for (size_t i = 0; i < backend->wlr_device_lists->length; i++) {
if (backend->wlr_device_lists->items[i] == wlr_devices) {
- list_del(backend->wlr_device_lists, i);
+ wlr_list_del(backend->wlr_device_lists, i);
break;
}
}