diff options
author | Andrzej Turko <andrzej.turko@linux.intel.com> | 2021-01-11 11:17:50 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2021-01-11 11:51:48 +0000 |
commit | 97a6f0b56ad9c4339be49a955671ebfc47b3133d (patch) | |
tree | 5235230793c120339e644526733ab2f942dce7d2 /lib/ioctl_wrappers.c | |
parent | 65c5eea699141e6f942ce0a8fc85db76ce53cd19 (diff) |
lib/i915: Split gem_create.c from ioctl_wrappers.c
In preparation for a variation on the exisiting GEM_CREATE API, split
the ioctl from out of the large ioctl_wrappers.c
Signed-off-by: Andrzej Turko <andrzej.turko@linux.intel.com>
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 | 38 |
1 files changed, 1 insertions, 37 deletions
diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c index a928f894..45415621 100644 --- a/lib/ioctl_wrappers.c +++ b/lib/ioctl_wrappers.c @@ -49,6 +49,7 @@ #include "drmtest.h" #include "i915_drm.h" +#include "i915/gem.h" #include "intel_batchbuffer.h" #include "intel_chipset.h" #include "intel_io.h" @@ -469,43 +470,6 @@ void gem_sync(int fd, uint32_t handle) errno = 0; } -int __gem_create(int fd, uint64_t size, uint32_t *handle) -{ - struct drm_i915_gem_create create = { - .size = size, - }; - int err = 0; - - if (igt_ioctl(fd, DRM_IOCTL_I915_GEM_CREATE, &create) == 0) { - *handle = create.handle; - } else { - err = -errno; - igt_assume(err != 0); - } - - errno = 0; - return err; -} - -/** - * gem_create: - * @fd: open i915 drm file descriptor - * @size: desired size of the buffer - * - * This wraps the GEM_CREATE ioctl, which allocates a new gem buffer object of - * @size. - * - * Returns: The file-private handle of the created buffer object - */ -uint32_t gem_create(int fd, uint64_t size) -{ - uint32_t handle; - - igt_assert_eq(__gem_create(fd, size, &handle), 0); - - return handle; -} - /** * __gem_execbuf: * @fd: open i915 drm file descriptor |