Chris Wilson | 07d59b3 | 2011-01-20 22:10:10 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright © 2011 Intel Corporation |
| 3 | * |
| 4 | * Permission is hereby granted, free of charge, to any person obtaining a |
| 5 | * copy of this software and associated documentation files (the "Software"), |
| 6 | * to deal in the Software without restriction, including without limitation |
| 7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 8 | * and/or sell copies of the Software, and to permit persons to whom the |
| 9 | * Software is furnished to do so, subject to the following conditions: |
| 10 | * |
| 11 | * The above copyright notice and this permission notice (including the next |
| 12 | * paragraph) shall be included in all copies or substantial portions of the |
| 13 | * Software. |
| 14 | * |
| 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 18 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 19 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
| 20 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
| 21 | * IN THE SOFTWARE. |
| 22 | * |
| 23 | * Authors: |
| 24 | * Chris Wilson <chris@chris-wilson.co.uk> |
| 25 | * |
| 26 | */ |
| 27 | |
Thomas Wood | 804e11f | 2015-08-17 17:57:43 +0100 | [diff] [blame] | 28 | #include "igt.h" |
Chris Wilson | c6e26e4 | 2016-07-22 12:58:54 +0100 | [diff] [blame] | 29 | #include "igt_sysfs.h" |
Chris Wilson | 07d59b3 | 2011-01-20 22:10:10 +0000 | [diff] [blame] | 30 | #include <unistd.h> |
| 31 | #include <stdlib.h> |
| 32 | #include <stdint.h> |
| 33 | #include <stdio.h> |
| 34 | #include <string.h> |
Chris Wilson | 07d59b3 | 2011-01-20 22:10:10 +0000 | [diff] [blame] | 35 | #include <fcntl.h> |
| 36 | #include <inttypes.h> |
| 37 | #include <errno.h> |
| 38 | #include <sys/stat.h> |
| 39 | #include <sys/ioctl.h> |
Chris Wilson | 07d59b3 | 2011-01-20 22:10:10 +0000 | [diff] [blame] | 40 | #include <sys/time.h> |
Chris Wilson | b430709 | 2015-07-01 13:53:07 +0100 | [diff] [blame] | 41 | #include <time.h> |
Chris Wilson | 07d59b3 | 2011-01-20 22:10:10 +0000 | [diff] [blame] | 42 | #include "drm.h" |
Chris Wilson | 07d59b3 | 2011-01-20 22:10:10 +0000 | [diff] [blame] | 43 | |
Chris Wilson | cd8d380 | 2015-03-24 09:15:12 +0000 | [diff] [blame] | 44 | #define LOCAL_I915_EXEC_NO_RELOC (1<<11) |
| 45 | #define LOCAL_I915_EXEC_HANDLE_LUT (1<<12) |
| 46 | |
Chris Wilson | 3a7325e | 2016-03-08 11:43:31 +0000 | [diff] [blame] | 47 | #define LOCAL_I915_EXEC_BSD_SHIFT (13) |
| 48 | #define LOCAL_I915_EXEC_BSD_MASK (3 << LOCAL_I915_EXEC_BSD_SHIFT) |
Daniel Vetter | 51f0830 | 2012-12-05 19:29:11 +0100 | [diff] [blame] | 49 | |
Chris Wilson | 3a7325e | 2016-03-08 11:43:31 +0000 | [diff] [blame] | 50 | #define ENGINE_FLAGS (I915_EXEC_RING_MASK | LOCAL_I915_EXEC_BSD_MASK) |
Chris Wilson | 2659cbb | 2015-03-26 12:09:57 +0000 | [diff] [blame] | 51 | |
Chris Wilson | 3a7325e | 2016-03-08 11:43:31 +0000 | [diff] [blame] | 52 | static double elapsed(const struct timespec *start, const struct timespec *end) |
| 53 | { |
| 54 | return ((end->tv_sec - start->tv_sec) + |
| 55 | (end->tv_nsec - start->tv_nsec)*1e-9); |
| 56 | } |
| 57 | |
Chris Wilson | 870c774 | 2016-03-28 15:29:46 +0100 | [diff] [blame] | 58 | static double nop_on_ring(int fd, uint32_t handle, unsigned ring_id, |
| 59 | int timeout, unsigned long *out) |
Chris Wilson | 07d59b3 | 2011-01-20 22:10:10 +0000 | [diff] [blame] | 60 | { |
| 61 | struct drm_i915_gem_execbuffer2 execbuf; |
Chris Wilson | 3a7325e | 2016-03-08 11:43:31 +0000 | [diff] [blame] | 62 | struct drm_i915_gem_exec_object2 obj; |
| 63 | struct timespec start, now; |
Chris Wilson | 870c774 | 2016-03-28 15:29:46 +0100 | [diff] [blame] | 64 | unsigned long count; |
Daniel Vetter | 8f5387e | 2013-08-13 13:20:58 +0200 | [diff] [blame] | 65 | |
Chris Wilson | 3a7325e | 2016-03-08 11:43:31 +0000 | [diff] [blame] | 66 | memset(&obj, 0, sizeof(obj)); |
| 67 | obj.handle = handle; |
Chris Wilson | 07d59b3 | 2011-01-20 22:10:10 +0000 | [diff] [blame] | 68 | |
Chris Wilson | cd8d380 | 2015-03-24 09:15:12 +0000 | [diff] [blame] | 69 | memset(&execbuf, 0, sizeof(execbuf)); |
Chris Wilson | 3a7325e | 2016-03-08 11:43:31 +0000 | [diff] [blame] | 70 | execbuf.buffers_ptr = (uintptr_t)&obj; |
Chris Wilson | cd8d380 | 2015-03-24 09:15:12 +0000 | [diff] [blame] | 71 | execbuf.buffer_count = 1; |
| 72 | execbuf.flags = ring_id; |
| 73 | execbuf.flags |= LOCAL_I915_EXEC_HANDLE_LUT; |
| 74 | execbuf.flags |= LOCAL_I915_EXEC_NO_RELOC; |
Chris Wilson | 3e2443f | 2016-03-10 11:50:53 +0000 | [diff] [blame] | 75 | if (__gem_execbuf(fd, &execbuf)) { |
Chris Wilson | cd8d380 | 2015-03-24 09:15:12 +0000 | [diff] [blame] | 76 | execbuf.flags = ring_id; |
Chris Wilson | 3a7325e | 2016-03-08 11:43:31 +0000 | [diff] [blame] | 77 | gem_execbuf(fd, &execbuf); |
Chris Wilson | cd8d380 | 2015-03-24 09:15:12 +0000 | [diff] [blame] | 78 | } |
| 79 | gem_sync(fd, handle); |
Chris Wilson | 71f4153 | 2016-04-22 16:55:29 +0100 | [diff] [blame] | 80 | intel_detect_and_clear_missed_interrupts(fd); |
Chris Wilson | cd8d380 | 2015-03-24 09:15:12 +0000 | [diff] [blame] | 81 | |
Chris Wilson | 870c774 | 2016-03-28 15:29:46 +0100 | [diff] [blame] | 82 | count = 0; |
Chris Wilson | 3a7325e | 2016-03-08 11:43:31 +0000 | [diff] [blame] | 83 | clock_gettime(CLOCK_MONOTONIC, &start); |
| 84 | do { |
Chris Wilson | 870c774 | 2016-03-28 15:29:46 +0100 | [diff] [blame] | 85 | for (int loop = 0; loop < 1024; loop++) |
Chris Wilson | 3a7325e | 2016-03-08 11:43:31 +0000 | [diff] [blame] | 86 | gem_execbuf(fd, &execbuf); |
Chris Wilson | 870c774 | 2016-03-28 15:29:46 +0100 | [diff] [blame] | 87 | |
| 88 | count += 1024; |
Chris Wilson | 3a7325e | 2016-03-08 11:43:31 +0000 | [diff] [blame] | 89 | clock_gettime(CLOCK_MONOTONIC, &now); |
Chris Wilson | 870c774 | 2016-03-28 15:29:46 +0100 | [diff] [blame] | 90 | } while (elapsed(&start, &now) < timeout); |
Chris Wilson | 3a7325e | 2016-03-08 11:43:31 +0000 | [diff] [blame] | 91 | gem_sync(fd, handle); |
| 92 | clock_gettime(CLOCK_MONOTONIC, &now); |
Chris Wilson | 71f4153 | 2016-04-22 16:55:29 +0100 | [diff] [blame] | 93 | igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0); |
Chris Wilson | 3a7325e | 2016-03-08 11:43:31 +0000 | [diff] [blame] | 94 | |
Chris Wilson | 870c774 | 2016-03-28 15:29:46 +0100 | [diff] [blame] | 95 | *out = count; |
| 96 | return elapsed(&start, &now); |
| 97 | } |
| 98 | |
| 99 | static void single(int fd, uint32_t handle, |
| 100 | unsigned ring_id, const char *ring_name) |
| 101 | { |
| 102 | double time; |
| 103 | unsigned long count; |
| 104 | |
| 105 | gem_require_ring(fd, ring_id); |
| 106 | |
| 107 | time = nop_on_ring(fd, handle, ring_id, 20, &count); |
| 108 | igt_info("%s: %'lu cycles: %.3fus\n", |
| 109 | ring_name, count, time*1e6 / count); |
Chris Wilson | 3a7325e | 2016-03-08 11:43:31 +0000 | [diff] [blame] | 110 | } |
| 111 | |
Chris Wilson | 0aacdac | 2016-03-09 21:06:16 +0000 | [diff] [blame] | 112 | static bool ignore_engine(int fd, unsigned engine) |
| 113 | { |
| 114 | if (engine == 0) |
| 115 | return true; |
| 116 | |
| 117 | if (gem_has_bsd2(fd) && engine == I915_EXEC_BSD) |
| 118 | return true; |
| 119 | |
| 120 | return false; |
| 121 | } |
| 122 | |
Chris Wilson | 4cce715 | 2016-09-08 13:43:17 +0100 | [diff] [blame] | 123 | static void parallel(int fd, uint32_t handle, int timeout) |
| 124 | { |
| 125 | struct drm_i915_gem_execbuffer2 execbuf; |
| 126 | struct drm_i915_gem_exec_object2 obj; |
| 127 | struct timespec start, now; |
| 128 | unsigned engines[16]; |
| 129 | const char *names[16]; |
| 130 | unsigned nengine; |
| 131 | unsigned engine; |
| 132 | unsigned long count; |
| 133 | double time, sum; |
| 134 | |
| 135 | sum = 0; |
| 136 | nengine = 0; |
| 137 | for_each_engine(fd, engine) { |
| 138 | if (ignore_engine(fd, engine)) |
| 139 | continue; |
| 140 | |
| 141 | engines[nengine] = engine; |
| 142 | names[nengine] = e__->name; |
| 143 | nengine++; |
| 144 | |
| 145 | time = nop_on_ring(fd, handle, engine, 1, &count) / count; |
| 146 | sum += time; |
| 147 | igt_debug("%s: %.3fus\n", e__->name, 1e6*time); |
| 148 | } |
| 149 | igt_require(nengine); |
| 150 | igt_info("average (individually): %.3fus\n", sum/nengine*1e6); |
| 151 | |
| 152 | memset(&obj, 0, sizeof(obj)); |
| 153 | obj.handle = handle; |
| 154 | |
| 155 | memset(&execbuf, 0, sizeof(execbuf)); |
| 156 | execbuf.buffers_ptr = (uintptr_t)&obj; |
| 157 | execbuf.buffer_count = 1; |
| 158 | execbuf.flags |= LOCAL_I915_EXEC_HANDLE_LUT; |
| 159 | execbuf.flags |= LOCAL_I915_EXEC_NO_RELOC; |
| 160 | if (__gem_execbuf(fd, &execbuf)) { |
| 161 | execbuf.flags = 0; |
| 162 | gem_execbuf(fd, &execbuf); |
| 163 | } |
| 164 | gem_sync(fd, handle); |
| 165 | intel_detect_and_clear_missed_interrupts(fd); |
| 166 | |
| 167 | igt_fork(child, nengine) { |
| 168 | execbuf.flags &= ~ENGINE_FLAGS; |
| 169 | execbuf.flags |= engines[child]; |
| 170 | |
| 171 | count = 0; |
| 172 | clock_gettime(CLOCK_MONOTONIC, &start); |
| 173 | do { |
| 174 | for (int loop = 0; loop < 1024; loop++) |
| 175 | gem_execbuf(fd, &execbuf); |
| 176 | count += 1024; |
| 177 | clock_gettime(CLOCK_MONOTONIC, &now); |
| 178 | } while (elapsed(&start, &now) < timeout); |
| 179 | gem_sync(fd, handle); |
| 180 | clock_gettime(CLOCK_MONOTONIC, &now); |
| 181 | time = elapsed(&start, &now) / count; |
| 182 | igt_info("%s: %ld cycles, %.3fus\n", names[child], count, 1e6*time); |
| 183 | } |
| 184 | |
| 185 | igt_waitchildren(); |
| 186 | igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0); |
| 187 | |
| 188 | } |
| 189 | |
| 190 | static void series(int fd, uint32_t handle, int timeout) |
Chris Wilson | 3a7325e | 2016-03-08 11:43:31 +0000 | [diff] [blame] | 191 | { |
| 192 | struct drm_i915_gem_execbuffer2 execbuf; |
| 193 | struct drm_i915_gem_exec_object2 obj; |
| 194 | struct timespec start, now; |
| 195 | unsigned engines[16]; |
| 196 | unsigned nengine; |
| 197 | unsigned engine; |
Chris Wilson | 870c774 | 2016-03-28 15:29:46 +0100 | [diff] [blame] | 198 | unsigned long count; |
Chris Wilson | 41a26b5 | 2016-03-28 16:26:01 +0100 | [diff] [blame] | 199 | double time, max = 0, min = HUGE_VAL, sum = 0; |
Chris Wilson | 870c774 | 2016-03-28 15:29:46 +0100 | [diff] [blame] | 200 | const char *name; |
Chris Wilson | 3a7325e | 2016-03-08 11:43:31 +0000 | [diff] [blame] | 201 | |
| 202 | nengine = 0; |
Chris Wilson | 870c774 | 2016-03-28 15:29:46 +0100 | [diff] [blame] | 203 | for_each_engine(fd, engine) { |
| 204 | if (ignore_engine(fd, engine)) |
| 205 | continue; |
| 206 | |
| 207 | time = nop_on_ring(fd, handle, engine, 1, &count) / count; |
| 208 | if (time > max) { |
| 209 | name = e__->name; |
| 210 | max = time; |
| 211 | } |
Chris Wilson | 41a26b5 | 2016-03-28 16:26:01 +0100 | [diff] [blame] | 212 | if (time < min) |
| 213 | min = time; |
Chris Wilson | 870c774 | 2016-03-28 15:29:46 +0100 | [diff] [blame] | 214 | sum += time; |
| 215 | engines[nengine++] = engine; |
| 216 | } |
Chris Wilson | 0aacdac | 2016-03-09 21:06:16 +0000 | [diff] [blame] | 217 | igt_require(nengine); |
Chris Wilson | 870c774 | 2016-03-28 15:29:46 +0100 | [diff] [blame] | 218 | igt_info("Maximum execution latency on %s, %.3fus, total %.3fus per cycle\n", |
| 219 | name, max*1e6, sum*1e6); |
Chris Wilson | 3a7325e | 2016-03-08 11:43:31 +0000 | [diff] [blame] | 220 | |
| 221 | memset(&obj, 0, sizeof(obj)); |
| 222 | obj.handle = handle; |
| 223 | |
| 224 | memset(&execbuf, 0, sizeof(execbuf)); |
| 225 | execbuf.buffers_ptr = (uintptr_t)&obj; |
| 226 | execbuf.buffer_count = 1; |
| 227 | execbuf.flags |= LOCAL_I915_EXEC_HANDLE_LUT; |
| 228 | execbuf.flags |= LOCAL_I915_EXEC_NO_RELOC; |
Chris Wilson | 3e2443f | 2016-03-10 11:50:53 +0000 | [diff] [blame] | 229 | if (__gem_execbuf(fd, &execbuf)) { |
Chris Wilson | 3a7325e | 2016-03-08 11:43:31 +0000 | [diff] [blame] | 230 | execbuf.flags = 0; |
| 231 | gem_execbuf(fd, &execbuf); |
Chris Wilson | 07d59b3 | 2011-01-20 22:10:10 +0000 | [diff] [blame] | 232 | } |
Chris Wilson | 3a7325e | 2016-03-08 11:43:31 +0000 | [diff] [blame] | 233 | gem_sync(fd, handle); |
Chris Wilson | 71f4153 | 2016-04-22 16:55:29 +0100 | [diff] [blame] | 234 | intel_detect_and_clear_missed_interrupts(fd); |
Chris Wilson | 3a7325e | 2016-03-08 11:43:31 +0000 | [diff] [blame] | 235 | |
Chris Wilson | 870c774 | 2016-03-28 15:29:46 +0100 | [diff] [blame] | 236 | count = 0; |
Chris Wilson | 3a7325e | 2016-03-08 11:43:31 +0000 | [diff] [blame] | 237 | clock_gettime(CLOCK_MONOTONIC, &start); |
| 238 | do { |
| 239 | for (int loop = 0; loop < 1024; loop++) { |
| 240 | for (int n = 0; n < nengine; n++) { |
| 241 | execbuf.flags &= ~ENGINE_FLAGS; |
| 242 | execbuf.flags |= engines[n]; |
| 243 | gem_execbuf(fd, &execbuf); |
| 244 | } |
| 245 | } |
| 246 | count += nengine * 1024; |
| 247 | clock_gettime(CLOCK_MONOTONIC, &now); |
Chris Wilson | 772393e | 2016-03-14 14:31:36 +0000 | [diff] [blame] | 248 | } while (elapsed(&start, &now) < timeout); /* Hang detection ~120s */ |
Chris Wilson | 3a7325e | 2016-03-08 11:43:31 +0000 | [diff] [blame] | 249 | gem_sync(fd, handle); |
| 250 | clock_gettime(CLOCK_MONOTONIC, &now); |
Chris Wilson | 71f4153 | 2016-04-22 16:55:29 +0100 | [diff] [blame] | 251 | igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0); |
Chris Wilson | 3a7325e | 2016-03-08 11:43:31 +0000 | [diff] [blame] | 252 | |
Chris Wilson | 870c774 | 2016-03-28 15:29:46 +0100 | [diff] [blame] | 253 | time = elapsed(&start, &now) / count; |
Chris Wilson | a0eebbd | 2016-09-08 13:29:31 +0100 | [diff] [blame] | 254 | igt_info("All (%d engines): %'lu cycles, average %.3fus per cycle [expected ideal %.3fus]\n", |
Chris Wilson | 61b19a4 | 2016-09-08 14:50:32 +0100 | [diff] [blame^] | 255 | nengine, count, 1e6*time, 1e6*((max-min)/nengine+min)); |
Chris Wilson | 41a26b5 | 2016-03-28 16:26:01 +0100 | [diff] [blame] | 256 | |
Chris Wilson | a0eebbd | 2016-09-08 13:29:31 +0100 | [diff] [blame] | 257 | /* The rate limiting step should be how fast the slowest engine can |
| 258 | * execute its queue of requests, as when we wait upon a full ring all |
| 259 | * dispatch is frozen. So in general we cannot go faster than the |
| 260 | * slowest engine (but as all engines are in lockstep, they should all |
| 261 | * be executing in parallel and so the average should be max/nengines), |
| 262 | * but we should equally not go any slower. |
| 263 | * |
| 264 | * However, that depends upon being able to submit fast enough, and |
| 265 | * that in turns depends upon debugging turned off and no bottlenecks |
| 266 | * within the driver. We cannot assert that we hit ideal conditions |
| 267 | * across all engines, so we only look for an outrageous error |
| 268 | * condition. |
Chris Wilson | 41a26b5 | 2016-03-28 16:26:01 +0100 | [diff] [blame] | 269 | */ |
Chris Wilson | a0eebbd | 2016-09-08 13:29:31 +0100 | [diff] [blame] | 270 | igt_assert_f(time < 2*sum, |
| 271 | "Average time (%.3fus) exceeds expectation for parallel execution (min %.3fus, max %.3fus; limit set at %.3fus)\n", |
| 272 | 1e6*time, 1e6*min, 1e6*max, 1e6*sum*2); |
Daniel Vetter | d9d9578 | 2012-12-04 17:13:05 +0100 | [diff] [blame] | 273 | } |
Daniel Vetter | 8f5387e | 2013-08-13 13:20:58 +0200 | [diff] [blame] | 274 | |
Chris Wilson | c6e26e4 | 2016-07-22 12:58:54 +0100 | [diff] [blame] | 275 | static void print_welcome(int fd) |
| 276 | { |
| 277 | bool active; |
Chris Wilson | c6e26e4 | 2016-07-22 12:58:54 +0100 | [diff] [blame] | 278 | int dir; |
| 279 | |
| 280 | dir = igt_sysfs_open_parameters(fd); |
| 281 | if (dir < 0) |
| 282 | return; |
| 283 | |
Chris Wilson | b64d10c | 2016-07-22 17:53:51 +0100 | [diff] [blame] | 284 | active = igt_sysfs_get_boolean(dir, "enable_guc_submission"); |
Chris Wilson | c6e26e4 | 2016-07-22 12:58:54 +0100 | [diff] [blame] | 285 | if (active) { |
| 286 | igt_info("Using GuC submission\n"); |
| 287 | goto out; |
| 288 | } |
| 289 | |
Chris Wilson | b64d10c | 2016-07-22 17:53:51 +0100 | [diff] [blame] | 290 | active = igt_sysfs_get_boolean(dir, "enable_execlists"); |
Chris Wilson | c6e26e4 | 2016-07-22 12:58:54 +0100 | [diff] [blame] | 291 | if (active) { |
| 292 | igt_info("Using Execlists submission\n"); |
| 293 | goto out; |
| 294 | } |
| 295 | |
Chris Wilson | b64d10c | 2016-07-22 17:53:51 +0100 | [diff] [blame] | 296 | active = igt_sysfs_get_boolean(dir, "semaphores"); |
Chris Wilson | c6e26e4 | 2016-07-22 12:58:54 +0100 | [diff] [blame] | 297 | igt_info("Using Legacy submission %s\n", |
| 298 | active ? ", with semaphores" : ""); |
| 299 | |
| 300 | out: |
| 301 | close(dir); |
| 302 | } |
| 303 | |
Daniel Vetter | 071e9ca | 2013-10-31 16:23:26 +0100 | [diff] [blame] | 304 | igt_main |
Daniel Vetter | d9d9578 | 2012-12-04 17:13:05 +0100 | [diff] [blame] | 305 | { |
Chris Wilson | 7e0853c | 2016-01-27 14:17:53 +0000 | [diff] [blame] | 306 | const struct intel_execution_engine *e; |
Chris Wilson | 2659cbb | 2015-03-26 12:09:57 +0000 | [diff] [blame] | 307 | uint32_t handle = 0; |
Chris Wilson | 3a7325e | 2016-03-08 11:43:31 +0000 | [diff] [blame] | 308 | int device = -1; |
Daniel Vetter | d9d9578 | 2012-12-04 17:13:05 +0100 | [diff] [blame] | 309 | |
Chris Wilson | 2659cbb | 2015-03-26 12:09:57 +0000 | [diff] [blame] | 310 | igt_fixture { |
Chris Wilson | 3a7325e | 2016-03-08 11:43:31 +0000 | [diff] [blame] | 311 | const uint32_t bbe = MI_BATCH_BUFFER_END; |
| 312 | |
Micah Fedke | c81d293 | 2015-07-22 21:54:02 +0000 | [diff] [blame] | 313 | device = drm_open_driver(DRIVER_INTEL); |
Chris Wilson | c6e26e4 | 2016-07-22 12:58:54 +0100 | [diff] [blame] | 314 | print_welcome(device); |
| 315 | |
Chris Wilson | 2659cbb | 2015-03-26 12:09:57 +0000 | [diff] [blame] | 316 | handle = gem_create(device, 4096); |
Chris Wilson | 3a7325e | 2016-03-08 11:43:31 +0000 | [diff] [blame] | 317 | gem_write(device, handle, 0, &bbe, sizeof(bbe)); |
Daniel Vetter | d9d9578 | 2012-12-04 17:13:05 +0100 | [diff] [blame] | 318 | |
Daniel Vetter | be21fc0 | 2016-06-17 16:04:09 +0200 | [diff] [blame] | 319 | igt_fork_hang_detector(device); |
| 320 | } |
Chris Wilson | 9d61a68 | 2016-03-25 18:22:54 +0000 | [diff] [blame] | 321 | |
Chris Wilson | 4cce715 | 2016-09-08 13:43:17 +0100 | [diff] [blame] | 322 | igt_subtest("basic-series") |
| 323 | series(device, handle, 10); |
| 324 | |
| 325 | igt_subtest("basic-parallel") |
| 326 | parallel(device, handle, 10); |
Chris Wilson | 772393e | 2016-03-14 14:31:36 +0000 | [diff] [blame] | 327 | |
Chris Wilson | 7e0853c | 2016-01-27 14:17:53 +0000 | [diff] [blame] | 328 | for (e = intel_execution_engines; e->name; e++) |
| 329 | igt_subtest_f("%s", e->name) |
Chris Wilson | 3a7325e | 2016-03-08 11:43:31 +0000 | [diff] [blame] | 330 | single(device, handle, e->exec_id | e->flags, e->name); |
| 331 | |
Chris Wilson | 4cce715 | 2016-09-08 13:43:17 +0100 | [diff] [blame] | 332 | igt_subtest("series") |
| 333 | series(device, handle, 150); |
| 334 | |
| 335 | igt_subtest("parallel") |
| 336 | parallel(device, handle, 150); |
Daniel Vetter | d9d9578 | 2012-12-04 17:13:05 +0100 | [diff] [blame] | 337 | |
Daniel Vetter | b3880d3 | 2013-08-14 18:02:46 +0200 | [diff] [blame] | 338 | igt_fixture { |
Daniel Vetter | be21fc0 | 2016-06-17 16:04:09 +0200 | [diff] [blame] | 339 | igt_stop_hang_detector(); |
Chris Wilson | 2659cbb | 2015-03-26 12:09:57 +0000 | [diff] [blame] | 340 | gem_close(device, handle); |
Chris Wilson | 2659cbb | 2015-03-26 12:09:57 +0000 | [diff] [blame] | 341 | close(device); |
Daniel Vetter | b3880d3 | 2013-08-14 18:02:46 +0200 | [diff] [blame] | 342 | } |
Chris Wilson | 07d59b3 | 2011-01-20 22:10:10 +0000 | [diff] [blame] | 343 | } |