tearing: avoid permanent disable due to rejected commits

Currently, the cursor plane does not allow async page flips which causes tearing page flips to be rejected if the cursor was moved.

However, in games where no cursor image is present, the async page flips can still work as expected.

Instead of permanently disabling tearing after too many failures, test the output state first before each frame to see if we can commit with tearing_page_flip set to true.
This commit is contained in:
Ricardo Steijn 2024-11-02 18:34:48 +01:00
parent 14aad38a2c
commit 020f274d69
3 changed files with 9 additions and 31 deletions

View file

@ -107,6 +107,14 @@ lab_wlr_scene_output_commit(struct wlr_scene_output *scene_output,
return false;
}
if (state->tearing_page_flip) {
if (!wlr_output_test_state(wlr_output, state)) {
wlr_log(WLR_DEBUG, "Output test for tearing failed on %s, "
"trying page-flip without tearing", wlr_output->name);
state->tearing_page_flip = false;
}
}
struct wlr_box additional_damage = {0};
if (state->buffer && is_magnify_on()) {
magnify(output, state->buffer, &additional_damage);