summaryrefslogtreecommitdiff
path: root/tests/gen3_render_linear_blits.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2012-01-10 15:37:53 +0100
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-01-10 15:37:53 +0100
commitbd5cf9a07d17ce91dfaa3aa12d3f2c93815f0489 (patch)
tree2af15a28d9439f557ec696f99bf3af474dd9f764 /tests/gen3_render_linear_blits.c
parent319638ba6d38c25be0f6dadbab3f5855083234a1 (diff)
lib/drmtest: extract gem_read
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'tests/gen3_render_linear_blits.c')
-rw-r--r--tests/gen3_render_linear_blits.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/tests/gen3_render_linear_blits.c b/tests/gen3_render_linear_blits.c
index 79fe9d0a..a7d16826 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_read(int fd, uint32_t handle, int offset, int size, void *buf)
-{
- struct drm_i915_gem_pread pread;
- int ret;
-
- pread.handle = handle;
- pread.offset = offset;
- pread.size = size;
- pread.data_ptr = (uintptr_t)buf;
- ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_PREAD, &pread);
- assert(ret == 0);
-}
-
static uint32_t fill_reloc(struct drm_i915_gem_relocation_entry *reloc,
uint32_t offset,
uint32_t handle,
@@ -350,7 +336,7 @@ check_bo(int fd, uint32_t handle, uint32_t val)
{
int i;
- gem_read(fd, handle, 0, sizeof(linear), linear);
+ gem_read(fd, handle, 0, linear, sizeof(linear));
for (i = 0; i < WIDTH*HEIGHT; i++) {
if (linear[i] != val) {
fprintf(stderr, "Expected 0x%08x, found 0x%08x "