summaryrefslogtreecommitdiff
path: root/test/present-test.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/present-test.c')
-rw-r--r--test/present-test.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/test/present-test.c b/test/present-test.c
index bd38977c..3c843599 100644
--- a/test/present-test.c
+++ b/test/present-test.c
@@ -351,15 +351,18 @@ static int test_future(Display *dpy, void *Q)
} else {
int msc = (uint32_t)ce->msc - ce->serial;
if (msc < 0) {
- fprintf(stderr, "\tframe %d displayed early by %lld frames\n", (int)(ce->serial - target - 60)/(15*60), (long long)msc);
ret += -msc;
- if (-msc > earliest)
+ if (-msc > earliest) {
+ fprintf(stderr, "\tframe %d displayed early by %lld frames\n", (int)(ce->serial - target - 60)/(15*60), (long long)msc);
earliest = -msc;
+ }
early++;
- } else if (msc > 1) { /* allow the frame to slip by a vblank */
+ } else if (msc > 0) {
ret += msc;
- if (msc > latest)
+ if (msc > latest) {
+ fprintf(stderr, "\tframe %d displayed late by %lld frames\n", (int)(ce->serial - target - 60), (long long)msc);
latest = msc;
+ }
late++;
}
}
@@ -609,15 +612,18 @@ static int test_accuracy(Display *dpy, void *Q)
msc = (uint32_t)ce->msc - ce->serial;
if (msc < 0) {
- fprintf(stderr, "\tframe %d displayed early by %lld frames\n", (int)(ce->serial - target - 60), (long long)msc);
ret += -msc;
- if (-msc > earliest)
+ if (-msc > earliest) {
+ fprintf(stderr, "\tframe %d displayed early by %lld frames\n", (int)(ce->serial - target - 60), (long long)msc);
earliest = -msc;
+ }
early++;
- } else if (msc > 1) { /* allow the frame to slip by a vblank */
+ } else if (msc > 0) {
ret += msc;
- if (msc > latest)
+ if (msc > latest) {
+ fprintf(stderr, "\tframe %d displayed late by %lld frames\n", (int)(ce->serial - target - 60), (long long)msc);
latest = msc;
+ }
late++;
}
complete = ce->serial == target + 60 + N_VBLANKS;