Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3924133imw; Thu, 7 Jul 2022 09:40:09 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uP9mvzM7XjIX3vOiRe9NJa4lHXIqnKxULJG10vAyadTNkAzLwWUxjfrplZr+7ZYtsKcY3D X-Received: by 2002:a17:907:2057:b0:726:a604:a2db with SMTP id pg23-20020a170907205700b00726a604a2dbmr45380605ejb.223.1657212009223; Thu, 07 Jul 2022 09:40:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657212009; cv=none; d=google.com; s=arc-20160816; b=wosKIgXikLKtWE7ZCcCxMJNTlQA4YD2OMMzDOZwiLAMRtUIR3J7hTU/JRO8RKjnlo+ 7TW86R5avbTREp7DGmvxCbOsLj1Lfpt+LMCrDZ75fAnTlQpTSKJPLBMUgbJAlnWofReM Nd7b0OtdjAcnXuwYMFsOC7x+4y3JZKzsqweJHVdfVhmPbv1eU0QukPeKp5KrFDm7cV0e v01M2VyhNOkyNZmlAW6UV1+/GFa+SF3Hy0MR23BU8rXm52TJJbnI2V+fDU8y2D6Q565z 4DnOvW+4lnZ+eVez4QF+p1not5Snudp+YGfmJfK55nDjagsZr7ht8B1NqYdyUEHloo0X YekQ== 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=U+7ZNDOQ2WtQXb6ho4hKYTpNOOtEwMBT8JMvM3kVrQo=; b=XFPwIvQMQM6RoR0DIOouOop8Vz0y8WMnGMbLmMsWssaXq5KGAdlnPlwrlvRWXcoQeQ 9D9a0cx58jE24/kItpEbNq7DKivHItFVqcjbvPcqnOjTbIVuZOySidFVk3CrasgOHJ8g xaLEa3vtAE5Y3wOFETluJbt2bdI/BIkYbcAmwM3x7LSEnJvQkWDIvBdjcjhwKxGZg0ze c0PdPmHQumAQsQw0+hWVN5hDCTi9S8pqyJo9JVq+bn0ecJgKaprxA1jkYlHO5bS6BhP8 Sp5kvzxlKDjGAgWlGaRe2/D07PrwxB/s9CrFu2OHKxvLhSoUhV8id403EsRHZel2Z+U/ DN+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=dB6Wqyfo; 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 h9-20020a1709060f4900b00722e1c6efe2si720411ejj.426.2022.07.07.09.39.44; Thu, 07 Jul 2022 09:40:09 -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=dB6Wqyfo; 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 S236249AbiGGQgy (ORCPT + 99 others); Thu, 7 Jul 2022 12:36:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236027AbiGGQgq (ORCPT ); Thu, 7 Jul 2022 12:36:46 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFD334D4C7 for ; Thu, 7 Jul 2022 09:36:45 -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 7EF1566019C6; Thu, 7 Jul 2022 17:36:44 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1657211804; bh=x5DY8lqdscLPNZjf5Ukvpn+M8BELAAg44M2twj/KzYc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dB6WqyfoGeOIBLkJFALwwSlluSy82NL38D243B17dNo8/3QjF84XKM196k5KT/S3K dkZhhNFX5zByloLMVGawXxjc/M0oNo1RECrDroPsIJh6wCztDmzgrUtegN0I3h4cy4 BEHkGXALp0eAC5bmHrAzazCWxgBhQ+Nr7ri5Ns4B2KxpBnKTCU18ff0oweL9+CU4ox vjCxApRAOHP2kuhetXChqUFLJ3XHiG4zQiEvWBkTdZTIkhID1r+edT8NEoqTsGODio dwUJtzKQP5XxnxbNoKVjmHt6MfkNJFZkWpCcutS4wm09IGmT/McpjpRHd63b9cddwV X/zl4M+mYo2sQ== 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 v9 03/11] drm/i915/ttm: only trust snooping for dgfx when deciding default cache_level Date: Thu, 7 Jul 2022 16:35:58 +0000 Message-Id: <20220707163606.1474111-4-bob.beckett@collabora.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220707163606.1474111-1-bob.beckett@collabora.com> References: <20220707163606.1474111-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 4c1de0b4a10f..40249fa28a7a 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c @@ -46,7 +46,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