summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2018-01-17 11:45:30 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2018-01-17 12:38:59 +0000
commit319a1de94c363863d70b1ec8950d55894a903cbb (patch)
treed3ddd0e52ab40de3b7d000f1c0f168e602201f94 /tests
parent4ebf6877926d35c27738d79b127e93c1d1cee5d5 (diff)
igt/gem_tiled_fence_blits: Allocate bo array
As we allow more buffers to be allocated to fill larger apertures, we may exceed the static allocation of 4096 buffers. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104669 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/gem_tiled_fence_blits.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/tests/gem_tiled_fence_blits.c b/tests/gem_tiled_fence_blits.c
index 51f672fd..693e96ce 100644
--- a/tests/gem_tiled_fence_blits.c
+++ b/tests/gem_tiled_fence_blits.c
@@ -98,16 +98,20 @@ check_bo(int fd, drm_intel_bo *bo, uint32_t start_val)
}
}
-static void run_test (int fd, int count)
+static void run_test(int fd, int count)
{
- 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;
count |= 1;
igt_info("Using %d 1MiB buffers\n", count);
+ bo = malloc(count * sizeof(*bo));
+ bo_start_val = malloc(count * sizeof(*bo_start_val));
+ igt_assert(bo && bo_start_val);
+
bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
drm_intel_bufmgr_gem_enable_reuse(bufmgr);
batch = intel_batchbuffer_alloc(bufmgr, intel_get_drm_devid(fd));
@@ -158,6 +162,9 @@ static void run_test (int fd, int count)
intel_batchbuffer_free(batch);
drm_intel_bufmgr_destroy(bufmgr);
+
+ free(bo_start_val);
+ free(bo);
}
#define MAX_32b ((1ull << 32) - 4096)