summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2012-01-10 16:10:48 +0100
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-01-10 16:10:48 +0100
commit08cd2f220ee84e51917cc76c19998b12b6d50407 (patch)
tree11f240babbce410a4ac37ebfec67b89f4ac82f84 /tests
parent673e6b220a34fb7600cbf272bc46a4ac1ca08905 (diff)
tests: use the gem_write wrapper some more
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'tests')
-rw-r--r--tests/gem_fenced_exec_thrash.c8
-rw-r--r--tests/gem_largeobject.c13
2 files changed, 2 insertions, 19 deletions
diff --git a/tests/gem_fenced_exec_thrash.c b/tests/gem_fenced_exec_thrash.c
index 2c1d0702..31936b79 100644
--- a/tests/gem_fenced_exec_thrash.c
+++ b/tests/gem_fenced_exec_thrash.c
@@ -85,7 +85,6 @@ static uint32_t
batch_create (int fd)
{
struct drm_i915_gem_create create;
- struct drm_i915_gem_pwrite pwrite;
uint32_t buf[] = { MI_BATCH_BUFFER_END, 0 };
int ret;
@@ -94,12 +93,7 @@ batch_create (int fd)
ret = ioctl(fd, DRM_IOCTL_I915_GEM_CREATE, &create);
assert(ret == 0);
- pwrite.handle = create.handle;
- pwrite.offset = 0;
- pwrite.size = sizeof(buf);
- pwrite.data_ptr = (uintptr_t)buf;
- ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_PWRITE, &pwrite);
- assert(ret == 0);
+ gem_write(fd, create.handle, 0, buf, sizeof(buf));
return create.handle;
}
diff --git a/tests/gem_largeobject.c b/tests/gem_largeobject.c
index bf59c844..721a1742 100644
--- a/tests/gem_largeobject.c
+++ b/tests/gem_largeobject.c
@@ -57,13 +57,11 @@ static void
test_large_object(int fd)
{
struct drm_i915_gem_create create;
- struct drm_i915_gem_pwrite pwrite;
struct drm_i915_gem_pin pin;
uint32_t obj_size;
int ret;
memset(&create, 0, sizeof(create));
- memset(&pwrite, 0, sizeof(pwrite));
memset(&pin, 0, sizeof(pin));
if (gem_aperture_size(fd)*3/4 < OBJ_SIZE/2)
@@ -90,16 +88,7 @@ test_large_object(int fd)
exit(ret);
}
- pwrite.handle = create.handle;
- pwrite.size = obj_size;
- pwrite.data_ptr = (uintptr_t)data;
-
- ret = ioctl(fd, DRM_IOCTL_I915_GEM_PWRITE, &pwrite);
- if (ret) {
- fprintf(stderr, "pwrite failed: %s\n",
- strerror(errno));
- exit(ret);
- }
+ gem_write(fd, create.handle, 0, data, obj_size);
/* kernel should clean this up for us */
}