output: allow tearing with atomic mode setting

Additionally, track errors and abandon the tearing allowance when it
cannot be set for two-seconds' worth of consecutive frames.
This commit is contained in:
Christopher Snowhill 2024-07-17 17:10:04 -07:00 committed by Andrew J. Hesford
parent 14d9bbab90
commit d033a2fbf6
4 changed files with 42 additions and 15 deletions

View file

@ -885,13 +885,6 @@ entry(xmlNode *node, char *nodename, char *content)
set_adaptive_sync_mode(content, &rc.adaptive_sync);
} else if (!strcasecmp(nodename, "allowTearing.core")) {
set_bool(content, &rc.allow_tearing);
if (rc.allow_tearing) {
char *no_atomic_env = getenv("WLR_DRM_NO_ATOMIC");
if (!no_atomic_env || strcmp(no_atomic_env, "1") != 0) {
rc.allow_tearing = false;
wlr_log(WLR_ERROR, "tearing requires WLR_DRM_NO_ATOMIC=1");
}
}
} else if (!strcasecmp(nodename, "reuseOutputMode.core")) {
set_bool(content, &rc.reuse_output_mode);
} else if (!strcmp(nodename, "policy.placement")) {