all: include config.h only when available and use its defines
[platform/upstream/libdrm.git] / tests / vbltest / vbltest.c
index 1297da8..50e29dc 100644 (file)
@@ -37,7 +37,9 @@
  * TODO: use cairo to write the mode info on the selected output once
  *       the mode has been programmed, along with possible test patterns.
  */
+#ifdef HAVE_CONFIG_H
 #include "config.h"
+#endif
 
 #include <assert.h>
 #include <stdio.h>
@@ -102,8 +104,8 @@ static void usage(char *name)
 
 int main(int argc, char **argv)
 {
-       int i, c, fd;
-       char *modules[] = { "i915", "radeon", "nouveau" };
+       int i, c, fd, ret;
+       char *modules[] = { "i915", "radeon", "nouveau", "vmwgfx", "exynos", "omapdrm", "tilcdc", "msm" };
        drmVBlank vbl;
        drmEventContext evctx;
        struct vbl_info handler_info;
@@ -141,7 +143,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 +160,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 +191,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;