From patchwork Wed May 22 15:57:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 10956233 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 E3B8714C0 for ; Wed, 22 May 2019 15:57:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D323220072 for ; Wed, 22 May 2019 15:57:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C7C9C28BDE; Wed, 22 May 2019 15:57:51 +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,HK_RANDOM_FROM, 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 86ECF20072 for ; Wed, 22 May 2019 15:57:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 529E889C60; Wed, 22 May 2019 15:57:49 +0000 (UTC) X-Original-To: Intel-gfx@lists.freedesktop.org Delivered-To: Intel-gfx@lists.freedesktop.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by gabe.freedesktop.org (Postfix) with ESMTPS id A19EB89C56; Wed, 22 May 2019 15:57:46 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 May 2019 08:57:45 -0700 X-ExtLoop1: 1 Received: from dmironox-mobl5.ccr.corp.intel.com (HELO localhost.localdomain) ([10.252.20.122]) by fmsmga005.fm.intel.com with ESMTP; 22 May 2019 08:57:44 -0700 From: Tvrtko Ursulin To: igt-dev@lists.freedesktop.org Date: Wed, 22 May 2019 16:57:18 +0100 Message-Id: <20190522155720.28723-14-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190522155720.28723-1-tvrtko.ursulin@linux.intel.com> References: <20190522155720.28723-1-tvrtko.ursulin@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH i-g-t 13/15] gem_wsim: Support Icelake parts 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 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP From: Tvrtko Ursulin On Icelake second vcs engine is vcs2 instead of vcs1 so add some logical to physical instance remapping based on engine discovery to support it. v2: * Rebase. Signed-off-by: Tvrtko Ursulin Reviewed-by: Chris Wilson --- benchmarks/gem_wsim.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/benchmarks/gem_wsim.c b/benchmarks/gem_wsim.c index 64d19ed469b0..0ccb271575f7 100644 --- a/benchmarks/gem_wsim.c +++ b/benchmarks/gem_wsim.c @@ -552,6 +552,26 @@ fill_engines_id_class(enum intel_engine_id *list, } } +static unsigned int +find_physical_instance(enum intel_engine_id class, unsigned int logical) +{ + unsigned int i, j = 0; + + igt_assert(class == VCS); + + for (i = 0; i < __num_engines; i++) { + if (__engines[i].engine_class != I915_ENGINE_CLASS_VIDEO) + continue; + + /* Map logical to physical instances. */ + if (logical == j++) + return __engines[i].engine_instance; + } + + igt_assert(0); + return 0; +} + static struct i915_engine_class_instance get_engine(enum intel_engine_id engine) { @@ -571,7 +591,7 @@ get_engine(enum intel_engine_id engine) case VCS1: case VCS2: ci.engine_class = I915_ENGINE_CLASS_VIDEO; - ci.engine_instance = engine - VCS1; + ci.engine_instance = find_physical_instance(VCS, engine - VCS1); break; case VECS: ci.engine_class = I915_ENGINE_CLASS_VIDEO_ENHANCE;