diff options
author | Matthew Auld <matthew.auld@intel.com> | 2020-06-03 11:07:51 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2020-06-03 12:29:10 +0100 |
commit | a9b6c4c74bfddf7d3d2da3be08804fe315945cea (patch) | |
tree | 7cbe2fe04d2a329d5e74f5cf12c17f85aa120207 /lib/ioctl_wrappers.c | |
parent | c7b786f02ed942d9cdc1570c4ffbd42e5e90ab3e (diff) |
i915: purge i915_gem_create_v2
The gem_create_v2 uapi was never merged, which would have been a nice
addition to allow userspace to utilise stolen memory. Since it can only
get in the way at this point, let's just remove it.
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'lib/ioctl_wrappers.c')
-rw-r--r-- | lib/ioctl_wrappers.c | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c index 61f93bd8c..3781286d8 100644 --- a/lib/ioctl_wrappers.c +++ b/lib/ioctl_wrappers.c @@ -469,76 +469,6 @@ void gem_sync(int fd, uint32_t handle) errno = 0; } - -bool gem_create__has_stolen_support(int fd) -{ - int has_stolen_support; - struct drm_i915_getparam gp; - int val = -1; - - memset(&gp, 0, sizeof(gp)); - gp.param = 38; /* CREATE_VERSION */ - gp.value = &val; - - /* Do we have the extended gem_create_ioctl? */ - ioctl(fd, DRM_IOCTL_I915_GETPARAM, &gp); - has_stolen_support = val >= 2; - - return has_stolen_support; -} - -struct local_i915_gem_create_v2 { - uint64_t size; - uint32_t handle; - uint32_t pad; -#define I915_CREATE_PLACEMENT_STOLEN (1<<0) - uint32_t flags; -}; - -#define LOCAL_IOCTL_I915_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_CREATE, struct local_i915_gem_create_v2) -uint32_t __gem_create_stolen(int fd, uint64_t size) -{ - struct local_i915_gem_create_v2 create; - int ret; - - memset(&create, 0, sizeof(create)); - create.handle = 0; - create.size = size; - create.flags = I915_CREATE_PLACEMENT_STOLEN; - ret = igt_ioctl(fd, LOCAL_IOCTL_I915_GEM_CREATE, &create); - - if (ret < 0) - return 0; - - errno = 0; - return create.handle; -} - -/** - * gem_create_stolen: - * @fd: open i915 drm file descriptor - * @size: desired size of the buffer - * - * This wraps the new GEM_CREATE ioctl, which allocates a new gem buffer - * object of @size and placement in stolen memory region. - * - * Returns: The file-private handle of the created buffer object - */ - -uint32_t gem_create_stolen(int fd, uint64_t size) -{ - struct local_i915_gem_create_v2 create; - - memset(&create, 0, sizeof(create)); - create.handle = 0; - create.size = size; - create.flags = I915_CREATE_PLACEMENT_STOLEN; - do_ioctl(fd, LOCAL_IOCTL_I915_GEM_CREATE, &create); - igt_assert(create.handle); - - return create.handle; -} - int __gem_create(int fd, uint64_t size, uint32_t *handle) { struct drm_i915_gem_create create = { |