summaryrefslogtreecommitdiff
path: root/tests/vbltest
diff options
context:
space:
mode:
authorJakob Bornecrantz <jakob@vmware.com>2011-09-28 17:27:07 +0200
committerJakob Bornecrantz <jakob@vmware.com>2011-10-19 13:35:07 +0200
commitc2925e51979fcb829962e7bf66c13cbc96c39db1 (patch)
tree9820f9edfc62c6c6841221ccc19a62e700144a3c /tests/vbltest
parentdc11db2e282c522219bb6e419eb648f3e836bdc0 (diff)
vbltest: Check error codes returned from libdrm
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Diffstat (limited to 'tests/vbltest')
-rw-r--r--tests/vbltest/vbltest.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/tests/vbltest/vbltest.c b/tests/vbltest/vbltest.c
index 2fe56b2e..903ca0f4 100644
--- a/tests/vbltest/vbltest.c
+++ b/tests/vbltest/vbltest.c
@@ -102,7 +102,7 @@ static void usage(char *name)
int main(int argc, char **argv)
{
- int i, c, fd;
+ int i, c, fd, ret;
char *modules[] = { "i915", "radeon", "nouveau", "vmwgfx" };
drmVBlank vbl;
drmEventContext evctx;
@@ -141,7 +141,11 @@ int main(int argc, char **argv)
if (secondary)
vbl.request.type |= DRM_VBLANK_SECONDARY;
vbl.request.sequence = 0;
- drmWaitVBlank(fd, &vbl);
+ ret = drmWaitVBlank(fd, &vbl);
+ if (ret != 0) {
+ printf("drmWaitVBlank (relative) failed ret: %i\n", ret);
+ return -1;
+ }
printf("starting count: %d\n", vbl.request.sequence);
@@ -154,7 +158,11 @@ int main(int argc, char **argv)
vbl.request.type |= DRM_VBLANK_SECONDARY;
vbl.request.sequence = 1;
vbl.request.signal = (unsigned long)&handler_info;
- drmWaitVBlank(fd, &vbl);
+ ret = drmWaitVBlank(fd, &vbl);
+ if (ret != 0) {
+ printf("drmWaitVBlank (relative, event) failed ret: %i\n", ret);
+ return -1;
+ }
/* Set up our event handler */
memset(&evctx, 0, sizeof evctx);
@@ -181,7 +189,11 @@ int main(int argc, char **argv)
break;
}
- drmHandleEvent(fd, &evctx);
+ ret = drmHandleEvent(fd, &evctx);
+ if (ret != 0) {
+ printf("drmHandleEvent failed: %i\n", ret);
+ return -1;
+ }
}
return 0;