mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 12:55:58 +01:00
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:
parent
7efc2d05b7
commit
d0bf750916
1 changed files with 3 additions and 5 deletions
|
@ -399,13 +399,11 @@ static bool test_buffer(struct wlr_drm_connector *conn,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct wlr_drm_fb *fb = NULL;
|
if (!drm_fb_import(&crtc->primary->pending_fb, drm, wlr_buffer,
|
||||||
if (!drm_fb_import(&fb, drm, wlr_buffer, &crtc->primary->formats)) {
|
&crtc->primary->formats)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
drm_fb_clear(&fb);
|
return drm_crtc_commit(conn, DRM_MODE_ATOMIC_TEST_ONLY);
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool drm_connector_test(struct wlr_output *output) {
|
static bool drm_connector_test(struct wlr_output *output) {
|
||||||
|
|
Loading…
Reference in a new issue