backend/drm: retry drm commit when async commit fails

Asynchronous commits can fail due to property changes, but only
if they change in value. However, since the commit failed, the
compositor will continue to retry, failing each time. Fall back
to synchronous commit on async error, which should kickstart the
properties changes. Typically, this is cursor plane FB_ID changes
whenever the compositor or game changes the cursor image, and
without this fallback, it will continue to queue the FB_ID
change, breaking commits until async is disabled, such as by task
switching away from the async hinted app. The existing kernel-
side no-op check will not work if the initial property change
never goes through. This breaks the cycle.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This commit is contained in:
Christopher Snowhill 2024-07-12 00:03:03 -07:00
parent e34cc23549
commit 1447e00abb
No known key found for this signature in database

View file

@ -914,6 +914,12 @@ static bool drm_connector_commit_state(struct wlr_drm_connector *conn,
ok = drm_commit(drm, &pending_dev, flags, test_only);
if (!ok && flags & DRM_MODE_PAGE_FLIP_ASYNC) {
// try again if some props change caused a failure here
flags &= ~DRM_MODE_PAGE_FLIP_ASYNC;
ok = drm_commit(drm, &pending_dev, flags, test_only);
}
out:
drm_connector_state_finish(&pending);
return ok;