1
0
Fork 0
mirror of https://github.com/yshui/picom.git synced 2024-11-11 13:51:02 -05:00

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

View file

@ -1872,23 +1872,24 @@ static session_t *session_init(int argc, char **argv, Display *dpy,
}
ps->sync_fence = XCB_NONE;
if (!ps->xsync_exists && 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;
}
if (ps->o.xrender_sync_fence) {
if (ps->xsync_exists) {
ps->sync_fence = x_new_id(ps->c);
e = xcb_request_check(
ps->c, xcb_sync_create_fence(ps->c, ps->root, ps->sync_fence, 0));
if (e) {
log_error_x_error(e, "Failed to create a XSync fence. "
"xrender-sync-fence will be disabled");
ps->o.xrender_sync_fence = false;
if (ps->o.xrender_sync_fence) {
log_error_x_error(e, "Failed to create a XSync fence. "
"xrender-sync-fence will be "
"disabled");
ps->o.xrender_sync_fence = false;
}
ps->sync_fence = XCB_NONE;
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