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.
This commit is contained in:
Simon Ser 2021-04-06 15:40:08 +02:00
parent 7efc2d05b7
commit d0bf750916

View File

@ -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) {