tests/eviction_common: Avoid submitting duplicate objects
authorTvrtko Ursulin <tvrtko.ursulin@intel.com>
Mon, 3 Feb 2014 10:59:41 +0000 (10:59 +0000)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 4 Feb 2014 11:36:57 +0000 (12:36 +0100)
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>
tests/eviction_common.c

index efe560c..91fb2df 100644 (file)
@@ -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);