backend: enable xsync fence for nvidia users

This was already done in the legacy backends, this commit adds the same
thing to the new backends.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2019-11-09 20:01:38 +00:00
parent c98e7fa39f
commit 2c1fdefe3b
No known key found for this signature in database
GPG Key ID: 37C999F617EA1A47
1 changed files with 10 additions and 0 deletions

View File

@ -53,6 +53,16 @@ region_t get_damage(session_t *ps, bool all_damage) {
/// paint all windows /// paint all windows
void paint_all_new(session_t *ps, struct managed_win *t, bool ignore_damage) { void paint_all_new(session_t *ps, struct managed_win *t, bool ignore_damage) {
if (ps->o.xrender_sync_fence || (ps->drivers & DRIVER_NVIDIA)) {
if (ps->xsync_exists && !x_fence_sync(ps->c, ps->sync_fence)) {
log_error("x_fence_sync failed, xrender-sync-fence will be "
"disabled from now on.");
xcb_sync_destroy_fence(ps->c, ps->sync_fence);
ps->sync_fence = XCB_NONE;
ps->o.xrender_sync_fence = false;
ps->xsync_exists = false;
}
}
// All painting will be limited to the damage, if _some_ of // All painting will be limited to the damage, if _some_ of
// the paints bleed out of the damage region, it will destroy // the paints bleed out of the damage region, it will destroy
// part of the image we want to reuse // part of the image we want to reuse