• Home
  • Raw
  • Download

Lines Matching refs:i915

28 static int vm_create_ioctl(int i915, struct drm_i915_gem_vm_control *ctl)  in vm_create_ioctl()  argument
31 if (igt_ioctl(i915, DRM_IOCTL_I915_GEM_VM_CREATE, ctl)) { in vm_create_ioctl()
39 static int vm_destroy_ioctl(int i915, struct drm_i915_gem_vm_control *ctl) in vm_destroy_ioctl() argument
42 if (igt_ioctl(i915, DRM_IOCTL_I915_GEM_VM_DESTROY, ctl)) { in vm_destroy_ioctl()
50 static int ctx_create_ioctl(int i915, in ctx_create_ioctl() argument
54 if (igt_ioctl(i915, DRM_IOCTL_I915_GEM_CONTEXT_CREATE_EXT, arg)) { in ctx_create_ioctl()
62 static bool has_vm(int i915) in has_vm() argument
67 err = vm_create_ioctl(i915, &ctl); in has_vm()
74 gem_vm_destroy(i915, ctl.vm_id); in has_vm()
83 static void invalid_create(int i915) in invalid_create() argument
88 igt_assert_eq(vm_create_ioctl(i915, &ctl), 0); in invalid_create()
89 gem_vm_destroy(i915, ctl.vm_id); in invalid_create()
92 igt_assert_eq(vm_create_ioctl(i915, &ctl), 0); in invalid_create()
93 gem_vm_destroy(i915, ctl.vm_id); in invalid_create()
97 igt_assert_eq(vm_create_ioctl(i915, &ctl), -EINVAL); in invalid_create()
101 igt_assert_eq(vm_create_ioctl(i915, &ctl), -EFAULT); in invalid_create()
103 igt_assert_eq(vm_create_ioctl(i915, &ctl), -EINVAL); in invalid_create()
107 static void invalid_destroy(int i915) in invalid_destroy() argument
111 igt_assert_eq(vm_destroy_ioctl(i915, &ctl), -ENOENT); in invalid_destroy()
113 igt_assert_eq(vm_create_ioctl(i915, &ctl), 0); in invalid_destroy()
114 igt_assert_eq(vm_destroy_ioctl(i915, &ctl), 0); in invalid_destroy()
115 igt_assert_eq(vm_destroy_ioctl(i915, &ctl), -ENOENT); in invalid_destroy()
117 igt_assert_eq(vm_create_ioctl(i915, &ctl), 0); in invalid_destroy()
119 igt_assert_eq(vm_destroy_ioctl(i915, &ctl), -ENOENT); in invalid_destroy()
121 igt_assert_eq(vm_destroy_ioctl(i915, &ctl), 0); in invalid_destroy()
123 igt_assert_eq(vm_create_ioctl(i915, &ctl), 0); in invalid_destroy()
125 igt_assert_eq(vm_destroy_ioctl(i915, &ctl), -EINVAL); in invalid_destroy()
127 igt_assert_eq(vm_destroy_ioctl(i915, &ctl), 0); in invalid_destroy()
129 igt_assert_eq(vm_create_ioctl(i915, &ctl), 0); in invalid_destroy()
131 igt_assert_eq(vm_destroy_ioctl(i915, &ctl), -EINVAL); in invalid_destroy()
133 igt_assert_eq(vm_destroy_ioctl(i915, &ctl), 0); in invalid_destroy()
136 static uint32_t __batch_create(int i915, uint32_t offset) in __batch_create() argument
141 handle = gem_create(i915, ALIGN(offset + 4, 4096)); in __batch_create()
142 gem_write(i915, handle, offset, &bbe, sizeof(bbe)); in __batch_create()
147 static uint32_t batch_create(int i915) in batch_create() argument
149 return __batch_create(i915, 0); in batch_create()
152 static void check_same_vm(int i915, uint32_t ctx_a, uint32_t ctx_b) in check_same_vm() argument
155 .handle = batch_create(i915), in check_same_vm()
165 gem_execbuf(i915, &eb); in check_same_vm()
171 gem_execbuf(i915, &eb); in check_same_vm()
174 gem_sync(i915, batch.handle); in check_same_vm()
175 gem_close(i915, batch.handle); in check_same_vm()
178 static void create_ext(int i915) in create_ext() argument
189 igt_require(ctx_create_ioctl(i915, &create) == 0); in create_ext()
190 gem_context_destroy(i915, create.ctx_id); in create_ext()
194 ext.param.value = gem_vm_create(i915); in create_ext()
196 igt_assert_eq(ctx_create_ioctl(i915, &create), 0); in create_ext()
199 igt_assert_eq(ctx_create_ioctl(i915, &create), 0); in create_ext()
202 gem_vm_destroy(i915, ext.param.value); in create_ext()
204 check_same_vm(i915, ctx[0], ctx[1]); in create_ext()
206 gem_context_destroy(i915, ctx[1]); in create_ext()
207 gem_context_destroy(i915, ctx[0]); in create_ext()
210 static void execbuf(int i915) in execbuf() argument
213 .handle = batch_create(i915), in execbuf()
225 gem_execbuf(i915, &eb); in execbuf()
228 arg.value = gem_vm_create(i915); in execbuf()
229 gem_context_set_param(i915, &arg); in execbuf()
230 gem_execbuf(i915, &eb); in execbuf()
232 gem_vm_destroy(i915, arg.value); in execbuf()
234 arg.value = gem_vm_create(i915); in execbuf()
235 gem_context_set_param(i915, &arg); in execbuf()
237 gem_execbuf(i915, &eb); in execbuf()
239 gem_vm_destroy(i915, arg.value); in execbuf()
241 gem_sync(i915, batch.handle); in execbuf()
242 gem_close(i915, batch.handle); in execbuf()
283 static void isolation(int i915) in isolation() argument
287 .handle = gem_create(i915, 4096), in isolation()
290 { .handle = batch_create(i915), } in isolation()
299 int other = gem_reopen_driver(i915); in isolation()
304 igt_assert_neq(i915, other); in isolation()
306 ctx[0] = gem_context_create(i915); in isolation()
309 vm[0] = gem_vm_create(i915); in isolation()
317 gem_context_set_param(i915, &arg); in isolation()
324 gem_execbuf(i915, &eb); /* bind object into vm[0] */ in isolation()
327 write_to_address(i915, ctx[0], obj[0].offset, 1); in isolation()
328 gem_read(i915, obj[0].handle, 0, &result, sizeof(result)); in isolation()
333 gem_read(i915, obj[0].handle, 0, &result, sizeof(result)); in isolation()
338 gem_close(i915, obj[1].handle); in isolation()
339 gem_close(i915, obj[0].handle); in isolation()
341 gem_context_destroy(i915, ctx[0]); in isolation()
342 gem_vm_destroy(i915, vm[0]); in isolation()
345 static void async_destroy(int i915) in async_destroy() argument
348 .ctx_id = gem_context_create(i915), in async_destroy()
349 .value = gem_vm_create(i915), in async_destroy()
354 spin[0] = igt_spin_new(i915, in async_destroy()
359 gem_context_set_param(i915, &arg); in async_destroy()
360 spin[1] = __igt_spin_new(i915, .ctx = arg.ctx_id); in async_destroy()
363 gem_sync(i915, spin[0]->handle); in async_destroy()
365 gem_vm_destroy(i915, arg.value); in async_destroy()
366 gem_context_destroy(i915, arg.ctx_id); in async_destroy()
369 gem_sync(i915, spin[1]->handle); in async_destroy()
372 igt_spin_free(i915, spin[i]); in async_destroy()
377 int i915 = -1; variable
380 i915 = drm_open_driver(DRIVER_INTEL);
381 igt_require_gem(i915);
382 igt_require(has_vm(i915));
386 invalid_create(i915);
389 invalid_destroy(i915);
393 gem_context_require_param(i915, I915_CONTEXT_PARAM_VM);
397 execbuf(i915);
400 isolation(i915);
403 create_ext(i915);
406 async_destroy(i915);
410 close(i915);