mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2026-08-23 06:13:04 +00:00
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:
@@ -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,
|
||||
@@ -293,7 +279,7 @@ 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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user