summaryrefslogtreecommitdiff
path: root/tests/gem_tiled_blits.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-02-06 10:18:53 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2011-02-06 10:18:53 +0000
commitc91951de0e7b412fa02facf349c8912348cb1aa4 (patch)
tree877771ae9185551daf3f7c295f5b5549c9d6f074 /tests/gem_tiled_blits.c
parent0995b563341c9e34f4b6314c67d4671a516fb1b0 (diff)
gem_linear_blits,gem_tiled_blits: Add optional count
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests/gem_tiled_blits.c')
-rw-r--r--tests/gem_tiled_blits.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/tests/gem_tiled_blits.c b/tests/gem_tiled_blits.c
index 84b66cb9..54b2d400 100644
--- a/tests/gem_tiled_blits.c
+++ b/tests/gem_tiled_blits.c
@@ -130,17 +130,24 @@ check_bo(drm_intel_bo *bo, uint32_t start_val)
int main(int argc, char **argv)
{
- drm_intel_bo *bo[4096];
- uint32_t bo_start_val[4096];
+ drm_intel_bo **bo;
+ uint32_t *bo_start_val;
uint32_t start = 0;
int i, fd, count;
fd = drm_open_any();
- count = 3 * gem_aperture_size(fd) / (1024*1024) / 2;
- count += (count & 1) == 0;
+ count = 0;
+ if (argc > 1)
+ count = atoi(argv[1]);
+ if (count == 0) {
+ count = 3 * gem_aperture_size(fd) / (1024*1024) / 2;
+ count += (count & 1) == 0;
+ }
printf("Using %d 1MiB buffers\n", count);
- assert(count <= 4096);
+
+ bo = malloc(sizeof(drm_intel_bo *)*count);
+ bo_start_val = malloc(sizeof(uint32_t)*count);
bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
drm_intel_bufmgr_gem_enable_reuse(bufmgr);