diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-06-05 21:53:49 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-06-05 22:21:54 +0100 |
commit | 3d66d913d9165f59e39952a41b41461b2329c9c1 (patch) | |
tree | 96f35f9ba382f44aa9ff77db1924a66cfcfd1e3e /tests | |
parent | 2933547eb0d22cb70c783a78ab3d7b4dcc5972ce (diff) |
gem_stress: trim buffer sizes to fit into 3D pipeline
Remember the 3D pipeline is much more restricted than the BLT engine,
and we were feeding it buffers much larger than either the
render engine or the sampler could manager.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/gem_stress.c | 20 | ||||
-rw-r--r-- | tests/gem_stress.h | 1 |
2 files changed, 19 insertions, 2 deletions
diff --git a/tests/gem_stress.c b/tests/gem_stress.c index 226970ca..b5732bab 100644 --- a/tests/gem_stress.c +++ b/tests/gem_stress.c @@ -512,7 +512,12 @@ static void init_set(unsigned set) r %= 5; buffers[set][i].stride = 512 * (1 << r); } + + if (options.scratch_buf_size / buffers[set][i].stride > options.max_dimension) + buffers[set][i].stride = options.scratch_buf_size / options.max_dimension; assert(buffers[set][i].stride <= 8192); + assert(buf_width(&buffers[set][i]) <= options.max_dimension); + assert(buf_height(&buffers[set][i]) <= options.max_dimension); set_tiling(buffers[set][i].bo, &buffers[set][i].tiling, @@ -693,6 +698,16 @@ static void parse_options(int argc, char **argv) if (optind < argc) printf("unkown command options\n"); + + options.max_dimension = 32767; + if (options.use_render) { + if (IS_GEN2(devid) || IS_GEN3(devid)) + options.max_dimension = 2048; + else + options.max_dimension = 8192; + } + printf("Limiting buffer to %dx%d\n", + options.max_dimension, options.max_dimension); } static void init(void) @@ -700,7 +715,6 @@ static void init(void) int i; unsigned tmp; - drm_fd = drm_open_any(); if (options.num_buffers == 0) { tmp = gem_aperture_size(drm_fd); tmp = tmp > 256*(1024*1024) ? 256*(1024*1024) : tmp; @@ -713,7 +727,6 @@ static void init(void) bufmgr = drm_intel_bufmgr_gem_init(drm_fd, 4096); drm_intel_bufmgr_gem_enable_reuse(bufmgr); drm_intel_bufmgr_gem_enable_fenced_relocs(bufmgr); - devid = intel_get_drm_devid(drm_fd); num_fences = get_num_fences(); batch = intel_batchbuffer_alloc(bufmgr, devid); @@ -783,6 +796,9 @@ int main(int argc, char **argv) int i, j; unsigned *current_permutation, *tmp_permutation; + drm_fd = drm_open_any(); + devid = intel_get_drm_devid(drm_fd); + parse_options(argc, argv); init(); diff --git a/tests/gem_stress.h b/tests/gem_stress.h index 8c15782b..3b1d456a 100644 --- a/tests/gem_stress.h +++ b/tests/gem_stress.h @@ -27,6 +27,7 @@ struct scratch_buf { struct option_struct { unsigned scratch_buf_size; + unsigned max_dimension; unsigned num_buffers; int trace_tile; int no_hw; |