From patchwork Thu Dec 13 11:57:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 10728543 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 6FE5B6C5 for ; Thu, 13 Dec 2018 11:57:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5D88A29315 for ; Thu, 13 Dec 2018 11:57:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 51E332BF39; Thu, 13 Dec 2018 11:57:23 +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 EEE9529315 for ; Thu, 13 Dec 2018 11:57:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4B8146EDEF; Thu, 13 Dec 2018 11:57:21 +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 5CAB06EDED; Thu, 13 Dec 2018 11:57:19 +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 14894180-1500050 for multiple; Thu, 13 Dec 2018 11:57:13 +0000 From: Chris Wilson To: igt-dev@lists.freedesktop.org Date: Thu, 13 Dec 2018 11:57:03 +0000 Message-Id: <20181213115703.24192-1-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH i-g-t] igt/amdgpu_amd_prime: Bail if we fail to create more contexts 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: intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP amdgpu has started to report out of space after creating a few contexts. This is not the scope of this test as here we just verifying that fences created in amd can be imported and used for synchronisation by i915 and for that we just need at least one context created! References: https://bugs.freedesktop.org/show_bug.cgi?id=109049 Signed-off-by: Chris Wilson Acked-by: Alex Deucher --- tests/amdgpu/amd_prime.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/amdgpu/amd_prime.c b/tests/amdgpu/amd_prime.c index bda0ce83d..518c88963 100644 --- a/tests/amdgpu/amd_prime.c +++ b/tests/amdgpu/amd_prime.c @@ -354,8 +354,8 @@ static void amd_to_i915(int i915, int amd, amdgpu_device_handle device) contexts = realloc(contexts, size * sizeof(*contexts)); } - r = amdgpu_cs_ctx_create(device, &contexts[count]); - igt_assert_eq(r, 0); + if (amdgpu_cs_ctx_create(device, &contexts[count])) + break; r = amdgpu_cs_submit(contexts[count], 0, &ibs_request, 1); igt_assert_eq(r, 0); @@ -364,6 +364,7 @@ static void amd_to_i915(int i915, int amd, amdgpu_device_handle device) } igt_info("Reservation width = %ld\n", count); + igt_require(count); amdgpu_bo_export(ib_result_handle, amdgpu_bo_handle_type_dma_buf_fd,