29 #define RADEON_BENCHMARK_COPY_BLIT 1
30 #define RADEON_BENCHMARK_COPY_DMA 0
32 #define RADEON_BENCHMARK_ITERATIONS 1024
33 #define RADEON_BENCHMARK_COMMON_MODES_N 17
39 unsigned long start_jiffies;
40 unsigned long end_jiffies;
45 for (i = 0; i <
n; i++) {
58 DRM_ERROR(
"Unknown copy method\n");
78 static void radeon_benchmark_log_results(
int n,
unsigned size,
80 unsigned sdomain,
unsigned ddomain,
83 unsigned int throughput = (n * (size >> 10)) /
time;
84 DRM_INFO(
"radeon: %s %u bo moves of %u kB from"
85 " %d to %d in %u ms, throughput: %u Mb/s or %u MB/s\n",
86 kind, n, size >> 10, sdomain, ddomain, time,
87 throughput * 8, throughput);
91 unsigned sdomain,
unsigned ddomain)
108 radeon_bo_unreserve(sobj);
120 radeon_bo_unreserve(dobj);
128 if ((rdev->
asic->copy.dma) && (sdomain != ddomain)) {
129 time = radeon_benchmark_do_move(rdev, size, saddr, daddr,
134 radeon_benchmark_log_results(n, size, time,
135 sdomain, ddomain,
"dma");
138 time = radeon_benchmark_do_move(rdev, size, saddr, daddr,
143 radeon_benchmark_log_results(n, size, time,
144 sdomain, ddomain,
"blit");
151 radeon_bo_unreserve(sobj);
159 radeon_bo_unreserve(dobj);
165 DRM_ERROR(
"Error while benchmarking BO move.\n");
192 switch (test_number) {
207 for (i = 1; i <= 16384; i <<= 1)
214 for (i = 1; i <= 16384; i <<= 1)
215 radeon_benchmark_move(rdev, i * RADEON_GPU_PAGE_SIZE,
221 for (i = 1; i <= 16384; i <<= 1)
222 radeon_benchmark_move(rdev, i * RADEON_GPU_PAGE_SIZE,
229 radeon_benchmark_move(rdev, common_modes[i],
236 radeon_benchmark_move(rdev, common_modes[i],
243 radeon_benchmark_move(rdev, common_modes[i],
249 DRM_ERROR(
"Unknown benchmark\n");