From 319638ba6d38c25be0f6dadbab3f5855083234a1 Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Tue, 10 Jan 2012 15:31:11 +0100 Subject: lib/drmtest: extract gem_write Astonishing how many different function signatures are possible for something that simple. Signed-Off-by: Daniel Vetter --- tests/gen3_render_linear_blits.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'tests/gen3_render_linear_blits.c') diff --git a/tests/gen3_render_linear_blits.c b/tests/gen3_render_linear_blits.c index 209029f4..79fe9d0a 100644 --- a/tests/gen3_render_linear_blits.c +++ b/tests/gen3_render_linear_blits.c @@ -87,20 +87,6 @@ gem_aperture_size(int fd) return aperture.aper_size; } -static void -gem_write(int fd, uint32_t handle, int offset, int size, const void *buf) -{ - struct drm_i915_gem_pwrite pwrite; - int ret; - - pwrite.handle = handle; - pwrite.offset = offset; - pwrite.size = size; - pwrite.data_ptr = (uintptr_t)buf; - ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_PWRITE, &pwrite); - assert(ret == 0); -} - static void gem_read(int fd, uint32_t handle, int offset, int size, void *buf) { @@ -293,7 +279,7 @@ copy(int fd, uint32_t dst, uint32_t src) assert(b - batch <= 1024); handle = gem_create(fd, 4096); - gem_write(fd, handle, 0, (b-batch)*sizeof(batch[0]), batch); + gem_write(fd, handle, 0, batch, (b-batch)*sizeof(batch[0])); assert(r-reloc == 2); @@ -354,7 +340,7 @@ create_bo(int fd, uint32_t val) /* Fill the BO with dwords starting at val */ for (i = 0; i < WIDTH*HEIGHT; i++) linear[i] = val++; - gem_write(fd, handle, 0, sizeof(linear), linear); + gem_write(fd, handle, 0, linear, sizeof(linear)); return handle; } -- cgit v1.2.3