mirror of
https://github.com/yshui/picom.git
synced 2024-11-11 13:51:02 -05:00
check x_fence_sync time
This commit is contained in:
parent
5ac8b7fc56
commit
5e2735f40b
1 changed files with 6 additions and 0 deletions
6
src/x.c
6
src/x.c
|
@ -628,6 +628,8 @@ bool x_fence_sync(xcb_connection_t *c, xcb_sync_fence_t f) {
|
|||
// prototype, we need only one fence per screen, but let's stay a bit
|
||||
// cautious right now
|
||||
|
||||
struct timespec ts = {0};
|
||||
clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||
auto e = xcb_request_check(c, xcb_sync_trigger_fence_checked(c, f));
|
||||
if (e) {
|
||||
log_error_x_error(e, "Failed to trigger the fence");
|
||||
|
@ -645,6 +647,10 @@ bool x_fence_sync(xcb_connection_t *c, xcb_sync_fence_t f) {
|
|||
log_error_x_error(e, "Failed to reset the fence");
|
||||
goto err;
|
||||
}
|
||||
struct timespec ts2 = {0};
|
||||
clock_gettime(CLOCK_MONOTONIC, &ts2);
|
||||
log_warn("x_fence_sync: %lf ms", (double)(ts2.tv_sec - ts.tv_sec) +
|
||||
(double)(ts2.tv_nsec - ts.tv_nsec) / 1e9);
|
||||
return true;
|
||||
|
||||
err:
|
||||
|
|
Loading…
Reference in a new issue