• Home
  • Raw
  • Download

Lines Matching refs:i915

33 static void test_read(int vgem, int i915)  in test_read()  argument
46 handle = prime_fd_to_handle(i915, dmabuf); in test_read()
57 gem_read(i915, handle, 4096*i, &tmp, sizeof(tmp)); in test_read()
60 gem_close(i915, handle); in test_read()
63 static void test_fence_read(int i915, int vgem) in test_fence_read() argument
81 handle = prime_fd_to_handle(i915, dmabuf); in test_fence_read()
89 gem_read(i915, handle, 4096*i, &tmp, sizeof(tmp)); in test_fence_read()
96 gem_read(i915, handle, 4096*i, &tmp, sizeof(tmp)); in test_fence_read()
99 gem_close(i915, handle); in test_fence_read()
120 static void test_fence_mmap(int i915, int vgem) in test_fence_mmap() argument
138 handle = prime_fd_to_handle(i915, dmabuf); in test_fence_mmap()
144 ptr = gem_mmap__gtt(i915, handle, 4096*1024, PROT_READ); in test_fence_mmap()
146 gem_set_domain(i915, handle, I915_GEM_DOMAIN_GTT, 0); in test_fence_mmap()
153 gem_set_domain(i915, handle, I915_GEM_DOMAIN_GTT, 0); in test_fence_mmap()
157 gem_close(i915, handle); in test_fence_mmap()
178 static void test_write(int vgem, int i915) in test_write() argument
191 handle = prime_fd_to_handle(i915, dmabuf); in test_write()
198 gem_write(i915, handle, 4096*i, &i, sizeof(i)); in test_write()
199 gem_close(i915, handle); in test_write()
206 static void test_gtt(int vgem, int i915) in test_gtt() argument
219 handle = prime_fd_to_handle(i915, dmabuf); in test_gtt()
222 ptr = gem_mmap__gtt(i915, handle, scratch.size, PROT_WRITE); in test_gtt()
234 ptr = gem_mmap__gtt(i915, handle, scratch.size, PROT_READ); in test_gtt()
239 gem_close(i915, handle); in test_gtt()
243 static void test_shrink(int vgem, int i915) in test_shrink() argument
257 scratch.handle = prime_fd_to_handle(i915, dmabuf); in test_shrink()
261 gem_set_domain(i915, scratch.handle, I915_GEM_DOMAIN_GTT, 0); in test_shrink()
264 igt_drop_caches_set(i915, DROP_SHRINK_ALL); in test_shrink()
266 gem_close(i915, scratch.handle); in test_shrink()
269 static bool is_coherent(int i915) in is_coherent() argument
277 ioctl(i915, DRM_IOCTL_I915_GETPARAM, &gp); in is_coherent()
281 static void test_gtt_interleaved(int vgem, int i915) in test_gtt_interleaved() argument
288 igt_require(is_coherent(i915)); in test_gtt_interleaved()
296 handle = prime_fd_to_handle(i915, dmabuf); in test_gtt_interleaved()
309 gtt = gem_mmap__gtt(i915, handle, scratch.size, PROT_WRITE); in test_gtt_interleaved()
322 gem_close(i915, handle); in test_gtt_interleaved()
332 static void work(int i915, int dmabuf, unsigned ring, uint32_t flags) in work() argument
336 const int gen = intel_gen(intel_get_drm_devid(i915)); in work()
353 obj[SCRATCH].handle = prime_fd_to_handle(i915, dmabuf); in work()
355 obj[BATCH].handle = gem_create(i915, size); in work()
360 batch = gem_mmap__wc(i915, obj[BATCH].handle, 0, size, PROT_WRITE); in work()
361 gem_set_domain(i915, obj[BATCH].handle, in work()
413 igt_require(__gem_execbuf(i915, &execbuf) == 0); in work()
414 gem_close(i915, obj[BATCH].handle); in work()
415 gem_close(i915, obj[SCRATCH].handle); in work()
427 static void test_busy(int i915, int vgem, unsigned ring, uint32_t flags) in test_busy() argument
441 work(i915, dmabuf, ring, flags); in test_busy()
457 static void test_wait(int i915, int vgem, unsigned ring, uint32_t flags) in test_wait() argument
470 work(i915, pfd.fd, ring, flags); in test_wait()
484 static void test_sync(int i915, int vgem, unsigned ring, uint32_t flags) in test_sync() argument
501 work(i915, dmabuf, ring, flags); in test_sync()
513 static void test_fence_wait(int i915, int vgem, unsigned ring, unsigned flags) in test_fence_wait() argument
534 work(i915, dmabuf, ring, flags); in test_fence_wait()
557 static void test_fence_hang(int i915, int vgem, unsigned flags) in test_fence_hang() argument
575 work(i915, dmabuf, I915_EXEC_DEFAULT, 0); in test_fence_hang()
692 static void flip_to_vgem(int i915, int vgem, in flip_to_vgem() argument
699 struct pollfd pfd = { i915, POLLIN }; in flip_to_vgem()
707 do_or_die(drmModePageFlip(i915, crtc_id, fb_id, in flip_to_vgem()
713 get_vblank(i915, 0, DRM_VBLANK_NEXTONMISS); in flip_to_vgem()
723 get_vblank(i915, 0, DRM_VBLANK_NEXTONMISS); in flip_to_vgem()
728 get_vblank(i915, 0, DRM_VBLANK_NEXTONMISS); in flip_to_vgem()
742 igt_assert_eq(read(i915, &vbl, sizeof(vbl)), sizeof(vbl)); in flip_to_vgem()
746 static void test_flip(int i915, int vgem, unsigned hang) in test_flip() argument
755 igt_display_require(&display, i915); in test_flip()
776 handle[i] = prime_fd_to_handle(i915, fd); in test_flip()
783 igt_require(__kms_addfb(i915, handle[i], in test_flip()
792 igt_require((crtc_id = set_fb_on_crtc(i915, 0, &bo[0], fb_id[0]))); in test_flip()
798 do_or_die(drmModePageFlip(i915, crtc_id, fb_id[i], in test_flip()
800 igt_assert_eq(read(i915, &vbl, sizeof(vbl)), sizeof(vbl)); 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()
810 do_or_die(drmModeRmFB(i915, fb_id[i])); in test_flip()
811 gem_close(i915, handle[i]); in test_flip()
819 int i915 = -1; variable
826 i915 = drm_open_driver_master(DRIVER_INTEL);
827 igt_require_gem(i915);
828 igt_require(has_prime_import(i915));
829 gem_require_mmap_wc(i915);
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);
851 gem_require_ring(i915, e->exec_id | e->flags);
852 igt_require(gem_can_store_dword(i915, e->exec_id | e->flags));
854 gem_quiescent_gpu(i915);
855 test_sync(i915, vgem, e->exec_id, e->flags);
863 gem_require_ring(i915, e->exec_id | e->flags);
864 igt_require(gem_can_store_dword(i915, e->exec_id | e->flags));
866 gem_quiescent_gpu(i915);
867 test_busy(i915, vgem, e->exec_id, e->flags);
875 gem_require_ring(i915, e->exec_id | e->flags);
876 igt_require(gem_can_store_dword(i915, e->exec_id | e->flags));
878 gem_quiescent_gpu(i915);
879 test_wait(i915, vgem, e->exec_id, e->flags);
890 test_fence_read(i915, vgem);
892 test_fence_mmap(i915, vgem);
898 gem_require_ring(i915, e->exec_id | e->flags);
899 igt_require(gem_can_store_dword(i915, e->exec_id | e->flags));
901 gem_quiescent_gpu(i915);
902 test_fence_wait(i915, vgem, e->exec_id, e->flags);
907 test_flip(i915, vgem, 0);
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);
925 close(i915);