Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp713081imw; Wed, 13 Jul 2022 06:46:02 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tJ20d/BObujxy+ALiIjeMAldSbJ3fVBa21i+G4tqXdlTk5x5E60MFFVditJWMc38OVSjTf X-Received: by 2002:a63:e552:0:b0:419:8dfb:386e with SMTP id z18-20020a63e552000000b004198dfb386emr3028220pgj.143.1657719962021; Wed, 13 Jul 2022 06:46:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657719962; cv=none; d=google.com; s=arc-20160816; b=t6l4zEMP5lmUbtunDEKF9wNG7pq7utBAQn1PeDiGgmRjUK6tODKCZ18UPx1Uh66htJ uOrkp22CAWejW8jQ7SnaDMmRvsl05Tk/PjItJt4LQ2alzADhzF1j9v2D9Xyols1tOf27 79CxSFUceWdD9Qd9DsVXp+ypJqcYfbOsbRE21BmHzT0mM8QvTzr6eMIR0vuk22ascwFq Q+9tuuYgm5aKoOYJ+0yQHSMuSgzN/koe331i0UizfoYML/8hx3oZEGEyZ6Xz1zR7Yuk1 WIgtYd4pQkLhoDsomcI9VOi3twtqhtSsAa3hnk5eR7PXCrwIw5bTV+60r/oYMKJVarqO V1hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=yp8NQsEWRELUiZFVhzqnHWskyYWwtbZrno1iyX7ibuo=; b=PkR+cismMmGOyt9xOS4oauXBmI9Ww6FF2+UXQ18TnxA07UolnwOz4/Fm0OGKEFMXy/ 5rxEXm44SlEDn3Sz5lhUSTJbu8XjqhhDEruJ3wVCjcsZMUm2keBtPbDw8x+f+6Pvm5Cj 9feY2NkuZLnzM9UVKOsvoMOLeAi5RMU2WfShO7SV2nlc3W55y4BVPZ650eIGIg+RqElr 9M1nEDPRo9k4umYvlC8it+rvMJx3u3kwfeMRyMtQelrD3dU3KxG3EHTa7LiiUtWOKZc2 EDpBp+2g2fzfpC4Mv+cHmvyqYFWklqRhzGkLtRtj9XIDrr+SUjf3YMCslkSZ+8oh6gYA Dq1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="cIJZean/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d21-20020a17090ab31500b001ece9122d4esi2225486pjr.86.2022.07.13.06.45.48; Wed, 13 Jul 2022 06:46:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="cIJZean/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235830AbiGMNis (ORCPT + 99 others); Wed, 13 Jul 2022 09:38:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229771AbiGMNio (ORCPT ); Wed, 13 Jul 2022 09:38:44 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13352630B for ; Wed, 13 Jul 2022 06:38:41 -0700 (PDT) Received: from hermes-devbox.fritz.box (82-71-8-225.dsl.in-addr.zen.co.uk [82.71.8.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bbeckett) by madras.collabora.co.uk (Postfix) with ESMTPSA id 632D16601A38; Wed, 13 Jul 2022 14:38:40 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1657719520; bh=MULA0VYW5/ZsE36/5dPbAjqG53dPkqcAhW75h7Y1TfQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cIJZean/Ej7PP3OF5y1A3OkXa1CRe5VjtnLF6pQpm5mvLFrIYQu5mszkEgIZSv6er kNamHq30zLceAEkU/hxDzrfjjt++aGdTh6gM2O/Yt7e1PeDVfIicAO7asFOWs1zNse 0fUdAWKJuygFhuQuWYJKUwAx3QkfarSMXpWbj4+yg5WYZLypCOIxi5ee0AqfM055jx zulxhPbt03iT/oCow4i8dLyzz+xYwry1CuiMdQRnX+KRZ7qloONn5VU+pI8D9imb/e peQ904yhs0ykcAn7mieEL/Ftqpgfmj6bPrSXuJCXmBWi2do6qpX1EnBL7pEbJVssny bpYpmNs99ZObg== From: Robert Beckett To: dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , David Airlie , Daniel Vetter Cc: kernel@collabora.com, Robert Beckett , Matthew Auld , =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= , linux-kernel@vger.kernel.org Subject: [PATCH v4 3/8] drm/i915/ttm: only trust snooping for dgfx when deciding default cache_level Date: Wed, 13 Jul 2022 14:38:13 +0100 Message-Id: <20220713133818.3699604-4-bob.beckett@collabora.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220713133818.3699604-1-bob.beckett@collabora.com> References: <20220713133818.3699604-1-bob.beckett@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org By default i915_ttm_cache_level() decides I915_CACHE_LLC if HAS_SNOOP. This is divergent from existing backends code which only considers HAS_LLC. Testing shows that trusting snooping on gen5- is unreliable and bsw via ggtt mappings, so limit DGFX for now and maintain previous behaviour. Signed-off-by: Robert Beckett Reviewed-by: Thomas Hellström --- drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c b/drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c index 042c2237e287..a949594237d9 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c @@ -52,7 +52,9 @@ static enum i915_cache_level i915_ttm_cache_level(struct drm_i915_private *i915, struct ttm_resource *res, struct ttm_tt *ttm) { - return ((HAS_LLC(i915) || HAS_SNOOP(i915)) && + bool can_snoop = HAS_SNOOP(i915) && IS_DGFX(i915); + + return ((HAS_LLC(i915) || can_snoop) && !i915_ttm_gtt_binds_lmem(res) && ttm->caching == ttm_cached) ? I915_CACHE_LLC : I915_CACHE_NONE; -- 2.25.1