From patchwork Tue Mar 31 16:23:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 11468083 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 75F9281 for ; Tue, 31 Mar 2020 16:23:34 +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 5E3BC20CC7 for ; Tue, 31 Mar 2020 16:23:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5E3BC20CC7 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 06C6F6E332; Tue, 31 Mar 2020 16:23:34 +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 242C36E332; Tue, 31 Mar 2020 16:23:31 +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 20754889-1500050 for multiple; Tue, 31 Mar 2020 17:23:21 +0100 From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Tue, 31 Mar 2020 17:23:19 +0100 Message-Id: <20200331162320.968537-1-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.26.0 MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH i-g-t 1/2] i915/gem_exec_reloc: Dynamic active engine tests 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: igt-dev@lists.freedesktop.org, Chris Wilson Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Use igt_subtest_with_dynamic for the flexible approach to engine dependent test discovery. Signed-off-by: Chris Wilson --- tests/i915/gem_exec_reloc.c | 38 ++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/tests/i915/gem_exec_reloc.c b/tests/i915/gem_exec_reloc.c index 1aa03fba3..275cf6ae9 100644 --- a/tests/i915/gem_exec_reloc.c +++ b/tests/i915/gem_exec_reloc.c @@ -261,13 +261,13 @@ static void active(int fd, unsigned engine) nengine = 0; if (engine == ALL_ENGINES) { - for_each_physical_engine(e, fd) { - if (gem_can_store_dword(fd, eb_ring(e))) - engines[nengine++] = eb_ring(e); + const struct intel_execution_engine2 *e; + + __for_each_physical_engine(fd, e) { + if (gem_class_can_store_dword(fd, e->class)) + engines[nengine++] = e->flags; } } else { - igt_require(gem_has_ring(fd, engine)); - igt_require(gem_can_store_dword(fd, engine)); engines[nengine++] = engine; } igt_require(nengine); @@ -706,6 +706,7 @@ static void basic_softpin(int fd) igt_main { + const struct intel_execution_engine2 *e; const struct mode { const char *name; unsigned before, after; @@ -805,15 +806,26 @@ igt_main igt_subtest("gpu") from_gpu(fd); - igt_subtest("basic-active") - active(fd, ALL_ENGINES); - for (const struct intel_execution_engine *e = intel_execution_engines; - e->name; e++) { - igt_subtest_f("basic-active-%s", e->name) - active(fd, eb_ring(e)); - igt_subtest_f("basic-spin-%s", e->name) - active_spin(fd, eb_ring(e)); + igt_subtest_with_dynamic("basic-active") { + igt_dynamic("all") + active(fd, ALL_ENGINES); + + __for_each_physical_engine(fd, e) { + if (!gem_class_can_store_dword(fd, e->class)) + continue; + + igt_dynamic_f("%s", e->name) + active(fd, e->flags); + } + } + + igt_subtest_with_dynamic("basic-spin") { + __for_each_physical_engine(fd, e) { + igt_dynamic_f("%s", e->name) + active_spin(fd, e->flags); + } } + igt_fixture close(fd); }