From patchwork Mon Mar 30 09:21:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 11465021 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 58ADB1667 for ; Mon, 30 Mar 2020 09:21:32 +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 40E022073B for ; Mon, 30 Mar 2020 09:21:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 40E022073B 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 F0F4B89944; Mon, 30 Mar 2020 09:21:29 +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 6D78D89933; Mon, 30 Mar 2020 09:21:27 +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 20737344-1500050 for multiple; Mon, 30 Mar 2020 10:21:19 +0100 From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Mon, 30 Mar 2020 10:21:14 +0100 Message-Id: <20200330092117.810776-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/4] i915/gem_bad_reloc: Reduce negative testing 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" The plain negative-reloc tests do no execute anything on the GPU and so cannot determine if the GPU would fallover, they only exercise the kernel's placement which is uniform across the engines. We should also cover the engines with perhaps MI_STORE_DWORD, but for the moment the solitary exercise of blt remains. Signed-off-by: Chris Wilson --- tests/i915/gem_bad_reloc.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/tests/i915/gem_bad_reloc.c b/tests/i915/gem_bad_reloc.c index 96c9babe6..57efc77c3 100644 --- a/tests/i915/gem_bad_reloc.c +++ b/tests/i915/gem_bad_reloc.c @@ -50,7 +50,7 @@ IGT_TEST_DESCRIPTION("Simulates SNA behaviour using negative self-relocations" * than the total size of the GTT), the GPU will hang. * See https://bugs.freedesktop.org/show_bug.cgi?id=78533 */ -static void negative_reloc(int fd, unsigned engine, unsigned flags) +static void negative_reloc(int fd, unsigned flags) { struct drm_i915_gem_execbuffer2 execbuf; struct drm_i915_gem_exec_object2 obj; @@ -60,7 +60,6 @@ static void negative_reloc(int fd, unsigned engine, unsigned flags) uint64_t *offsets; int i; - gem_require_ring(fd, engine); igt_require(intel_gen(intel_get_drm_devid(fd)) >= 7); memset(&obj, 0, sizeof(obj)); @@ -70,7 +69,7 @@ static void negative_reloc(int fd, unsigned engine, unsigned flags) memset(&execbuf, 0, sizeof(execbuf)); execbuf.buffers_ptr = (uintptr_t)&obj; execbuf.buffer_count = 1; - execbuf.flags = engine | (flags & USE_LUT); + execbuf.flags = flags & USE_LUT; igt_require(__gem_execbuf(fd, &execbuf) == 0); igt_info("Found offset %lld for 4k batch\n", (long long)obj.offset); @@ -185,7 +184,6 @@ static void negative_reloc_blt(int fd) igt_main { - const struct intel_execution_engine *e; int fd = -1; igt_fixture { @@ -194,13 +192,11 @@ igt_main gem_require_blitter(fd); } - for (e = intel_execution_engines; e->name; e++) { - igt_subtest_f("negative-reloc-%s", e->name) - negative_reloc(fd, eb_ring(e), 0); + igt_subtest("negative-reloc") + negative_reloc(fd, 0); - igt_subtest_f("negative-reloc-lut-%s", e->name) - negative_reloc(fd, eb_ring(e), USE_LUT); - } + igt_subtest("negative-reloc-lut") + negative_reloc(fd, USE_LUT); igt_subtest("negative-reloc-bltcopy") negative_reloc_blt(fd); From patchwork Mon Mar 30 09:21:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 11465025 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 8D9E515AB for ; Mon, 30 Mar 2020 09:21:35 +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 75F08206E6 for ; Mon, 30 Mar 2020 09:21:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 75F08206E6 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 4C9F78992E; Mon, 30 Mar 2020 09:21:30 +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 6D1608992E; Mon, 30 Mar 2020 09:21:27 +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 20737345-1500050 for multiple; Mon, 30 Mar 2020 10:21:19 +0100 From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Mon, 30 Mar 2020 10:21:15 +0100 Message-Id: <20200330092117.810776-2-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200330092117.810776-1-chris@chris-wilson.co.uk> References: <20200330092117.810776-1-chris@chris-wilson.co.uk> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH i-g-t 2/4] i915/gem_exec_async: Dynamise per-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" Convert the per-engine tests into a dynamic subtest. Signed-off-by: Chris Wilson --- tests/i915/gem_exec_async.c | 37 ++++++++++++++++--------------------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/tests/i915/gem_exec_async.c b/tests/i915/gem_exec_async.c index 623493963..3187b4f63 100644 --- a/tests/i915/gem_exec_async.c +++ b/tests/i915/gem_exec_async.c @@ -80,9 +80,10 @@ static void store_dword(int fd, unsigned ring, gem_close(fd, obj[1].handle); } -static void one(int fd, unsigned ring, uint32_t flags) +static void one(int fd, unsigned engine) { const int gen = intel_gen(intel_get_drm_devid(fd)); + const struct intel_execution_engine2 *e; struct drm_i915_gem_exec_object2 obj[2]; #define SCRATCH 0 #define BATCH 1 @@ -137,22 +138,20 @@ static void one(int fd, unsigned ring, uint32_t flags) memset(&execbuf, 0, sizeof(execbuf)); execbuf.buffers_ptr = to_user_pointer(obj); execbuf.buffer_count = 2; - execbuf.flags = ring | flags; - - igt_require(gem_engine_has_mutable_submission(fd, ring)); + execbuf.flags = engine; igt_require(__gem_execbuf(fd, &execbuf) == 0); gem_close(fd, obj[BATCH].handle); i = 0; - for_each_physical_engine(e, fd) { - if (eb_ring(e) == ring) + __for_each_physical_engine(fd, e) { + if (e->flags == engine) continue; - if (!gem_can_store_dword(fd, eb_ring(e))) + if (!gem_class_can_store_dword(fd, e->class)) continue; - store_dword(fd, eb_ring(e), obj[SCRATCH].handle, 4*i, i); + store_dword(fd, e->flags, obj[SCRATCH].handle, 4*i, i); i++; } @@ -185,9 +184,15 @@ static bool has_async_execbuf(int fd) return async > 0; } +#define test_each_engine(T, i915, e) \ + igt_subtest_with_dynamic(T) __for_each_physical_engine(i915, e) \ + for_each_if(gem_class_can_store_dword(i915, (e)->class) && \ + gem_class_has_mutable_submission(i915, (e)->class))\ + igt_dynamic_f("%s", (e)->name) + igt_main { - const struct intel_execution_engine *e; + const struct intel_execution_engine2 *e; int fd = -1; igt_fixture { @@ -195,21 +200,11 @@ igt_main igt_require_gem(fd); gem_require_mmap_wc(fd); igt_require(has_async_execbuf(fd)); - igt_require(gem_can_store_dword(fd, 0)); igt_fork_hang_detector(fd); } - for (e = intel_execution_engines; e->name; e++) { - /* default exec-id is purely symbolic */ - if (e->exec_id == 0) - continue; - - igt_subtest_f("concurrent-writes-%s", e->name) { - igt_require(gem_ring_has_physical_engine(fd, eb_ring(e))); - igt_require(gem_can_store_dword(fd, eb_ring(e))); - one(fd, e->exec_id, e->flags); - } - } + test_each_engine("concurrent-writes", fd, e) + one(fd, e->flags); igt_fixture { igt_stop_hang_detector(); From patchwork Mon Mar 30 09:21:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 11465023 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 478951668 for ; Mon, 30 Mar 2020 09:21: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 3037E206E6 for ; Mon, 30 Mar 2020 09:21:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3037E206E6 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 0FF6C8994D; Mon, 30 Mar 2020 09:21:30 +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 6DDD689944; Mon, 30 Mar 2020 09:21:27 +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 20737346-1500050 for multiple; Mon, 30 Mar 2020 10:21:19 +0100 From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Mon, 30 Mar 2020 10:21:16 +0100 Message-Id: <20200330092117.810776-3-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200330092117.810776-1-chris@chris-wilson.co.uk> References: <20200330092117.810776-1-chris@chris-wilson.co.uk> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH i-g-t 3/4] i915/gem_exec_capture: Dynamise per-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" Convert the per-engine tests into a dynamic subtest. Signed-off-by: Chris Wilson --- tests/i915/gem_exec_capture.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/tests/i915/gem_exec_capture.c b/tests/i915/gem_exec_capture.c index fe2c4bd12..bc13d8632 100644 --- a/tests/i915/gem_exec_capture.c +++ b/tests/i915/gem_exec_capture.c @@ -524,9 +524,14 @@ static size_t safer_strlen(const char *s) return s ? strlen(s) : 0; } +#define test_each_engine(T, i915, e) \ + igt_subtest_with_dynamic(T) __for_each_physical_engine(i915, e) \ + for_each_if(gem_class_can_store_dword(i915, (e)->class)) \ + igt_dynamic_f("%s", (e)->name) + igt_main { - const struct intel_execution_engine *e; + const struct intel_execution_engine2 *e; igt_hang_t hang; int fd = -1; int dir = -1; @@ -550,17 +555,8 @@ igt_main igt_require(safer_strlen(igt_sysfs_get(dir, "error")) > 0); } - for (e = intel_execution_engines; e->name; e++) { - /* default exec-id is purely symbolic */ - if (e->exec_id == 0) - continue; - - igt_subtest_f("capture-%s", e->name) { - igt_require(gem_ring_has_physical_engine(fd, eb_ring(e))); - igt_require(gem_can_store_dword(fd, eb_ring(e))); - capture(fd, dir, eb_ring(e)); - } - } + test_each_engine("capture", fd, e) + capture(fd, dir, e->flags); igt_subtest_f("many-4K-zero") { igt_require(gem_can_store_dword(fd, 0)); From patchwork Mon Mar 30 09:21:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 11465027 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 ECEF815AB for ; Mon, 30 Mar 2020 09:21:36 +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 D5C81206E6 for ; Mon, 30 Mar 2020 09:21:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D5C81206E6 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 E3F248999C; Mon, 30 Mar 2020 09:21:35 +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 74E608992E; Mon, 30 Mar 2020 09:21:29 +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 20737348-1500050 for multiple; Mon, 30 Mar 2020 10:21:19 +0100 From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Mon, 30 Mar 2020 10:21:17 +0100 Message-Id: <20200330092117.810776-4-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200330092117.810776-1-chris@chris-wilson.co.uk> References: <20200330092117.810776-1-chris@chris-wilson.co.uk> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH i-g-t 4/4] i915/gem_exec_parallel: Dynamise per-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" Convert the per-engine tests into a dynamic subtest. Signed-off-by: Chris Wilson --- tests/i915/gem_exec_parallel.c | 28 ++++++++++++++------------- tests/intel-ci/fast-feedback.testlist | 4 +--- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/tests/i915/gem_exec_parallel.c b/tests/i915/gem_exec_parallel.c index 98316af40..66fe18534 100644 --- a/tests/i915/gem_exec_parallel.c +++ b/tests/i915/gem_exec_parallel.c @@ -196,7 +196,6 @@ static void all(int fd, struct intel_execution_engine2 *engine, unsigned flags) engines[nengine++] = e->flags; } } else { - igt_require(gem_class_can_store_dword(fd, engine->class)); engines[nengine++] = engine->flags; } igt_require(nengine); @@ -254,7 +253,7 @@ igt_main const char *name; unsigned flags; } modes[] = { - { "", 0 }, + { "basic", 0 }, { "contexts", CONTEXTS }, { "fds", FDS }, { NULL } @@ -268,18 +267,21 @@ igt_main igt_fork_hang_detector(fd); } - for (const struct mode *m = modes; m->name; m++) - igt_subtest_f("%s", *m->name ? m->name : "basic") - /* NULL value means all engines */ - all(fd, NULL, m->flags); - - __for_each_physical_engine(fd, e) { + igt_subtest_with_dynamic("engines") { for (const struct mode *m = modes; m->name; m++) - igt_subtest_f("%s%s%s", - e->name, - *m->name ? "-" : "", - m->name) - all(fd, e, m->flags); + igt_dynamic(m->name) + /* NULL value means all engines */ + all(fd, NULL, m->flags); + } + + for (const struct mode *m = modes; m->name; m++) { + igt_subtest_with_dynamic(m->name) { + __for_each_physical_engine(fd, e) { + if (gem_class_can_store_dword(fd, e->class)) + igt_dynamic(e->name) + all(fd, e, m->flags); + } + } } igt_fixture { diff --git a/tests/intel-ci/fast-feedback.testlist b/tests/intel-ci/fast-feedback.testlist index b41fb4a01..06367f822 100644 --- a/tests/intel-ci/fast-feedback.testlist +++ b/tests/intel-ci/fast-feedback.testlist @@ -21,9 +21,7 @@ igt@gem_exec_fence@basic-wait igt@gem_exec_fence@basic-await igt@gem_exec_fence@nb-await igt@gem_exec_gttfill@basic -igt@gem_exec_parallel@basic -igt@gem_exec_parallel@contexts -igt@gem_exec_parallel@fds +igt@gem_exec_parallel@engines igt@gem_exec_store@basic-all igt@gem_exec_suspend@basic igt@gem_exec_suspend@basic-s0