diff options
author | Scott Anderson <ascent12@hotmail.com> | 2017-05-02 13:00:25 +1200 |
---|---|---|
committer | Scott Anderson <ascent12@hotmail.com> | 2017-05-02 13:00:25 +1200 |
commit | 562d43a5ecc2f7f4af3ed6924d52f87e3cc018c2 (patch) | |
tree | f96f517d49fadfb917e16a10744f9204a13b22c3 /backend/drm/backend.c | |
parent | 41a82fd2fcd4759fbb522ffe7e8f6667d6ab945a (diff) |
Changed logging.
Diffstat (limited to 'backend/drm/backend.c')
-rw-r--r-- | backend/drm/backend.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/backend/drm/backend.c b/backend/drm/backend.c index 8c500190..da7ca1e4 100644 --- a/backend/drm/backend.c +++ b/backend/drm/backend.c @@ -1,37 +1,42 @@ #include <unistd.h> #include <stdlib.h> #include <stdio.h> +#include <string.h> +#include <errno.h> #include "backend/drm/backend.h" #include "backend/drm/drm.h" #include "backend/drm/event.h" #include "backend/drm/session.h" #include "backend/drm/udev.h" +#include "common/log.h" struct wlr_drm_backend *wlr_drm_backend_init(void) { struct wlr_drm_backend *backend = calloc(1, sizeof *backend); - if (!backend) + if (!backend) { + wlr_log(L_ERROR, "Allocation failed: %s", strerror(errno)); return NULL; + } if (!wlr_session_start(&backend->session)) { - fprintf(stderr, "Could not create session\n"); + wlr_log(L_ERROR, "Failed to start session"); goto error; } if (!wlr_udev_init(&backend->udev)) { - fprintf(stderr, "Could not start udev\n"); + wlr_log(L_ERROR, "Failed to start udev"); goto error_session; } backend->fd = wlr_udev_find_gpu(&backend->udev, &backend->session); if (backend->fd == -1) { - fprintf(stderr, "Could not open GPU\n"); + wlr_log(L_ERROR, "Failed to open DRM device"); goto error_udev; } if (!wlr_drm_renderer_init(&backend->renderer, backend, backend->fd)) { - fprintf(stderr, "Could not initalise renderer\n"); + wlr_log(L_ERROR, "Failed to initialize renderer"); goto error_fd; } @@ -56,7 +61,7 @@ void wlr_drm_backend_free(struct wlr_drm_backend *backend) return; for (size_t i = 0; i < backend->display_len; ++i) { - wlr_drm_display_free(&backend->displays[i]); + wlr_drm_display_free(&backend->displays[i], true); } wlr_drm_renderer_free(&backend->renderer); |