backend/drm: fix hardware cursors not moving

This adds back `wlr_output::needs_swap`. This allows a backend to
request buffer swaps even if the output isn't damaged. This is
needed by the DRM backend to trigger pageflips when the cursor
moves.
This commit is contained in:
emersion 2018-01-20 16:43:14 +01:00
parent bc001e90e9
commit 4ca38b84ed
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
6 changed files with 43 additions and 19 deletions

View file

@ -619,7 +619,11 @@ static bool wlr_drm_connector_set_cursor(struct wlr_output *output,
gbm_bo_unmap(bo, bo_data);
return drm->iface->crtc_set_cursor(drm, crtc, bo);
bool ok = drm->iface->crtc_set_cursor(drm, crtc, bo);
if (ok) {
wlr_output_update_needs_swap(output);
}
return ok;
}
static bool wlr_drm_connector_move_cursor(struct wlr_output *output,
@ -643,8 +647,12 @@ static bool wlr_drm_connector_move_cursor(struct wlr_output *output,
transformed_box.y -= plane->cursor_hotspot_y;
}
return drm->iface->crtc_move_cursor(drm, conn->crtc, transformed_box.x,
bool ok = drm->iface->crtc_move_cursor(drm, conn->crtc, transformed_box.x,
transformed_box.y);
if (ok) {
wlr_output_update_needs_swap(output);
}
return ok;
}
static void wlr_drm_connector_destroy(struct wlr_output *output) {