core: create a xsync fence always

xrender-sync-fence might be enabled after init because of driver
detection. Instead of creating it on demand, just always create it as
this is simpler.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2020-04-22 20:17:31 +01:00
parent adeb09b775
commit cbe34158f3
No known key found for this signature in database
GPG Key ID: 37C999F617EA1A47
1 changed files with 11 additions and 10 deletions

View File

@ -1872,23 +1872,24 @@ static session_t *session_init(int argc, char **argv, Display *dpy,
} }
ps->sync_fence = XCB_NONE; ps->sync_fence = XCB_NONE;
if (!ps->xsync_exists && ps->o.xrender_sync_fence) { if (ps->xsync_exists) {
log_error("XSync extension not found. No XSync fence sync is "
"possible. (xrender-sync-fence can't be enabled)");
ps->o.xrender_sync_fence = false;
}
if (ps->o.xrender_sync_fence) {
ps->sync_fence = x_new_id(ps->c); ps->sync_fence = x_new_id(ps->c);
e = xcb_request_check( e = xcb_request_check(
ps->c, xcb_sync_create_fence(ps->c, ps->root, ps->sync_fence, 0)); ps->c, xcb_sync_create_fence(ps->c, ps->root, ps->sync_fence, 0));
if (e) { if (e) {
if (ps->o.xrender_sync_fence) {
log_error_x_error(e, "Failed to create a XSync fence. " log_error_x_error(e, "Failed to create a XSync fence. "
"xrender-sync-fence will be disabled"); "xrender-sync-fence will be "
"disabled");
ps->o.xrender_sync_fence = false; ps->o.xrender_sync_fence = false;
}
ps->sync_fence = XCB_NONE; ps->sync_fence = XCB_NONE;
free(e); free(e);
} }
} else if (ps->o.xrender_sync_fence) {
log_error("XSync extension not found. No XSync fence sync is "
"possible. (xrender-sync-fence can't be enabled)");
ps->o.xrender_sync_fence = false;
} }
// Query X RandR // Query X RandR