Rev 3031 | Rev 5271 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3031 | Rev 5078 | ||
---|---|---|---|
Line 39... | Line 39... | ||
39 | unsigned long start_jiffies; |
39 | unsigned long start_jiffies; |
40 | unsigned long end_jiffies; |
40 | unsigned long end_jiffies; |
41 | struct radeon_fence *fence = NULL; |
41 | struct radeon_fence *fence = NULL; |
42 | int i, r; |
42 | int i, r; |
Line 43... | Line 43... | ||
43 | 43 | ||
44 | start_jiffies = GetTimerTicks(); |
44 | start_jiffies = jiffies; |
45 | for (i = 0; i < n; i++) { |
45 | for (i = 0; i < n; i++) { |
46 | switch (flag) { |
46 | switch (flag) { |
47 | case RADEON_BENCHMARK_COPY_DMA: |
47 | case RADEON_BENCHMARK_COPY_DMA: |
48 | r = radeon_copy_dma(rdev, saddr, daddr, |
48 | r = radeon_copy_dma(rdev, saddr, daddr, |
Line 63... | Line 63... | ||
63 | r = radeon_fence_wait(fence, false); |
63 | r = radeon_fence_wait(fence, false); |
64 | if (r) |
64 | if (r) |
65 | goto exit_do_move; |
65 | goto exit_do_move; |
66 | radeon_fence_unref(&fence); |
66 | radeon_fence_unref(&fence); |
67 | } |
67 | } |
68 | end_jiffies = GetTimerTicks(); |
68 | end_jiffies = jiffies; |
69 | r = jiffies_to_msecs(end_jiffies - start_jiffies); |
69 | r = jiffies_to_msecs(end_jiffies - start_jiffies); |
Line 70... | Line 70... | ||
70 | 70 | ||
71 | exit_do_move: |
71 | exit_do_move: |
72 | if (fence) |
72 | if (fence) |
Line 98... | Line 98... | ||
98 | 98 | ||
Line 99... | Line 99... | ||
99 | 99 | ||
100 | ENTER(); |
100 | ENTER(); |
101 | 101 | ||
102 | n = RADEON_BENCHMARK_ITERATIONS; |
102 | n = RADEON_BENCHMARK_ITERATIONS; |
103 | r = radeon_bo_create(rdev, size, PAGE_SIZE, true, sdomain, NULL, &sobj); |
103 | r = radeon_bo_create(rdev, size, PAGE_SIZE, true, sdomain, 0, NULL, &sobj); |
104 | if (r) { |
104 | if (r) { |
105 | goto out_cleanup; |
105 | goto out_cleanup; |
106 | } |
106 | } |
107 | r = radeon_bo_reserve(sobj, false); |
107 | r = radeon_bo_reserve(sobj, false); |
108 | if (unlikely(r != 0)) |
108 | if (unlikely(r != 0)) |
109 | goto out_cleanup; |
109 | goto out_cleanup; |
110 | r = radeon_bo_pin(sobj, sdomain, &saddr); |
110 | r = radeon_bo_pin(sobj, sdomain, &saddr); |
111 | // radeon_bo_unreserve(sobj); |
111 | radeon_bo_unreserve(sobj); |
112 | if (r) { |
112 | if (r) { |
113 | goto out_cleanup; |
113 | goto out_cleanup; |
114 | } |
114 | } |
115 | r = radeon_bo_create(rdev, size, PAGE_SIZE, true, ddomain, NULL, &dobj); |
115 | r = radeon_bo_create(rdev, size, PAGE_SIZE, true, ddomain, 0, NULL, &dobj); |
116 | if (r) { |
116 | if (r) { |
117 | goto out_cleanup; |
117 | goto out_cleanup; |
118 | } |
118 | } |
119 | r = radeon_bo_reserve(dobj, false); |
119 | r = radeon_bo_reserve(dobj, false); |
120 | if (unlikely(r != 0)) |
120 | if (unlikely(r != 0)) |
121 | goto out_cleanup; |
121 | goto out_cleanup; |
122 | r = radeon_bo_pin(dobj, ddomain, &daddr); |
122 | r = radeon_bo_pin(dobj, ddomain, &daddr); |
123 | // radeon_bo_unreserve(dobj); |
123 | radeon_bo_unreserve(dobj); |
124 | if (r) { |
124 | if (r) { |
Line 125... | Line -... | ||
125 | goto out_cleanup; |
- | |
126 | } |
- | |
127 | dbgprintf("done\n"); |
- | |
128 | 125 | goto out_cleanup; |
|
129 | /* r100 doesn't have dma engine so skip the test */ |
126 | } |
130 | /* also, VRAM-to-VRAM test doesn't make much sense for DMA */ |
127 | dbgprintf("done\n"); |
131 | /* skip it as well if domains are the same */ |
128 | |
132 | if ((rdev->asic->copy.dma) && (sdomain != ddomain)) { |
129 | if (rdev->asic->copy.dma) { |
133 | time = radeon_benchmark_do_move(rdev, size, saddr, daddr, |
130 | time = radeon_benchmark_do_move(rdev, size, saddr, daddr, |
134 | RADEON_BENCHMARK_COPY_DMA, n); |
131 | RADEON_BENCHMARK_COPY_DMA, n); |
135 | if (time < 0) |
132 | if (time < 0) |
136 | goto out_cleanup; |
133 | goto out_cleanup; |
Line -... | Line 134... | ||
- | 134 | if (time > 0) |
|
137 | if (time > 0) |
135 | radeon_benchmark_log_results(n, size, time, |
138 | radeon_benchmark_log_results(n, size, time, |
136 | sdomain, ddomain, "dma"); |
139 | sdomain, ddomain, "dma"); |
137 | } |
140 | } |
138 | |
141 | 139 | if (rdev->asic->copy.blit) { |
|
142 | time = radeon_benchmark_do_move(rdev, size, saddr, daddr, |
140 | time = radeon_benchmark_do_move(rdev, size, saddr, daddr, |
143 | RADEON_BENCHMARK_COPY_BLIT, n); |
141 | RADEON_BENCHMARK_COPY_BLIT, n); |
- | 142 | if (time < 0) |
|
Line 144... | Line 143... | ||
144 | if (time < 0) |
143 | goto out_cleanup; |
145 | goto out_cleanup; |
144 | if (time > 0) |
146 | if (time > 0) |
145 | radeon_benchmark_log_results(n, size, time, |
147 | radeon_benchmark_log_results(n, size, time, |
146 | sdomain, ddomain, "blit"); |