From patchwork Fri Mar 6 14:38:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 11424149 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 3BA0614BC for ; Fri, 6 Mar 2020 14:38:57 +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 236E22072D for ; Fri, 6 Mar 2020 14:38:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 236E22072D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com 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 D2CBF6E453; Fri, 6 Mar 2020 14:38:55 +0000 (UTC) X-Original-To: Intel-gfx@lists.freedesktop.org Delivered-To: Intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id D993D89B11; Fri, 6 Mar 2020 14:38:54 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Mar 2020 06:38:54 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,522,1574150400"; d="scan'208";a="230084884" Received: from srware-mobl.ger.corp.intel.com (HELO localhost.localdomain) ([10.252.25.112]) by orsmga007.jf.intel.com with ESMTP; 06 Mar 2020 06:38:53 -0800 From: Tvrtko Ursulin To: igt-dev@lists.freedesktop.org Date: Fri, 6 Mar 2020 14:38:49 +0000 Message-Id: <20200306143850.673-1-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH i-g-t 1/2] gem_wsim: Fix calibration for special VCS engine name 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" From: Tvrtko Ursulin VCS is a special (non-physical) engine id/name which means load-balancing in legacy workloads. As such when i915 balancing is not enabled it needs to have a calibration as well. Signed-off-by: Tvrtko Ursulin --- benchmarks/gem_wsim.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/benchmarks/gem_wsim.c b/benchmarks/gem_wsim.c index a1bbcef031bb..c196b25317ce 100644 --- a/benchmarks/gem_wsim.c +++ b/benchmarks/gem_wsim.c @@ -3353,6 +3353,8 @@ int main(int argc, char **argv) engine_calib_map[eng] = calib_val; if (eng == RCS) engine_calib_map[DEFAULT] = calib_val; + else if (eng == VCS1 || eng == VCS2) + engine_calib_map[VCS] = calib_val; has_nop_calibration = true; } } else { From patchwork Fri Mar 6 14:38:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 11424151 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 EA71D14E3 for ; Fri, 6 Mar 2020 14:38:59 +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 D2B3D2072D for ; Fri, 6 Mar 2020 14:38:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D2B3D2072D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com 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 21F3B6E463; Fri, 6 Mar 2020 14:38:59 +0000 (UTC) X-Original-To: Intel-gfx@lists.freedesktop.org Delivered-To: Intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id A55FA89B11; Fri, 6 Mar 2020 14:38:55 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Mar 2020 06:38:55 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,522,1574150400"; d="scan'208";a="230084891" Received: from srware-mobl.ger.corp.intel.com (HELO localhost.localdomain) ([10.252.25.112]) by orsmga007.jf.intel.com with ESMTP; 06 Mar 2020 06:38:54 -0800 From: Tvrtko Ursulin To: igt-dev@lists.freedesktop.org Date: Fri, 6 Mar 2020 14:38:50 +0000 Message-Id: <20200306143850.673-2-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200306143850.673-1-tvrtko.ursulin@linux.intel.com> References: <20200306143850.673-1-tvrtko.ursulin@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH i-g-t 2/2] gem_wsim: Mark contexts as non-persistent 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" From: Tvrtko Ursulin We want to mark workload contexts as non-persistent if possible so that we do not have to worry about leaving long (or infinite!) batches running post exit. Signed-off-by: Tvrtko Ursulin --- benchmarks/gem_wsim.c | 50 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 42 insertions(+), 8 deletions(-) diff --git a/benchmarks/gem_wsim.c b/benchmarks/gem_wsim.c index c196b25317ce..7cb8ea5b18ba 100644 --- a/benchmarks/gem_wsim.c +++ b/benchmarks/gem_wsim.c @@ -1431,16 +1431,48 @@ alloc_step_batch(struct workload *wrk, struct w_step *w, unsigned int flags) #endif } -static void __ctx_set_prio(uint32_t ctx_id, unsigned int prio) +static bool has_persistence(int i915) { - struct drm_i915_gem_context_param param = { - .ctx_id = ctx_id, - .param = I915_CONTEXT_PARAM_PRIORITY, - .value = prio, + struct drm_i915_gem_context_param p = { + .param = I915_CONTEXT_PARAM_PERSISTENCE, }; + uint64_t saved; + + if (__gem_context_get_param(i915, &p)) + return false; + + saved = p.value; + p.value = 0; + if (__gem_context_set_param(i915, &p)) + return false; + + p.value = saved; + return __gem_context_set_param(i915, &p) == 0; +} + +static bool __has_persistence; + +static void __configure_context(uint32_t ctx_id, unsigned int prio) +{ + if (prio) { + struct drm_i915_gem_context_param param = { + .ctx_id = ctx_id, + .param = I915_CONTEXT_PARAM_PRIORITY, + .value = prio, + }; - if (prio) gem_context_set_param(fd, ¶m); + } + + /* Mark as non-persistent if supported. */ + if (__has_persistence) { + struct drm_i915_gem_context_param param = { + .ctx_id = ctx_id, + .param = I915_CONTEXT_PARAM_PERSISTENCE, + }; + + gem_context_set_param(fd, ¶m); + } } static int __vm_destroy(int i915, uint32_t vm_id) @@ -1743,7 +1775,7 @@ prepare_workload(unsigned int id, struct workload *wrk, unsigned int flags) ctx_vcs ^= 1; } - __ctx_set_prio(ctx_id, wrk->prio); + __configure_context(ctx_id, wrk->prio); /* * Do we need a separate context to satisfy this workloads which @@ -1772,7 +1804,7 @@ prepare_workload(unsigned int id, struct workload *wrk, unsigned int flags) ctx_id = args.ctx_id; wrk->ctx_list[i + 1].id = args.ctx_id; - __ctx_set_prio(ctx_id, wrk->prio); + __configure_context(ctx_id, wrk->prio); } if (ctx->engine_map) { @@ -3280,6 +3312,8 @@ int main(int argc, char **argv) fd = __drm_open_driver(DRIVER_INTEL); igt_require(fd); + __has_persistence = has_persistence(fd); + intel_register_access_init(&mmio_data, intel_get_pci_device(), false, fd); init_clocks();