aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
Diffstat (limited to 'backend')
-rw-r--r--backend/drm/renderer.c6
-rw-r--r--backend/headless/backend.c16
-rw-r--r--backend/wayland/backend.c6
-rw-r--r--backend/x11/backend.c6
4 files changed, 17 insertions, 17 deletions
diff --git a/backend/drm/renderer.c b/backend/drm/renderer.c
index e1a0e427..00dfcbb0 100644
--- a/backend/drm/renderer.c
+++ b/backend/drm/renderer.c
@@ -62,7 +62,7 @@ void finish_drm_renderer(struct wlr_drm_renderer *renderer) {
return;
}
- wlr_allocator_destroy(&renderer->allocator->base);
+ wlr_allocator_destroy(renderer->allocator);
wlr_renderer_destroy(renderer->wlr_rend);
gbm_device_destroy(renderer->gbm);
}
@@ -83,8 +83,8 @@ static bool init_drm_surface(struct wlr_drm_surface *surf,
wlr_swapchain_destroy(surf->swapchain);
surf->swapchain = NULL;
- surf->swapchain = wlr_swapchain_create(&renderer->allocator->base,
- width, height, drm_format);
+ surf->swapchain = wlr_swapchain_create(renderer->allocator, width, height,
+ drm_format);
if (surf->swapchain == NULL) {
wlr_log(WLR_ERROR, "Failed to create swapchain");
memset(surf, 0, sizeof(*surf));
diff --git a/backend/headless/backend.c b/backend/headless/backend.c
index 822024b3..1ca1c183 100644
--- a/backend/headless/backend.c
+++ b/backend/headless/backend.c
@@ -220,21 +220,21 @@ struct wlr_backend *wlr_headless_backend_create(struct wl_display *display) {
goto error_dup;
}
- struct wlr_gbm_allocator *gbm_alloc = wlr_gbm_allocator_create(drm_fd);
- if (gbm_alloc == NULL) {
+ struct wlr_allocator *alloc = wlr_gbm_allocator_create(drm_fd);
+ if (alloc == NULL) {
wlr_log(WLR_ERROR, "Failed to create GBM allocator");
close(drm_fd);
goto error_dup;
}
- if (!backend_init(backend, display, &gbm_alloc->base, NULL)) {
+ if (!backend_init(backend, display, alloc, NULL)) {
goto error_init;
}
return &backend->backend;
error_init:
- wlr_allocator_destroy(&gbm_alloc->base);
+ wlr_allocator_destroy(alloc);
error_dup:
close(backend->drm_fd);
error_drm_fd:
@@ -266,14 +266,14 @@ struct wlr_backend *wlr_headless_backend_create_with_renderer(
goto error_dup;
}
- struct wlr_gbm_allocator *gbm_alloc = wlr_gbm_allocator_create(drm_fd);
- if (gbm_alloc == NULL) {
+ struct wlr_allocator *alloc = wlr_gbm_allocator_create(drm_fd);
+ if (alloc == NULL) {
wlr_log(WLR_ERROR, "Failed to create GBM allocator");
close(drm_fd);
goto error_dup;
}
- if (!backend_init(backend, display, &gbm_alloc->base, renderer)) {
+ if (!backend_init(backend, display, alloc, renderer)) {
goto error_init;
}
@@ -283,7 +283,7 @@ struct wlr_backend *wlr_headless_backend_create_with_renderer(
return &backend->backend;
error_init:
- wlr_allocator_destroy(&gbm_alloc->base);
+ wlr_allocator_destroy(alloc);
error_dup:
close(backend->drm_fd);
error_drm_fd:
diff --git a/backend/wayland/backend.c b/backend/wayland/backend.c
index 1606f0a5..42f4d6e2 100644
--- a/backend/wayland/backend.c
+++ b/backend/wayland/backend.c
@@ -452,13 +452,13 @@ struct wlr_backend *wlr_wl_backend_create(struct wl_display *display,
goto error_drm_fd;
}
- struct wlr_gbm_allocator *gbm_alloc = wlr_gbm_allocator_create(drm_fd);
- if (gbm_alloc == NULL) {
+ struct wlr_allocator *alloc = wlr_gbm_allocator_create(drm_fd);
+ if (alloc == NULL) {
wlr_log(WLR_ERROR, "Failed to create GBM allocator");
close(drm_fd);
goto error_drm_fd;
}
- wl->allocator = &gbm_alloc->base;
+ wl->allocator = alloc;
} else {
wlr_log(WLR_DEBUG, "No render node found, falling back to shared memory");
struct wlr_shm_allocator *shm_alloc = wlr_shm_allocator_create();
diff --git a/backend/x11/backend.c b/backend/x11/backend.c
index fbcee33d..06bbfc6c 100644
--- a/backend/x11/backend.c
+++ b/backend/x11/backend.c
@@ -622,13 +622,13 @@ struct wlr_backend *wlr_x11_backend_create(struct wl_display *display,
goto error_event;
}
- struct wlr_gbm_allocator *gbm_alloc = wlr_gbm_allocator_create(drm_fd);
- if (gbm_alloc == NULL) {
+ struct wlr_allocator *alloc = wlr_gbm_allocator_create(drm_fd);
+ if (alloc == NULL) {
wlr_log(WLR_ERROR, "Failed to create GBM allocator");
close(drm_fd);
goto error_event;
}
- x11->allocator = &gbm_alloc->base;
+ x11->allocator = alloc;
pixmap_formats = &x11->dri3_formats;
} else if (x11->have_shm) {
x11->drm_fd = -1;