From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BAEE6C433DF for ; Sun, 31 May 2020 19:13:18 +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 4D49E204EA for ; Sun, 31 May 2020 19:13:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4D49E204EA 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 B81C889C98; Sun, 31 May 2020 19:13:17 +0000 (UTC) Received: from fireflyinternet.com (mail.fireflyinternet.com [109.228.58.192]) by gabe.freedesktop.org (Postfix) with ESMTPS id D305689C80; Sun, 31 May 2020 19:13:15 +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 21354289-1500050 for multiple; Sun, 31 May 2020 20:13:09 +0100 From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Sun, 31 May 2020 20:13:07 +0100 Message-Id: <20200531191307.180023-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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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..0e3b52900 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 | 1; /* 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 */ -- 2.27.0.rc2 _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Chris Wilson Date: Sun, 31 May 2020 20:13:07 +0100 Message-Id: <20200531191307.180023-1-chris@chris-wilson.co.uk> MIME-Version: 1.0 Subject: [igt-dev] [PATCH i-g-t] i915/gem_exec_balancer: Disable pre-parser for rewritten batches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" To: intel-gfx@lists.freedesktop.org Cc: igt-dev@lists.freedesktop.org, Chris Wilson List-ID: 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..0e3b52900 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 | 1; /* 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 */ -- 2.27.0.rc2 _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev