summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-10-10 11:15:22 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2016-10-10 11:17:46 +0100
commit3dfa47c1a996b32869caae98f2909850b2635481 (patch)
treed669980f85e16a38a1cb94ae24cde080de031308 /tests
parente88caecc21119d35c035020756923b6e02503d48 (diff)
igt/gem_ctx_thrash: Update context size estimates
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests')
-rw-r--r--tests/gem_ctx_thrash.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/tests/gem_ctx_thrash.c b/tests/gem_ctx_thrash.c
index 44b3b985..20edccbf 100644
--- a/tests/gem_ctx_thrash.c
+++ b/tests/gem_ctx_thrash.c
@@ -57,6 +57,25 @@ static bool has_execlists(int fd)
return enabled;
}
+static unsigned context_size(int fd)
+{
+ const int gen = intel_gen(intel_get_drm_devid(fd));
+
+ switch (gen) {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ case 4:
+ case 5:
+ case 6:
+ case 7: return 18 << 12;
+ case 8: return 20 << 12;
+ case 9: return 22 << 12;
+ default: return 32 << 12;
+ }
+}
+
static unsigned get_num_contexts(int fd, int num_engines)
{
uint64_t ggtt_size;
@@ -66,9 +85,9 @@ static unsigned get_num_contexts(int fd, int num_engines)
/* Compute the number of contexts we can allocate to fill the GGTT */
ggtt_size = gem_global_aperture_size(fd);
- size = 64 << 10; /* Most gen require at least 64k for ctx */
+ size = context_size(fd);
if (has_execlists(fd)) {
- size *= 2; /* ringbuffer as well */
+ size += 4 << 12; /* ringbuffer as well */
if (num_engines) /* one per engine with execlists */
size *= num_engines;
}