From 0686666cf5c0e2788e27c1f9895ce801b2cc4a72 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 18 Apr 2024 16:42:10 +0200 Subject: [PATCH] render: drop wlr_renderer_get_dmabuf_texture_formats() wlr_renderer_get_texture_formats() with WLR_BUFFER_CAP_DMABUF is the replacement. --- backend/drm/backend.c | 2 +- examples/output-layers.c | 2 +- include/wlr/render/wlr_renderer.h | 6 ------ render/wlr_renderer.c | 7 +------ types/wlr_drm.c | 3 ++- types/wlr_linux_dmabuf_v1.c | 2 +- 6 files changed, 6 insertions(+), 16 deletions(-) diff --git a/backend/drm/backend.c b/backend/drm/backend.c index f91492ac4..f20050ade 100644 --- a/backend/drm/backend.c +++ b/backend/drm/backend.c @@ -234,7 +234,7 @@ struct wlr_backend *wlr_drm_backend_create(struct wlr_session *session, // to be able to texture from them struct wlr_renderer *renderer = drm->mgpu_renderer.wlr_rend; const struct wlr_drm_format_set *texture_formats = - wlr_renderer_get_dmabuf_texture_formats(renderer); + wlr_renderer_get_texture_formats(renderer, WLR_BUFFER_CAP_DMABUF); if (texture_formats == NULL) { wlr_log(WLR_ERROR, "Failed to query renderer texture formats"); goto error_mgpu_renderer; diff --git a/examples/output-layers.c b/examples/output-layers.c index d7fadac3a..5089c6aa5 100644 --- a/examples/output-layers.c +++ b/examples/output-layers.c @@ -296,7 +296,7 @@ int main(int argc, char *argv[]) { server.renderer = wlr_renderer_autocreate(server.backend); wlr_renderer_init_wl_shm(server.renderer, server.wl_display); - if (wlr_renderer_get_dmabuf_texture_formats(server.renderer) != NULL) { + if (wlr_renderer_get_texture_formats(server.renderer, WLR_BUFFER_CAP_DMABUF) != NULL) { wlr_drm_create(server.wl_display, server.renderer); server.linux_dmabuf_v1 = wlr_linux_dmabuf_v1_create_with_renderer( server.wl_display, 4, server.renderer); diff --git a/include/wlr/render/wlr_renderer.h b/include/wlr/render/wlr_renderer.h index 7b9af4434..fb6d62a31 100644 --- a/include/wlr/render/wlr_renderer.h +++ b/include/wlr/render/wlr_renderer.h @@ -59,12 +59,6 @@ struct wlr_renderer *wlr_renderer_autocreate(struct wlr_backend *backend); */ const struct wlr_drm_format_set *wlr_renderer_get_texture_formats( struct wlr_renderer *r, uint32_t buffer_caps); -/** - * Get the DMA-BUF formats supporting sampling usage. Buffers allocated with - * a format from this list may be imported via wlr_texture_from_dmabuf(). - */ -const struct wlr_drm_format_set *wlr_renderer_get_dmabuf_texture_formats( - struct wlr_renderer *renderer); /** * Initializes wl_shm, linux-dmabuf and other buffer factory protocols. diff --git a/render/wlr_renderer.c b/render/wlr_renderer.c index 76a2d93e5..0b120ea54 100644 --- a/render/wlr_renderer.c +++ b/render/wlr_renderer.c @@ -62,11 +62,6 @@ const struct wlr_drm_format_set *wlr_renderer_get_texture_formats( return r->impl->get_texture_formats(r, buffer_caps); } -const struct wlr_drm_format_set *wlr_renderer_get_dmabuf_texture_formats( - struct wlr_renderer *r) { - return wlr_renderer_get_texture_formats(r, WLR_BUFFER_CAP_DMABUF); -} - const struct wlr_drm_format_set *wlr_renderer_get_render_formats( struct wlr_renderer *r) { if (!r->impl->get_render_formats) { @@ -90,7 +85,7 @@ bool wlr_renderer_init_wl_display(struct wlr_renderer *r, return false; } - if (wlr_renderer_get_dmabuf_texture_formats(r) != NULL && + if (wlr_renderer_get_texture_formats(r, WLR_BUFFER_CAP_DMABUF) != NULL && wlr_renderer_get_drm_fd(r) >= 0 && wlr_linux_dmabuf_v1_create_with_renderer(wl_display, 4, r) == NULL) { return false; diff --git a/types/wlr_drm.c b/types/wlr_drm.c index 9cbc4cecb..c58cdb4ec 100644 --- a/types/wlr_drm.c +++ b/types/wlr_drm.c @@ -236,7 +236,8 @@ struct wlr_drm *wlr_drm_create(struct wl_display *display, drm->node_name = node_name; wl_signal_init(&drm->events.destroy); - const struct wlr_drm_format_set *formats = wlr_renderer_get_dmabuf_texture_formats(renderer); + const struct wlr_drm_format_set *formats = + wlr_renderer_get_texture_formats(renderer, WLR_BUFFER_CAP_DMABUF); if (formats == NULL) { goto error; } diff --git a/types/wlr_linux_dmabuf_v1.c b/types/wlr_linux_dmabuf_v1.c index 13e82760c..bfd97637a 100644 --- a/types/wlr_linux_dmabuf_v1.c +++ b/types/wlr_linux_dmabuf_v1.c @@ -1100,7 +1100,7 @@ bool wlr_linux_dmabuf_feedback_v1_init_with_options(struct wlr_linux_dmabuf_feed feedback->main_device = renderer_dev; const struct wlr_drm_format_set *renderer_formats = - wlr_renderer_get_dmabuf_texture_formats(options->main_renderer); + wlr_renderer_get_texture_formats(options->main_renderer, WLR_BUFFER_CAP_DMABUF); if (renderer_formats == NULL) { wlr_log(WLR_ERROR, "Failed to get renderer DMA-BUF texture formats"); goto error;