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>
This commit is contained in:
Daniel Vetter
2012-01-10 15:31:11 +01:00
parent 5dd17d3f4b
commit 319638ba6d
19 changed files with 29 additions and 252 deletions
-13
View File
@@ -95,19 +95,6 @@ static void *gem_mmap(int fd, uint32_t handle, int size, int prot)
return ptr;
}
static int gem_write(int fd,
uint32_t handle, uint32_t offset,
const void *src, int length)
{
struct drm_i915_gem_pwrite pwrite;
pwrite.handle = handle;
pwrite.offset = offset;
pwrite.size = length;
pwrite.data_ptr = (uintptr_t)src;
return drmIoctl(fd, DRM_IOCTL_I915_GEM_PWRITE, &pwrite);
}
static void
gem_read(int fd, uint32_t handle, int offset, int length, void *buf)
{