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.
This commit is contained in:
Simon Ser 2020-12-15 12:21:40 +01:00
parent 5ee8b12dc3
commit d3bcd63a40
5 changed files with 144 additions and 146 deletions

View file

@ -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;
}