tests: remove unused getopt header includes
[platform/upstream/intel-gpu-tools.git] / tests / gem_render_linear_blits.c
index 7b316bd..28fd8c8 100644 (file)
@@ -46,7 +46,6 @@
 #include <errno.h>
 #include <sys/stat.h>
 #include <sys/time.h>
-#include <getopt.h>
 
 #include <drm.h>
 
@@ -73,12 +72,10 @@ check_bo(int fd, uint32_t handle, uint32_t val)
 
        gem_read(fd, handle, 0, linear, sizeof(linear));
        for (i = 0; i < WIDTH*HEIGHT; i++) {
-               if (linear[i] != val) {
-                       fprintf(stderr, "Expected 0x%08x, found 0x%08x "
-                               "at offset 0x%08x\n",
-                               val, linear[i], i * 4);
-                       abort();
-               }
+               igt_assert_f(linear[i] == val,
+                            "Expected 0x%08x, found 0x%08x "
+                            "at offset 0x%08x\n",
+                            val, linear[i], i * 4);
                val++;
        }
 }
@@ -92,15 +89,12 @@ int main(int argc, char **argv)
        uint32_t start = 0;
        int i, j, fd, count;
 
-       igt_simple_init();
+       igt_simple_init(argc, argv);
 
        fd = drm_open_any();
 
        render_copy = igt_get_render_copyfunc(intel_get_drm_devid(fd));
-       if (render_copy == NULL) {
-               printf("no render-copy function, doing nothing\n");
-               return 77;
-       }
+       igt_require(render_copy);
 
        bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
        batch = intel_batchbuffer_alloc(bufmgr, intel_get_drm_devid(fd));
@@ -114,7 +108,7 @@ int main(int argc, char **argv)
        if (count == 0)
                count = 3 * gem_aperture_size(fd) / SIZE / 2;
        else if (count < 2) {
-               fprintf(stderr, "count must be >= 2\n");
+               igt_warn("count must be >= 2\n");
                return 1;
        }