diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-11-29 14:59:57 +0100 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-11-29 14:59:57 +0100 |
commit | 64f669f7a94d459437a4dd47142ef2bb9870c5e6 (patch) | |
tree | 1909c2f70746be602da9541dd3691e21c1bbca66 /tests | |
parent | d79414f64a599e5ec35f5e865a5e24858602d186 (diff) |
lib: extract get_render_copyfunc
Otherwise we won't update all the tests if we add new render
copyfuncs.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/gem_ctx_basic.c | 4 | ||||
-rw-r--r-- | tests/gem_ringfill.c | 8 | ||||
-rw-r--r-- | tests/gem_stress.c | 25 |
3 files changed, 9 insertions, 28 deletions
diff --git a/tests/gem_ctx_basic.c b/tests/gem_ctx_basic.c index 632651ae..3757d847 100644 --- a/tests/gem_ctx_basic.c +++ b/tests/gem_ctx_basic.c @@ -58,6 +58,7 @@ static void init_buffer(drm_intel_bufmgr *bufmgr, static void *work(void *arg) { struct intel_batchbuffer *batch; + render_copyfunc_t rendercopy = get_render_copyfunc(devid); drm_intel_context *context; drm_intel_bufmgr *bufmgr; int thread_id = *(int *)arg; @@ -88,7 +89,8 @@ static void *work(void *arg) if (uncontexted) { - gen6_render_copyfunc(batch, &src, 0, 0, 0, 0, &dst, 0, 0); + assert(rendercopy); + rendercopy(batch, &src, 0, 0, 0, 0, &dst, 0, 0); } else { int ret; ret = drm_intel_bo_subdata(batch->bo, 0, 4096, batch->buffer); diff --git a/tests/gem_ringfill.c b/tests/gem_ringfill.c index 9f711ab3..948630b9 100644 --- a/tests/gem_ringfill.c +++ b/tests/gem_ringfill.c @@ -219,13 +219,7 @@ int main(int argc, char **argv) /* Strictly only required on architectures with a separate BLT ring, * but lets stress everybody. */ - copy = NULL; - if (IS_GEN2(batch->devid)) - copy = gen2_render_copyfunc; - else if (IS_GEN3(batch->devid)) - copy = gen3_render_copyfunc; - else if (IS_GEN6(batch->devid)) - copy = gen6_render_copyfunc; + copy = get_render_copyfunc(batch->devid); if (drmtest_run_subtest("render") && copy) fails += check_ring(bufmgr, batch, "render", copy); diff --git a/tests/gem_stress.c b/tests/gem_stress.c index 69239ac1..be306c53 100644 --- a/tests/gem_stress.c +++ b/tests/gem_stress.c @@ -323,31 +323,16 @@ static void render_copyfunc(struct scratch_buf *src, unsigned src_x, unsigned sr unsigned logical_tile_no) { static unsigned keep_gpu_busy_counter = 0; + render_copyfunc_t rendercopy = get_render_copyfunc(devid); /* check both edges of the fence usage */ if (keep_gpu_busy_counter & 1) keep_gpu_busy(); - if (IS_GEN2(devid)) - gen2_render_copyfunc(batch, - src, src_x, src_y, - options.tile_size, options.tile_size, - dst, dst_x, dst_y); - else if (IS_GEN3(devid)) - gen3_render_copyfunc(batch, - src, src_x, src_y, - options.tile_size, options.tile_size, - dst, dst_x, dst_y); - else if (IS_GEN6(devid)) - gen6_render_copyfunc(batch, - src, src_x, src_y, - options.tile_size, options.tile_size, - dst, dst_x, dst_y); - else if (IS_GEN7(devid)) - gen7_render_copyfunc(batch, - src, src_x, src_y, - options.tile_size, options.tile_size, - dst, dst_x, dst_y); + if (rendercopy) + rendercopy(batch, src, src_x, src_y, + options.tile_size, options.tile_size, + dst, dst_x, dst_y); else blitter_copyfunc(src, src_x, src_y, dst, dst_x, dst_y, |