From: Daniel Vetter Date: Tue, 17 Jan 2012 23:34:15 +0000 (+0100) Subject: gem_stress: add buf->size X-Git-Tag: 1.2~40 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=205510badf00f82c0dc069ca15c5016a6fe18a60;p=profile%2Fextras%2Fintel-gpu-tools.git gem_stress: add buf->size Removes a dependency on gem_stress internals from the rendercpy functions. Signed-off-by: Daniel Vetter --- diff --git a/tests/gem_stress.c b/tests/gem_stress.c index 7f93964..ea97780 100644 --- a/tests/gem_stress.c +++ b/tests/gem_stress.c @@ -413,10 +413,10 @@ static void sanitize_stride(struct scratch_buf *buf) { if (buf_height(buf) > options.max_dimension) - buf->stride = options.scratch_buf_size / options.max_dimension; + buf->stride = buf->size / options.max_dimension; if (buf_height(buf) < options.tile_size) - buf->stride = options.scratch_buf_size / options.tile_size; + buf->stride = buf->size / options.tile_size; if (buf_width(buf) < options.tile_size) buf->stride = options.tile_size * sizeof(uint32_t); @@ -433,6 +433,7 @@ static void sanitize_stride(struct scratch_buf *buf) static void init_buffer(struct scratch_buf *buf, unsigned size) { buf->bo = drm_intel_bo_alloc(bufmgr, "tiled bo", size, 4096); + buf->size = size; assert(buf->bo); buf->tiling = I915_TILING_NONE; buf->stride = 4096; diff --git a/tests/gem_stress.h b/tests/gem_stress.h index f44773d..0905a1b 100644 --- a/tests/gem_stress.h +++ b/tests/gem_stress.h @@ -22,6 +22,7 @@ struct scratch_buf { uint32_t tiling; uint32_t *data; uint32_t *cpu_mapping; + uint32_t size; unsigned num_tiles; }; @@ -86,7 +87,7 @@ static inline unsigned buf_width(struct scratch_buf *buf) static inline unsigned buf_height(struct scratch_buf *buf) { - return options.scratch_buf_size/buf->stride; + return buf->size/buf->stride; } void gen6_render_copyfunc(struct scratch_buf *src, unsigned src_x, unsigned src_y,