Lines Matching refs:vgem
33 static void test_read(int vgem, int i915) in test_read() argument
43 vgem_create(vgem, &scratch); in test_read()
45 dmabuf = prime_handle_to_fd(vgem, scratch.handle); in test_read()
49 ptr = vgem_mmap(vgem, &scratch, PROT_WRITE); in test_read()
53 gem_close(vgem, scratch.handle); in test_read()
63 static void test_fence_read(int i915, int vgem) in test_fence_read() argument
78 vgem_create(vgem, &scratch); in test_fence_read()
80 dmabuf = prime_handle_to_fd(vgem, scratch.handle); in test_fence_read()
105 fence = vgem_fence_attach(vgem, &scratch, VGEM_FENCE_WRITE); in test_fence_read()
108 ptr = vgem_mmap(vgem, &scratch, PROT_WRITE); in test_fence_read()
112 vgem_fence_signal(vgem, fence); in test_fence_read()
113 gem_close(vgem, scratch.handle); in test_fence_read()
120 static void test_fence_mmap(int i915, int vgem) in test_fence_mmap() argument
135 vgem_create(vgem, &scratch); in test_fence_mmap()
137 dmabuf = prime_handle_to_fd(vgem, scratch.handle); in test_fence_mmap()
163 fence = vgem_fence_attach(vgem, &scratch, VGEM_FENCE_WRITE); in test_fence_mmap()
166 ptr = vgem_mmap(vgem, &scratch, PROT_WRITE); in test_fence_mmap()
170 vgem_fence_signal(vgem, fence); in test_fence_mmap()
171 gem_close(vgem, scratch.handle); in test_fence_mmap()
178 static void test_write(int vgem, int i915) in test_write() argument
188 vgem_create(vgem, &scratch); in test_write()
190 dmabuf = prime_handle_to_fd(vgem, scratch.handle); in test_write()
194 ptr = vgem_mmap(vgem, &scratch, PROT_READ); in test_write()
195 gem_close(vgem, scratch.handle); in test_write()
206 static void test_gtt(int vgem, int i915) in test_gtt() argument
216 vgem_create(vgem, &scratch); in test_gtt()
218 dmabuf = prime_handle_to_fd(vgem, scratch.handle); in test_gtt()
227 ptr = vgem_mmap(vgem, &scratch, PROT_READ | PROT_WRITE); in test_gtt()
240 gem_close(vgem, scratch.handle); in test_gtt()
243 static void test_shrink(int vgem, int i915) in test_shrink() argument
252 vgem_create(vgem, &scratch); in test_shrink()
254 dmabuf = prime_handle_to_fd(vgem, scratch.handle); in test_shrink()
255 gem_close(vgem, scratch.handle); in test_shrink()
281 static void test_gtt_interleaved(int vgem, int i915) in test_gtt_interleaved() argument
293 vgem_create(vgem, &scratch); in test_gtt_interleaved()
295 dmabuf = prime_handle_to_fd(vgem, scratch.handle); in test_gtt_interleaved()
308 ptr = vgem_mmap(vgem, &scratch, PROT_WRITE); in test_gtt_interleaved()
323 gem_close(vgem, scratch.handle); in test_gtt_interleaved()
427 static void test_busy(int i915, int vgem, unsigned ring, uint32_t flags) in test_busy() argument
438 vgem_create(vgem, &scratch); in test_busy()
439 dmabuf = prime_handle_to_fd(vgem, scratch.handle); in test_busy()
448 ptr = vgem_mmap(vgem, &scratch, PROT_READ); in test_busy()
453 gem_close(vgem, scratch.handle); in test_busy()
457 static void test_wait(int i915, int vgem, unsigned ring, uint32_t flags) in test_wait() argument
467 vgem_create(vgem, &scratch); in test_wait()
468 pfd.fd = prime_handle_to_fd(vgem, scratch.handle); in test_wait()
475 ptr = vgem_mmap(vgem, &scratch, PROT_READ); in test_wait()
480 gem_close(vgem, scratch.handle); in test_wait()
484 static void test_sync(int i915, int vgem, unsigned ring, uint32_t flags) in test_sync() argument
494 vgem_create(vgem, &scratch); in test_sync()
495 dmabuf = prime_handle_to_fd(vgem, scratch.handle); in test_sync()
499 gem_close(vgem, scratch.handle); in test_sync()
513 static void test_fence_wait(int i915, int vgem, unsigned ring, unsigned flags) in test_fence_wait() argument
523 vgem_create(vgem, &scratch); in test_fence_wait()
525 dmabuf = prime_handle_to_fd(vgem, scratch.handle); in test_fence_wait()
526 fence = vgem_fence_attach(vgem, &scratch, VGEM_FENCE_WRITE); in test_fence_wait()
528 gem_close(vgem, scratch.handle); in test_fence_wait()
543 vgem_fence_signal(vgem, fence); in test_fence_wait()
557 static void test_fence_hang(int i915, int vgem, unsigned flags) in test_fence_hang() argument
567 vgem_create(vgem, &scratch); in test_fence_hang()
568 dmabuf = prime_handle_to_fd(vgem, scratch.handle); in test_fence_hang()
569 vgem_fence_attach(vgem, &scratch, flags | WIP_VGEM_FENCE_NOTIMEOUT); in test_fence_hang()
573 gem_close(vgem, scratch.handle); in test_fence_hang()
692 static void flip_to_vgem(int i915, int vgem, in flip_to_vgem() argument
703 fence = vgem_fence_attach(vgem, bo, VGEM_FENCE_WRITE | hang); in flip_to_vgem()
724 vgem_fence_signal(vgem, fence); in flip_to_vgem()
746 static void test_flip(int i915, int vgem, unsigned hang) in test_flip() argument
773 vgem_create(vgem, &bo[i]); in test_flip()
775 fd = prime_handle_to_fd(vgem, bo[i].handle); in test_flip()
804 flip_to_vgem(i915, vgem, &bo[0], fb_id[0], crtc_id, hang, "front"); in test_flip()
807 flip_to_vgem(i915, vgem, &bo[1], fb_id[1], crtc_id, hang, "back"); in test_flip()
812 gem_close(vgem, bo[i].handle); in test_flip()
820 int vgem = -1; variable
823 vgem = drm_open_driver(DRIVER_VGEM);
824 igt_require(has_prime_export(vgem));
833 test_read(vgem, i915);
836 test_write(vgem, i915);
839 test_gtt(vgem, i915);
842 test_shrink(vgem, i915);
845 test_gtt_interleaved(vgem, i915);
855 test_sync(i915, vgem, e->exec_id, e->flags);
867 test_busy(i915, vgem, e->exec_id, e->flags);
879 test_wait(i915, vgem, e->exec_id, e->flags);
886 igt_require(vgem_has_fences(vgem));
890 test_fence_read(i915, vgem);
892 test_fence_mmap(i915, vgem);
902 test_fence_wait(i915, vgem, e->exec_id, e->flags);
907 test_flip(i915, vgem, 0);
911 igt_require(vgem_fence_has_flag(vgem, WIP_VGEM_FENCE_NOTIMEOUT));
915 test_fence_hang(i915, vgem, 0);
917 test_fence_hang(i915, vgem, VGEM_FENCE_WRITE);
920 test_flip(i915, vgem, WIP_VGEM_FENCE_NOTIMEOUT);
926 close(vgem);