aboutsummaryrefslogtreecommitdiff
path: root/backend/drm/backend.c
diff options
context:
space:
mode:
Diffstat (limited to 'backend/drm/backend.c')
-rw-r--r--backend/drm/backend.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/backend/drm/backend.c b/backend/drm/backend.c
index d7e2e616..40b559e2 100644
--- a/backend/drm/backend.c
+++ b/backend/drm/backend.c
@@ -9,9 +9,9 @@
#include <wlr/backend/session.h>
#include <wlr/backend/interface.h>
#include <wlr/interfaces/wlr_output.h>
-#include <wlr/util/list.h>
+#include <wlr/types/wlr_list.h>
#include <wlr/util/log.h>
-#include <wlr/egl.h>
+#include <wlr/render/egl.h>
#include "backend/drm/drm.h"
static bool wlr_drm_backend_start(struct wlr_backend *backend) {
@@ -29,8 +29,8 @@ static void wlr_drm_backend_destroy(struct wlr_backend *backend) {
wlr_drm_restore_outputs(drm);
- for (size_t i = 0; drm->outputs && i < drm->outputs->length; ++i) {
- struct wlr_drm_connector *conn = drm->outputs->items[i];
+ struct wlr_drm_connector *conn;
+ wl_list_for_each(conn, &drm->outputs, link) {
wlr_output_destroy(&conn->output);
}
@@ -38,7 +38,6 @@ static void wlr_drm_backend_destroy(struct wlr_backend *backend) {
wlr_drm_renderer_finish(&drm->renderer);
wlr_session_close_file(drm->session, drm->fd);
wl_event_source_remove(drm->drm_event);
- list_free(drm->outputs);
free(drm);
}
@@ -63,10 +62,13 @@ static void session_signal(struct wl_listener *listener, void *data) {
if (session->active) {
wlr_log(L_INFO, "DRM fd resumed");
+ wlr_drm_scan_connectors(drm);
- for (size_t i = 0; i < drm->outputs->length; ++i) {
- struct wlr_drm_connector *conn = drm->outputs->items[i];
- wlr_drm_connector_start_renderer(conn);
+ struct wlr_drm_connector *conn;
+ wl_list_for_each(conn, &drm->outputs, link){
+ if (conn->output.current_mode) {
+ wlr_output_set_mode(&conn->output, conn->output.current_mode);
+ }
if (!conn->crtc) {
continue;
@@ -110,11 +112,7 @@ struct wlr_backend *wlr_drm_backend_create(struct wl_display *display,
wlr_backend_init(&drm->backend, &backend_impl);
drm->session = session;
- drm->outputs = list_create();
- if (!drm->outputs) {
- wlr_log(L_ERROR, "Failed to allocate list");
- goto error_backend;
- }
+ wl_list_init(&drm->outputs);
drm->fd = gpu_fd;
drm->parent = (struct wlr_drm_backend *)parent;
@@ -158,8 +156,6 @@ error_event:
wl_event_source_remove(drm->drm_event);
error_fd:
wlr_session_close_file(drm->session, drm->fd);
- list_free(drm->outputs);
-error_backend:
free(drm);
return NULL;
}