lib/igt_kms: Unify pipe name helpers
[platform/upstream/intel-gpu-tools.git] / tests / gem_mmap_offset_exhaustion.c
index b2d23f5..914fe6e 100644 (file)
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
-#include <assert.h>
 #include <fcntl.h>
 #include <inttypes.h>
 #include <errno.h>
 #include <sys/stat.h>
 #include <sys/ioctl.h>
-#include <sys/mman.h>
 #include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
 #include "drmtest.h"
 
 #define OBJECT_SIZE (1024*1024)
@@ -61,11 +59,7 @@ create_and_map_bo(int fd)
        handle = gem_create(fd, OBJECT_SIZE);
 
        ptr = gem_mmap(fd, handle, OBJECT_SIZE, PROT_READ | PROT_WRITE);
-
-       if (!ptr) {
-               fprintf(stderr, "mmap failed\n");
-               assert(ptr);
-       }
+       igt_assert(ptr);
 
        /* touch it to force it into the gtt */
        *ptr = 0;
@@ -79,7 +73,7 @@ create_and_map_bo(int fd)
        gem_madvise(fd, handle, I915_MADV_DONTNEED);
 }
 
-int main(int argc, char **argv)
+igt_simple_main
 {
        int fd, i;
 
@@ -93,6 +87,4 @@ int main(int argc, char **argv)
                create_and_map_bo(fd);
 
        close(fd);
-
-       return 0;
 }