Lines Matching refs:i915
47 static bool has_context_engines(int i915) in has_context_engines() argument
53 return __gem_context_set_param(i915, ¶m) == 0; in has_context_engines()
56 static void invalid_engines(int i915) in invalid_engines() argument
60 .ctx_id = gem_context_create(i915), in invalid_engines()
68 igt_assert_eq(__gem_context_set_param(i915, ¶m), 0); in invalid_engines()
71 igt_assert_eq(__gem_context_set_param(i915, ¶m), -EINVAL); in invalid_engines()
74 igt_assert_eq(__gem_context_set_param(i915, ¶m), -EINVAL); in invalid_engines()
77 igt_assert_eq(__gem_context_set_param(i915, ¶m), -EINVAL); in invalid_engines()
80 igt_assert_eq(__gem_context_set_param(i915, ¶m), 0); in invalid_engines()
94 igt_assert_eq(__gem_context_set_param(i915, ¶m), -ENOENT); in invalid_engines()
97 igt_assert_eq(__gem_context_set_param(i915, ¶m), -ENOENT); in invalid_engines()
101 if (__gem_context_set_param(i915, ¶m)) /* XXX needs RCS */ in invalid_engines()
105 igt_assert_eq(__gem_context_set_param(i915, ¶m), -EFAULT); in invalid_engines()
108 igt_assert_eq(__gem_context_set_param(i915, ¶m), 0); in invalid_engines()
111 igt_assert_eq(__gem_context_set_param(i915, ¶m), -EFAULT); in invalid_engines()
114 igt_assert_eq(__gem_context_set_param(i915, ¶m), -EFAULT); in invalid_engines()
117 igt_assert_eq(__gem_context_set_param(i915, ¶m), -EFAULT); in invalid_engines()
120 igt_assert_eq(__gem_context_set_param(i915, ¶m), -EFAULT); in invalid_engines()
123 igt_assert_eq(__gem_context_set_param(i915, ¶m), 0); in invalid_engines()
126 igt_assert_eq(__gem_context_set_param(i915, ¶m), -EFAULT); in invalid_engines()
129 igt_assert_eq(__gem_context_set_param(i915, ¶m), -EFAULT); in invalid_engines()
132 igt_assert_eq(__gem_context_set_param(i915, ¶m), -EFAULT); in invalid_engines()
135 igt_assert_eq(__gem_context_set_param(i915, ¶m), -EFAULT); in invalid_engines()
138 igt_assert_eq(__gem_context_set_param(i915, ¶m), -EFAULT); in invalid_engines()
141 igt_assert_eq(__gem_context_set_param(i915, ¶m), -EFAULT); in invalid_engines()
144 igt_assert_eq(__gem_context_set_param(i915, ¶m), -EFAULT); in invalid_engines()
146 handle = gem_create(i915, 4096 * 3); in invalid_engines()
147 ptr = gem_mmap__gtt(i915, handle, 4096 * 3, PROT_READ); in invalid_engines()
148 gem_close(i915, handle); in invalid_engines()
154 igt_assert_eq(__gem_context_set_param(i915, ¶m), 0); in invalid_engines()
157 igt_assert_eq(__gem_context_set_param(i915, ¶m), -EFAULT); in invalid_engines()
160 igt_assert_eq(__gem_context_set_param(i915, ¶m), -EFAULT); in invalid_engines()
163 igt_assert_eq(__gem_context_set_param(i915, ¶m), -EFAULT); in invalid_engines()
166 igt_assert_eq(__gem_context_set_param(i915, ¶m), -EFAULT); in invalid_engines()
172 gem_context_destroy(i915, param.ctx_id); in invalid_engines()
175 static void idempotent(int i915) in idempotent() argument
180 .ctx_id = gem_context_create(i915), in idempotent()
191 gem_context_get_param(i915, &p); in idempotent()
196 __for_each_physical_engine(i915, e) { in idempotent()
203 gem_context_set_param(i915, &p); in idempotent()
207 gem_context_get_param(i915, &p); in idempotent()
212 gem_context_set_param(i915, &p); in idempotent()
213 gem_context_get_param(i915, &p); in idempotent()
224 gem_context_set_param(i915, &p); in idempotent()
228 gem_context_get_param(i915, &p); in idempotent()
234 gem_context_set_param(i915, &p); in idempotent()
238 gem_context_get_param(i915, &p); in idempotent()
242 gem_context_destroy(i915, p.ctx_id); in idempotent()
245 static void execute_one(int i915) in execute_one() argument
249 .ctx_id = gem_context_create(i915), in execute_one()
255 .handle = gem_create(i915, 4096), in execute_one()
265 gem_write(i915, obj.handle, 0, &bbe, sizeof(bbe)); in execute_one()
269 gem_execbuf(i915, &execbuf); in execute_one()
270 gem_sync(i915, obj.handle); in execute_one()
272 __for_each_physical_engine(i915, e) { in execute_one()
282 gem_context_set_param(i915, ¶m); in execute_one()
284 spin = igt_spin_new(i915, in execute_one()
297 gem_context_set_param(i915, ¶m); in execute_one()
304 igt_assert_f(__gem_execbuf(i915, &execbuf) == expected, in execute_one()
309 do_ioctl(i915, DRM_IOCTL_I915_GEM_BUSY, &busy); in execute_one()
312 igt_spin_free(i915, spin); in execute_one()
314 gem_sync(i915, obj.handle); in execute_one()
315 do_ioctl(i915, DRM_IOCTL_I915_GEM_BUSY, &busy); in execute_one()
322 gem_context_set_param(i915, ¶m); in execute_one()
324 gem_execbuf(i915, &execbuf); in execute_one()
326 gem_close(i915, obj.handle); in execute_one()
327 gem_context_destroy(i915, param.ctx_id); in execute_one()
330 static void execute_oneforall(int i915) in execute_oneforall() argument
334 .ctx_id = gem_context_create(i915), in execute_oneforall()
341 __for_each_physical_engine(i915, e) { in execute_oneforall()
347 gem_context_set_param(i915, ¶m); in execute_oneforall()
353 spin = __igt_spin_new(i915, in execute_oneforall()
358 do_ioctl(i915, DRM_IOCTL_I915_GEM_BUSY, &busy); in execute_oneforall()
361 igt_spin_free(i915, spin); in execute_oneforall()
365 gem_context_destroy(i915, param.ctx_id); in execute_oneforall()
368 static void execute_allforone(int i915) in execute_allforone() argument
372 .ctx_id = gem_context_create(i915), in execute_allforone()
381 __for_each_physical_engine(i915, e) { in execute_allforone()
387 gem_context_set_param(i915, ¶m); in execute_allforone()
390 __for_each_physical_engine(i915, e) { in execute_allforone()
394 spin = __igt_spin_new(i915, in execute_allforone()
399 do_ioctl(i915, DRM_IOCTL_I915_GEM_BUSY, &busy); in execute_allforone()
402 igt_spin_free(i915, spin); in execute_allforone()
405 gem_context_destroy(i915, param.ctx_id); in execute_allforone()
416 static void independent(int i915) in independent() argument
419 const int gen = intel_gen(intel_get_drm_devid(i915)); in independent()
423 .ctx_id = gem_context_create(i915), in independent()
428 struct drm_i915_gem_exec_object2 results = { .handle = gem_create(i915, 4096) }; in independent()
434 igt_require(gem_scheduler_enabled(i915)); in independent()
442 gem_write(i915, results.handle, 0, &bbe, sizeof(bbe)); in independent()
443 gem_execbuf(i915, &execbuf); in independent()
448 gem_context_set_param(i915, ¶m); in independent()
450 gem_set_caching(i915, results.handle, I915_CACHING_CACHED); in independent()
451 map = gem_mmap__cpu(i915, results.handle, 0, 4096, PROT_READ); in independent()
452 gem_set_domain(i915, results.handle, in independent()
459 { .handle = gem_create(i915, 4096) }, in independent()
472 cs = gem_mmap__cpu(i915, obj[1].handle, 0, 4096, PROT_WRITE); in independent()
486 gem_execbuf(i915, &execbuf); in independent()
487 gem_close(i915, obj[1].handle); in independent()
502 gem_sync(i915, results.handle); in independent()
503 gem_close(i915, results.handle); in independent()
505 gem_context_destroy(i915, param.ctx_id); in independent()
510 int i915 = -1; variable
513 i915 = drm_open_driver_render(DRIVER_INTEL);
514 igt_require_gem(i915);
516 gem_require_contexts(i915);
517 igt_require(has_context_engines(i915));
519 igt_fork_hang_detector(i915);
523 invalid_engines(i915);
526 idempotent(i915);
529 execute_one(i915);
532 execute_oneforall(i915);
535 execute_allforone(i915);
538 independent(i915);