mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2026-08-21 05:13:47 +00:00
lib/drmtest: extract gem_set_tiling
Way too much copy-pasting going on here. Also fix a compiler warnings in gem_stress while fixup things up. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
+1
-16
@@ -103,21 +103,6 @@ gem_read(int fd, uint32_t handle, int offset, int length, void *buf)
|
||||
assert(ret == 0);
|
||||
}
|
||||
|
||||
static void
|
||||
gem_set_tiling(int fd, uint32_t handle, int tiling)
|
||||
{
|
||||
struct drm_i915_gem_set_tiling set_tiling;
|
||||
int ret;
|
||||
|
||||
do {
|
||||
set_tiling.handle = handle;
|
||||
set_tiling.tiling_mode = tiling;
|
||||
set_tiling.stride = WIDTH * sizeof(uint32_t);
|
||||
|
||||
ret = ioctl(fd, DRM_IOCTL_I915_GEM_SET_TILING, &set_tiling);
|
||||
} while (ret == -1 && (errno == EINTR || errno == EAGAIN));
|
||||
}
|
||||
|
||||
static void
|
||||
gem_get_tiling(int fd, uint32_t handle, uint32_t *tiling, uint32_t *swizzle)
|
||||
{
|
||||
@@ -142,7 +127,7 @@ create_bo(int fd)
|
||||
int i;
|
||||
|
||||
handle = gem_create(fd, sizeof(linear));
|
||||
gem_set_tiling(fd, handle, I915_TILING_X);
|
||||
gem_set_tiling(fd, handle, I915_TILING_X, WIDTH * sizeof(uint32_t));
|
||||
|
||||
/* Fill the BO with dwords starting at start_val */
|
||||
data = gem_mmap(fd, handle, sizeof(linear), PROT_READ | PROT_WRITE);
|
||||
|
||||
Reference in New Issue
Block a user