From d3bcd63a4002394f86a2d7fe80dcb2d5b4ea5f93 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Tue, 15 Dec 2020 12:21:40 +0100 Subject: backend/drm: remove drm_fb_acquire Instead, import the buffer into GBM and KMS in drm_fb_import. Also move the multi-GPU copy there if necessary. --- backend/drm/drm.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'backend/drm/drm.c') diff --git a/backend/drm/drm.c b/backend/drm/drm.c index 9f3ff355..5c83740c 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -477,7 +477,8 @@ static bool drm_connector_commit_buffer(struct wlr_output *output) { assert(output->pending.committed & WLR_OUTPUT_STATE_BUFFER); switch (output->pending.buffer_type) { case WLR_OUTPUT_STATE_BUFFER_RENDER: - if (!drm_fb_lock_surface(&plane->pending_fb, &plane->surf)) { + if (!drm_fb_lock_surface(&plane->pending_fb, drm, &plane->surf, + &plane->mgpu_surf)) { wlr_drm_conn_log(conn, WLR_ERROR, "drm_fb_lock_surface failed"); return false; } @@ -487,7 +488,7 @@ static bool drm_connector_commit_buffer(struct wlr_output *output) { if (!test_buffer(conn, output->pending.buffer)) { return false; } - if (!drm_fb_import_wlr(&plane->pending_fb, &drm->renderer, buffer, + if (!drm_fb_import(&plane->pending_fb, drm, buffer, NULL, &crtc->primary->formats)) { return false; } @@ -654,6 +655,7 @@ struct wlr_drm_fb *plane_get_next_fb(struct wlr_drm_plane *plane) { } static bool drm_connector_pageflip_renderer(struct wlr_drm_connector *conn) { + struct wlr_drm_backend *drm = conn->backend; struct wlr_drm_crtc *crtc = conn->crtc; if (!crtc) { wlr_drm_conn_log(conn, WLR_ERROR, "Page-flip failed: no CRTC"); @@ -666,7 +668,8 @@ static bool drm_connector_pageflip_renderer(struct wlr_drm_connector *conn) { if (!drm_surface_render_black_frame(&plane->surf)) { return false; } - if (!drm_fb_lock_surface(&plane->pending_fb, &plane->surf)) { + if (!drm_fb_lock_surface(&plane->pending_fb, drm, &plane->surf, + &plane->mgpu_surf)) { return false; } } @@ -942,7 +945,8 @@ static bool drm_connector_set_cursor(struct wlr_output *output, wlr_render_texture_with_matrix(rend, texture, matrix, 1.0); wlr_renderer_end(rend); - if (!drm_fb_lock_surface(&plane->pending_fb, &plane->surf)) { + if (!drm_fb_lock_surface(&plane->pending_fb, drm, &plane->surf, + &plane->mgpu_surf)) { return false; } -- cgit v1.2.3