diff options
author | Simon Ser <contact@emersion.fr> | 2020-12-15 12:21:40 +0100 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2020-12-22 15:53:10 +0100 |
commit | d3bcd63a4002394f86a2d7fe80dcb2d5b4ea5f93 (patch) | |
tree | 0e710a919ef7551da8928eb0832756d3279eab59 /backend/drm/drm.c | |
parent | 5ee8b12dc3fe26f27116547d480c2b2637b242bb (diff) |
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.
Diffstat (limited to 'backend/drm/drm.c')
-rw-r--r-- | backend/drm/drm.c | 12 |
1 files changed, 8 insertions, 4 deletions
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; } |