From patchwork Fri May 29 20:34:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 11579597 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8263C139A for ; Fri, 29 May 2020 20:34:20 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 287182075A for ; Fri, 29 May 2020 20:34:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 287182075A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=chris-wilson.co.uk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B867E6E96E; Fri, 29 May 2020 20:34:19 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from fireflyinternet.com (mail.fireflyinternet.com [109.228.58.192]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5C0B96E96E for ; Fri, 29 May 2020 20:34:18 +0000 (UTC) X-Default-Received-SPF: pass (skip=forwardok (res=PASS)) x-ip-name=78.156.65.138; Received: from haswell.alporthouse.com (unverified [78.156.65.138]) by fireflyinternet.com (Firefly Internet (M1)) with ESMTP id 21339526-1500050 for multiple; Fri, 29 May 2020 21:34:10 +0100 From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Fri, 29 May 2020 21:34:08 +0100 Message-Id: <20200529203408.1425362-1-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.27.0.rc2 In-Reply-To: <20200529201534.474853-1-arnd@arndb.de> References: <20200529201534.474853-1-arnd@arndb.de> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH] compact-test-array X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Chris Wilson Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Ok, so count was variable, how about something like this. By my back of the paper calcs this should reduce it from 408 bytes to 272 bytes. --- drivers/gpu/drm/selftests/test-drm_mm.c | 42 ++++++++++++------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/drivers/gpu/drm/selftests/test-drm_mm.c b/drivers/gpu/drm/selftests/test-drm_mm.c index 9aabe82dcd3a..fa643cc54b0b 100644 --- a/drivers/gpu/drm/selftests/test-drm_mm.c +++ b/drivers/gpu/drm/selftests/test-drm_mm.c @@ -323,32 +323,30 @@ static bool expect_reserve_fail(struct drm_mm *mm, struct drm_mm_node *node) return false; } -static bool check_reserve_boundaries(struct drm_mm *mm, - unsigned int count, - u64 size) +static bool check_reserve_boundaries(struct drm_mm *mm, int count, u64 size) { const struct boundary { - u64 start, size; + int start, size; const char *name; } boundaries[] = { #define B(st, sz) { (st), (sz), "{ " #st ", " #sz "}" } B(0, 0), - B(-size, 0), - B(size, 0), - B(size * count, 0), - B(-size, size), - B(-size, -size), - B(-size, 2*size), - B(0, -size), - B(size, -size), - B(count*size, size), - B(count*size, -size), - B(count*size, count*size), - B(count*size, -count*size), - B(count*size, -(count+1)*size), - B((count+1)*size, size), - B((count+1)*size, -size), - B((count+1)*size, -2*size), + B(-1, 0), + B(1, 0), + B(count, 0), + B(-1, 1), + B(-1, -1), + B(-1, 2), + B(0, -1), + B(1, -1), + B(count, 1), + B(count, -1), + B(count, count), + B(count, -count), + B(count, -(count + 1)), + B(count + 1, 1), + B(count + 1, -1), + B(count + 1, -2), #undef B }; struct drm_mm_node tmp = {}; @@ -357,8 +355,8 @@ static bool check_reserve_boundaries(struct drm_mm *mm, for (n = 0; n < ARRAY_SIZE(boundaries); n++) { if (!expect_reserve_fail(mm, set_node(&tmp, - boundaries[n].start, - boundaries[n].size))) { + boundaries[n].start * size, + boundaries[n].size * size))) { pr_err("boundary[%d:%s] failed, count=%u, size=%lld\n", n, boundaries[n].name, count, size); return false;