summaryrefslogtreecommitdiff
path: root/tests/gen3_mixed_blits.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2012-01-10 15:31:11 +0100
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-01-10 15:31:11 +0100
commit319638ba6d38c25be0f6dadbab3f5855083234a1 (patch)
treec779bc7fd8b914513f02ce3fa98be9c51724d02d /tests/gen3_mixed_blits.c
parent5dd17d3f4bddb075f3fb6fbcd1b6c271f7b746a7 (diff)
lib/drmtest: extract gem_write
Astonishing how many different function signatures are possible for something that simple. Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'tests/gen3_mixed_blits.c')
-rw-r--r--tests/gen3_mixed_blits.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/tests/gen3_mixed_blits.c b/tests/gen3_mixed_blits.c
index 4f868201..637b8a22 100644
--- a/tests/gen3_mixed_blits.c
+++ b/tests/gen3_mixed_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 uint32_t fill_reloc(struct drm_i915_gem_relocation_entry *reloc,
uint32_t offset,
uint32_t handle,
@@ -306,7 +292,7 @@ render_copy(int fd,
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);
@@ -387,7 +373,7 @@ static void blt_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);