diff options
author | Simon Ser <contact@emersion.fr> | 2021-04-06 15:40:08 +0200 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2021-04-06 20:35:15 +0200 |
commit | d0bf750916099d89b94bf09c2b2c980aa9b0faef (patch) | |
tree | 68ded00c1bc05ecffe278e2c386a5a90f4ffb649 /backend/drm | |
parent | 7efc2d05b7c22e3f355512de98ccc9d5508468c3 (diff) |
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.
Diffstat (limited to 'backend/drm')
-rw-r--r-- | backend/drm/drm.c | 8 |
1 files 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) { |