diff options
author | Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> | 2021-01-11 11:22:54 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2021-01-11 22:51:06 +0000 |
commit | 2763c0977004bed596ee876c755b0768187ea9ab (patch) | |
tree | a7e31ba6751fd70b4df694e7f189cc18f7589e5f /tests/i915/gem_softpin.c | |
parent | 97a6f0b56ad9c4339be49a955671ebfc47b3133d (diff) |
lib/i915: Replace size to pointer to size in __gem_create()
Sometimes we're interested how much memory as allocated within the
i915 driver so we have to change function prototype/implementation
to the pointer to the size.
As __gem_create() has few users change is simple and non-intrusive.
Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Cc: 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 'tests/i915/gem_softpin.c')
-rw-r--r-- | tests/i915/gem_softpin.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/tests/i915/gem_softpin.c b/tests/i915/gem_softpin.c index 516accc8..b2514c99 100644 --- a/tests/i915/gem_softpin.c +++ b/tests/i915/gem_softpin.c @@ -102,19 +102,12 @@ static void test_invalid(int fd) static uint32_t batch_create(int i915, uint64_t *sz) { const uint32_t bbe = MI_BATCH_BUFFER_END; - struct drm_i915_gem_create create = { - .size = sizeof(bbe), - }; - - if (igt_ioctl(i915, DRM_IOCTL_I915_GEM_CREATE, &create)) { - igt_assert_eq(errno, 0); - return 0; - } + uint32_t handle; - gem_write(i915, create.handle, 0, &bbe, sizeof(bbe)); + igt_assert_eq(__gem_create(i915, sz, &handle), 0); + gem_write(i915, handle, 0, &bbe, sizeof(bbe)); - *sz = create.size; - return create.handle; + return handle; } static void test_zero(int i915) |