aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2021-11-25 10:50:28 +0100
committerSimon Ser <contact@emersion.fr>2021-11-25 16:16:04 +0100
commitb234edcf58bbd73d64e8d5986aa5cc380d2f48d6 (patch)
tree7d93c19c3ba71bf779ab919ea7dc62aca5b817c1 /backend
parent2e33139ef732040c86e913ecb984c8eb0bf66cb2 (diff)
backend/headless: drop wlr_headless_backend_create_with_renderer
The headless backend no longer needs a parent renderer: it no longer needs to return it in wlr_backend_impl.get_renderer, nor does it need to return its DRM FD in wlr_backend_impl.get_drm_fd. Drop this function altogether since it now behaves exactly like wlr_headless_backend_create.
Diffstat (limited to 'backend')
-rw-r--r--backend/headless/backend.c41
1 files changed, 6 insertions, 35 deletions
diff --git a/backend/headless/backend.c b/backend/headless/backend.c
index 8d74287d..b7788105 100644
--- a/backend/headless/backend.c
+++ b/backend/headless/backend.c
@@ -78,20 +78,6 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) {
backend_destroy(&backend->backend);
}
-static bool backend_init(struct wlr_headless_backend *backend,
- struct wl_display *display) {
- wlr_backend_init(&backend->backend, &backend_impl);
-
- backend->display = display;
- wl_list_init(&backend->outputs);
- wl_list_init(&backend->input_devices);
-
- backend->display_destroy.notify = handle_display_destroy;
- wl_display_add_destroy_listener(display, &backend->display_destroy);
-
- return true;
-}
-
struct wlr_backend *wlr_headless_backend_create(struct wl_display *display) {
wlr_log(WLR_INFO, "Creating headless backend");
@@ -102,29 +88,14 @@ struct wlr_backend *wlr_headless_backend_create(struct wl_display *display) {
return NULL;
}
- if (!backend_init(backend, display)) {
- free(backend);
- return NULL;
- }
-
- return &backend->backend;
-}
-
-struct wlr_backend *wlr_headless_backend_create_with_renderer(
- struct wl_display *display, struct wlr_renderer *renderer) {
- wlr_log(WLR_INFO, "Creating headless backend with parent renderer");
+ wlr_backend_init(&backend->backend, &backend_impl);
- struct wlr_headless_backend *backend =
- calloc(1, sizeof(struct wlr_headless_backend));
- if (!backend) {
- wlr_log(WLR_ERROR, "Failed to allocate wlr_headless_backend");
- return NULL;
- }
+ backend->display = display;
+ wl_list_init(&backend->outputs);
+ wl_list_init(&backend->input_devices);
- if (!backend_init(backend, display)) {
- free(backend);
- return NULL;
- }
+ backend->display_destroy.notify = handle_display_destroy;
+ wl_display_add_destroy_listener(display, &backend->display_destroy);
return &backend->backend;
}