From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tvrtko Ursulin Subject: [PATCH 2/4] tests/eviction_common: Avoid submitting duplicate objects Date: Mon, 3 Feb 2014 10:59:41 +0000 Message-ID: <1391425183-1980-3-git-send-email-tvrtko.ursulin@linux.intel.com> References: <1391425183-1980-1-git-send-email-tvrtko.ursulin@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id A8EFC105756 for ; Mon, 3 Feb 2014 07:11:45 -0800 (PST) In-Reply-To: <1391425183-1980-1-git-send-email-tvrtko.ursulin@linux.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org To: Intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org From: Tvrtko Ursulin 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 --- tests/eviction_common.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/eviction_common.c b/tests/eviction_common.c index efe560c..91fb2df 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); -- 1.8.4.3