From patchwork Fri Sep 14 13:35:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 10600791 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E6352112B for ; Fri, 14 Sep 2018 13:37:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CDD562B6E6 for ; Fri, 14 Sep 2018 13:37:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C24EE2B6E8; Fri, 14 Sep 2018 13:37:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 596EE2B6E6 for ; Fri, 14 Sep 2018 13:37:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CA5536E8BE; Fri, 14 Sep 2018 13:37: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 75DC06E8BE; Fri, 14 Sep 2018 13:37: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 13769923-1500050 for multiple; Fri, 14 Sep 2018 14:35:34 +0100 From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Fri, 14 Sep 2018 14:35:38 +0100 Message-Id: <20180914133538.21428-1-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.19.0 MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH i-g-t] igt/gen3_*_blits: Add memory requirement checks X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: igt-dev@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Check we have sufficient memory to run the tests before getting trapped in the swap of despair. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107935 Signed-off-by: Chris Wilson Reviewed-by: Ville Syrjälä --- tests/gen3_mixed_blits.c | 1 + tests/gen3_render_linear_blits.c | 1 + tests/gen3_render_mixed_blits.c | 1 + tests/gen3_render_tiledx_blits.c | 1 + tests/gen3_render_tiledy_blits.c | 1 + 5 files changed, 5 insertions(+) diff --git a/tests/gen3_mixed_blits.c b/tests/gen3_mixed_blits.c index fa64598a6..948f4e6a7 100644 --- a/tests/gen3_mixed_blits.c +++ b/tests/gen3_mixed_blits.c @@ -458,6 +458,7 @@ int main(int argc, char **argv) if (count == 0) count = 3 * gem_aperture_size(fd) / (1024*1024) / 2; igt_info("Using %d 1MiB buffers\n", count); + intel_require_memory(count, 1024*1024, CHECK_RAM); handle = malloc(sizeof(uint32_t)*count*3); tiling = handle + count; diff --git a/tests/gen3_render_linear_blits.c b/tests/gen3_render_linear_blits.c index a03d7fc06..9d1499a59 100644 --- a/tests/gen3_render_linear_blits.c +++ b/tests/gen3_render_linear_blits.c @@ -333,6 +333,7 @@ int main(int argc, char **argv) if (count == 0) count = 3 * gem_aperture_size(fd) / (1024*1024) / 2; igt_info("Using %d 1MiB buffers\n", count); + intel_require_memory(count, 1024*1024, CHECK_RAM); handle = malloc(sizeof(uint32_t)*count*2); start_val = handle + count; diff --git a/tests/gen3_render_mixed_blits.c b/tests/gen3_render_mixed_blits.c index 2f127d993..afb53a598 100644 --- a/tests/gen3_render_mixed_blits.c +++ b/tests/gen3_render_mixed_blits.c @@ -352,6 +352,7 @@ int main(int argc, char **argv) if (count == 0) count = 3 * gem_aperture_size(fd) / (1024*1024) / 2; igt_info("Using %d 1MiB buffers\n", count); + intel_require_memory(count, 1024*1024, CHECK_RAM); handle = malloc(sizeof(uint32_t)*count*3); tiling = handle + count; diff --git a/tests/gen3_render_tiledx_blits.c b/tests/gen3_render_tiledx_blits.c index 06cdda382..e6246f2b0 100644 --- a/tests/gen3_render_tiledx_blits.c +++ b/tests/gen3_render_tiledx_blits.c @@ -339,6 +339,7 @@ int main(int argc, char **argv) if (count == 0) count = 3 * gem_aperture_size(fd) / (1024*1024) / 2; igt_info("Using %d 1MiB buffers\n", count); + intel_require_memory(count, 1024*1024, CHECK_RAM); handle = malloc(sizeof(uint32_t)*count*2); start_val = handle + count; diff --git a/tests/gen3_render_tiledy_blits.c b/tests/gen3_render_tiledy_blits.c index 9e4f4b77b..17502ccb7 100644 --- a/tests/gen3_render_tiledy_blits.c +++ b/tests/gen3_render_tiledy_blits.c @@ -339,6 +339,7 @@ int main(int argc, char **argv) if (count == 0) count = 3 * gem_aperture_size(fd) / (1024*1024) / 2; igt_info("Using %d 1MiB buffers\n", count); + intel_require_memory(count, 1024*1024, CHECK_RAM); handle = malloc(sizeof(uint32_t)*count*2); start_val = handle + count;