From d0bf750916099d89b94bf09c2b2c980aa9b0faef Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Tue, 6 Apr 2021 15:40:08 +0200 Subject: [PATCH] backend/drm: use atomic test-only commits for direct scan-out This allows callers to use wlr_output_test to figure out whether a buffer can be scanned out prior to committing the output. --- backend/drm/drm.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/backend/drm/drm.c b/backend/drm/drm.c index 8e8fa6b7..b1be7c8c 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -399,13 +399,11 @@ static bool test_buffer(struct wlr_drm_connector *conn, return false; } - struct wlr_drm_fb *fb = NULL; - if (!drm_fb_import(&fb, drm, wlr_buffer, &crtc->primary->formats)) { + if (!drm_fb_import(&crtc->primary->pending_fb, drm, wlr_buffer, + &crtc->primary->formats)) { return false; } - drm_fb_clear(&fb); - - return true; + return drm_crtc_commit(conn, DRM_MODE_ATOMIC_TEST_ONLY); } static bool drm_connector_test(struct wlr_output *output) {