lib/igt.cocci: Add s/assert/igt_assert/
[platform/upstream/intel-gpu-tools.git] / tests / gem_pwrite_pread.c
index db939b6..c2dc74b 100644 (file)
 #include <sys/ioctl.h>
 #include <sys/time.h>
 #include "drm.h"
-#include "i915_drm.h"
+#include "ioctl_wrappers.h"
 #include "drmtest.h"
+#include "intel_chipset.h"
 #include "intel_bufmgr.h"
 #include "intel_batchbuffer.h"
-#include "intel_gpu_tools.h"
+#include "intel_io.h"
 
 #define OBJECT_SIZE 16384
 
@@ -297,10 +298,10 @@ int main(int argc, char **argv)
                        gettimeofday(&start, NULL);
                        copy(fd, src, dst, tmp, object_size, count);
                        gettimeofday(&end, NULL);
-                       printf("Time to uncached copy %d bytes x %6d:   %7.3fµs, %s\n",
-                              object_size, count,
-                              elapsed(&start, &end, count),
-                              bytes_per_sec((char *)buf, object_size/elapsed(&start, &end, count)*1e6));
+                       igt_info("Time to uncached copy %d bytes x %6d: %7.3fµs, %s\n",
+                                object_size, count,
+                                elapsed(&start, &end, count),
+                                bytes_per_sec((char *)buf, object_size/elapsed(&start, &end, count)*1e6));
                        fflush(stdout);
                }
        }
@@ -314,10 +315,10 @@ int main(int argc, char **argv)
                        gettimeofday(&start, NULL);
                        as_gtt_mmap(fd, src, dst, tmp, object_size, count);
                        gettimeofday(&end, NULL);
-                       printf("** mmap uncached copy %d bytes x %6d:   %7.3fµs, %s\n",
-                              object_size, count,
-                              elapsed(&start, &end, count),
-                              bytes_per_sec((char *)buf, object_size/elapsed(&start, &end, count)*1e6));
+                       igt_info("** mmap uncached copy %d bytes x %6d: %7.3fµs, %s\n",
+                                object_size, count,
+                                elapsed(&start, &end, count),
+                                bytes_per_sec((char *)buf, object_size/elapsed(&start, &end, count)*1e6));
                        fflush(stdout);
                }
        }
@@ -336,10 +337,10 @@ int main(int argc, char **argv)
                        gettimeofday(&start, NULL);
                        copy(fd, src, dst, tmp, object_size, count);
                        gettimeofday(&end, NULL);
-                       printf("Time to snooped copy %d bytes x %6d:    %7.3fµs, %s\n",
-                              object_size, count,
-                              elapsed(&start, &end, count),
-                              bytes_per_sec((char *)buf, object_size/elapsed(&start, &end, count)*1e6));
+                       igt_info("Time to snooped copy %d bytes x %6d:  %7.3fµs, %s\n",
+                                object_size, count,
+                                elapsed(&start, &end, count),
+                                bytes_per_sec((char *)buf, object_size/elapsed(&start, &end, count)*1e6));
                        fflush(stdout);
                }
        }
@@ -353,10 +354,10 @@ int main(int argc, char **argv)
                        gettimeofday(&start, NULL);
                        as_cpu_mmap(fd, src, dst, tmp, object_size, count);
                        gettimeofday(&end, NULL);
-                       printf("** mmap snooped copy %d bytes x %6d:    %7.3fµs, %s\n",
-                              object_size, count,
-                              elapsed(&start, &end, count),
-                              bytes_per_sec((char *)buf, object_size/elapsed(&start, &end, count)*1e6));
+                       igt_info("** mmap snooped copy %d bytes x %6d:  %7.3fµs, %s\n",
+                                object_size, count,
+                                elapsed(&start, &end, count),
+                                bytes_per_sec((char *)buf, object_size/elapsed(&start, &end, count)*1e6));
                        fflush(stdout);
                }
        }
@@ -375,10 +376,10 @@ int main(int argc, char **argv)
                        gettimeofday(&start, NULL);
                        copy(fd, src, dst, tmp, object_size, count);
                        gettimeofday(&end, NULL);
-                       printf("Time to display copy %d bytes x %6d:    %7.3fµs, %s\n",
-                              object_size, count,
-                              elapsed(&start, &end, count),
-                              bytes_per_sec((char *)buf, object_size/elapsed(&start, &end, count)*1e6));
+                       igt_info("Time to display copy %d bytes x %6d:  %7.3fµs, %s\n",
+                                object_size, count,
+                                elapsed(&start, &end, count),
+                                bytes_per_sec((char *)buf, object_size/elapsed(&start, &end, count)*1e6));
                        fflush(stdout);
                }
        }
@@ -392,10 +393,10 @@ int main(int argc, char **argv)
                        gettimeofday(&start, NULL);
                        as_gtt_mmap(fd, src, dst, tmp, object_size, count);
                        gettimeofday(&end, NULL);
-                       printf("** mmap display copy %d bytes x %6d:    %7.3fµs, %s\n",
-                              object_size, count,
-                              elapsed(&start, &end, count),
-                              bytes_per_sec((char *)buf, object_size/elapsed(&start, &end, count)*1e6));
+                       igt_info("** mmap display copy %d bytes x %6d:  %7.3fµs, %s\n",
+                                object_size, count,
+                                elapsed(&start, &end, count),
+                                bytes_per_sec((char *)buf, object_size/elapsed(&start, &end, count)*1e6));
                        fflush(stdout);
                }
        }