summaryrefslogtreecommitdiff
path: root/tests/eviction_common.c
diff options
context:
space:
mode:
authorTvrtko Ursulin <tvrtko.ursulin@intel.com>2014-02-03 10:59:41 +0000
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-02-04 12:36:57 +0100
commit42bcd05eb3f1545fbf9c397c3f37c3f6a27c5da4 (patch)
tree4bd407cd425fd6841cab725b88e4b63fe3b96271 /tests/eviction_common.c
parente1dea7e2e190307056a05a2945e59b59fe5b6fc0 (diff)
tests/eviction_common: Avoid submitting duplicate objects
Make sure selection loop does not generate duplicates when it picks a subset of objects for a single exec buffer. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'tests/eviction_common.c')
-rw-r--r--tests/eviction_common.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/eviction_common.c b/tests/eviction_common.c
index efe560cb..91fb2dfe 100644
--- a/tests/eviction_common.c
+++ b/tests/eviction_common.c
@@ -65,6 +65,13 @@ static int minor_evictions(int fd, struct igt_eviction_test_ops *ops,
uint32_t *bo, *sel;
int n, m, pass, fail;
+ /* Make sure nr_surfaces is not divisible by seven
+ * to avoid duplicates in the selection loop below.
+ */
+ nr_surfaces /= 7;
+ nr_surfaces *= 7;
+ nr_surfaces += 3;
+
igt_require((uint64_t)nr_surfaces * surface_size / (1024 * 1024)
< intel_get_total_ram_mb() * 9 / 10);