From patchwork Wed Feb 5 11:59: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: 11366167 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 115CF13A4 for ; Wed, 5 Feb 2020 11:59: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 EE2DB218AC for ; Wed, 5 Feb 2020 11:59:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EE2DB218AC 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 845B06F55D; Wed, 5 Feb 2020 11:59:33 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from fireflyinternet.com (unknown [77.68.26.236]) by gabe.freedesktop.org (Postfix) with ESMTPS id 603956F55B; Wed, 5 Feb 2020 11:59: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 20123538-1500050 for multiple; Wed, 05 Feb 2020 11:59:16 +0000 From: Chris Wilson To: igt-dev@lists.freedesktop.org Date: Wed, 5 Feb 2020 11:59:15 +0000 Message-Id: <20200205115915.1823074-1-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH i-g-t] i915/gem_ctx_exec: Update the list of engines on the actual context 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: intel-gfx@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" We want to iterate the set of physical engines on this context, so update the iterators to act on a particular context. This tunnel keeps on getting longer. Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin --- lib/i915/gem_engine_topology.h | 7 +++++-- tests/i915/gem_ctx_exec.c | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/i915/gem_engine_topology.h b/lib/i915/gem_engine_topology.h index e40d7ec83..027d86be2 100644 --- a/lib/i915/gem_engine_topology.h +++ b/lib/i915/gem_engine_topology.h @@ -67,9 +67,12 @@ struct intel_execution_engine2 gem_eb_flags_to_engine(unsigned int flags); intel_next_engine(&i__)) /* needs to replace "for_each_physical_engine" when conflicts are fixed */ -#define __for_each_physical_engine(fd__, e__) \ - for (struct intel_engine_data i__ = intel_init_engine_list(fd__, 0); \ +#define ____for_each_physical_engine(fd__, ctx__, e__) \ + for (struct intel_engine_data i__ = intel_init_engine_list(fd__, ctx__); \ ((e__) = intel_get_current_physical_engine(&i__)); \ intel_next_engine(&i__)) +#define __for_each_physical_engine(fd__, e__) \ + ____for_each_physical_engine(fd__, 0, e__) + #endif /* GEM_ENGINE_TOPOLOGY_H */ diff --git a/tests/i915/gem_ctx_exec.c b/tests/i915/gem_ctx_exec.c index aeb8d2976..5b4e4b3db 100644 --- a/tests/i915/gem_ctx_exec.c +++ b/tests/i915/gem_ctx_exec.c @@ -226,7 +226,7 @@ static void nohangcheck_hostile(int i915) igt_require(__enable_hangcheck(dir, false)); - __for_each_physical_engine(i915, e) { + ____for_each_physical_engine(i915, ctx, e) { igt_spin_t *spin; spin = igt_spin_new(i915, ctx,