From 019f892e5d1a0a9643cb726c47ce2d99c14b444f Mon Sep 17 00:00:00 2001 From: Andi Shyti Date: Fri, 5 Apr 2019 04:07:32 +0300 Subject: lib: ioctl_wrappers: reach engines by index as well With the new engine query method engines are reachable through an index and context they are combined with. The 'gem_has_ring()' becomes 'gem_context_has_engine()' that requires the index that the engine is mapped within the driver. The function has been moved from lib/ioctl_wappers to lib/i915/gem_context where it is more appropriate. The previous 'gem_has_ring()' function becomes a wrapper to the new 'gem_context_has_engine()'. Signed-off-by: Andi Shyti Reviewed-by: Chris Wilson Reviewed-by: Tvrtko Ursulin --- lib/ioctl_wrappers.c | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'lib/ioctl_wrappers.c') diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c index 39920f87..280fdd62 100644 --- a/lib/ioctl_wrappers.c +++ b/lib/ioctl_wrappers.c @@ -1252,25 +1252,6 @@ void igt_require_gem(int fd) igt_require_f(err == 0, "Unresponsive i915/GEM device\n"); } -bool gem_has_ring(int fd, unsigned ring) -{ - struct drm_i915_gem_execbuffer2 execbuf; - struct drm_i915_gem_exec_object2 exec; - - /* silly ABI, the kernel thinks everyone who has BSD also has BSD2 */ - if ((ring & ~(3<<13)) == I915_EXEC_BSD) { - if (ring & (3 << 13) && !gem_has_bsd2(fd)) - return false; - } - - memset(&exec, 0, sizeof(exec)); - memset(&execbuf, 0, sizeof(execbuf)); - execbuf.buffers_ptr = to_user_pointer(&exec); - execbuf.buffer_count = 1; - execbuf.flags = ring; - return __gem_execbuf(fd, &execbuf) == -ENOENT; -} - /** * gem_require_ring: * @fd: open i915 drm file descriptor -- cgit v1.2.3