From patchwork Sun May 31 16:32:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 11580715 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 D703D90 for ; Sun, 31 May 2020 16:33:00 +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 BF0B820723 for ; Sun, 31 May 2020 16:33:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BF0B820723 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 5C16089D7D; Sun, 31 May 2020 16:32:58 +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 BF08F89D7C; Sun, 31 May 2020 16:32:55 +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 21353374-1500050 for multiple; Sun, 31 May 2020 17:32:49 +0100 From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Sun, 31 May 2020 17:32:46 +0100 Message-Id: <20200531163246.123451-1-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.27.0.rc2 MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH i-g-t] i915/gem_exec_balancer: Disable pre-parser for rewritten batches 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" As we rewrite the batches on the fly to implement the non-preemptible lock, we need to tell Tigerlake to read the batch afresh each time. Amusingly, the disable is a part of an arb-check, so we have to be careful not to include the arbitration point inside our unpreemptible loop. Signed-off-by: Chris Wilson --- tests/i915/gem_exec_balancer.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/i915/gem_exec_balancer.c b/tests/i915/gem_exec_balancer.c index 026f8347e..5bd4e74fc 100644 --- a/tests/i915/gem_exec_balancer.c +++ b/tests/i915/gem_exec_balancer.c @@ -1350,6 +1350,11 @@ static void __bonded_dual(int i915, *out = cycles; } +static uint32_t preparser_disable(void) +{ + return 0x5 << 23 | 1 << 8; /* preparser masked disable */ +} + static uint32_t sync_from(int i915, uint32_t addr, uint32_t target) { uint32_t handle = gem_create(i915, 4096); @@ -1363,14 +1368,14 @@ static uint32_t sync_from(int i915, uint32_t addr, uint32_t target) *cs++ = 0; *cs++ = 0; - *cs++ = MI_NOOP; + *cs++ = preparser_disable(); *cs++ = MI_NOOP; *cs++ = MI_NOOP; *cs++ = MI_NOOP; /* wait for them to cancel us */ *cs++ = MI_BATCH_BUFFER_START | 1 << 8 | 1; - *cs++ = addr + 16; + *cs++ = addr + 24; *cs++ = 0; /* self-heal */ @@ -1393,14 +1398,14 @@ static uint32_t sync_to(int i915, uint32_t addr, uint32_t target) cs = map = gem_mmap__device_coherent(i915, handle, 0, 4096, PROT_WRITE); - *cs++ = MI_NOOP; + *cs++ = preparser_disable(); *cs++ = MI_NOOP; *cs++ = MI_NOOP; *cs++ = MI_NOOP; /* wait to be cancelled */ *cs++ = MI_BATCH_BUFFER_START | 1 << 8 | 1; - *cs++ = addr; + *cs++ = addr + 8; *cs++ = 0; /* cancel their spin as a compliment */