Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp21420iof; Wed, 8 Jun 2022 14:14:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyAJ/JD73zSsbvXR3Oh1qmU9PNCVZSs37kJiNjZELKKtSMJV3icvc1P1ND3bOrlixnPc2qw X-Received: by 2002:a05:6402:3207:b0:42d:dba6:8ef0 with SMTP id g7-20020a056402320700b0042ddba68ef0mr42179932eda.410.1654722870110; Wed, 08 Jun 2022 14:14:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654722870; cv=none; d=google.com; s=arc-20160816; b=DjxSNkubEEoqWzlq34cY7WSYc0THHcqylBD0L5SIHVMFjBjkp2fBZ8qG3/QvUvKmLb WSUWUBxa/hB7unWZJiOlZa03MdSAXUbdOvjkxOLUTJY9DC7JcWo+tn6C5F43Qo2eaMIL OKMWYCQsRejRr1aOmnFISxPt0WvAlw4AqppUHUj9Iff/HW0bbeoxwAu1pXFlg6jaSL2y ZTgG4WmJxynl6YnCAn/106kQumpRX3djpYNArsWNgJMFfeVwSdEl+RxNjRjw26anVkeX LiWNvp4yXStEohQsQttXZ8QiQ5nr9hmzBC5wUnRvZyDHErE2CN6xX6/2USTcNJfD7O/R LKsA== 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=2mzoLHyElkoQenxSYW+zYz+EmR/xKnBhALzZ6D315gQ=; b=lStOJpz4kJkOu2dUpWG7xmDXeMPc8830BfNIPfmCPgbXKakylQVW3aNA2i6CaG/KQR /IU3/FMGbE5k5QgZAdN2HCvrT/4qv2bYu1vV8DqLpfdNcPLjJoX6PXI4Tb1Rd9VFSHeV S/8rzKPJDaEpa9QyLQsgA9PrA/hXrMbtRpJaiwkDsgdAD+VaZsDDP9E6E7CKoREGYGKr x9qCtrzau3i1lCdJ6h8cSe/byPOvBNAD90yN5JrEzioeLV+3jMnmTl5d8aI87UGtJ6sQ 0hsKTKwfNsZLf/TXNdVDBT5r+/POwu25vFKIsmIqTfCRS3TxViihEF95xatPbrBVkt68 SdFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=YNiGyGCm; 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 sy18-20020a1709076f1200b006df76385cb1si1839048ejc.337.2022.06.08.14.14.03; Wed, 08 Jun 2022 14:14:30 -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=YNiGyGCm; 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 S235317AbiFHUxt (ORCPT + 99 others); Wed, 8 Jun 2022 16:53:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233812AbiFHUxB (ORCPT ); Wed, 8 Jun 2022 16:53:01 -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 BFD7C1CC5D0 for ; Wed, 8 Jun 2022 13:52:59 -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 C81FD660180B; Wed, 8 Jun 2022 21:52:56 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1654721577; bh=dOKJizqx/fHYXj8qk/D8e8eM9at0JQtCb+3CVcme0hQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YNiGyGCme9YHOMcIev2ZMFL/JVDvALB45ep/pOYrZ6Wn5EduYIRB54eA8O2OH3xOX U6ph0YvuKSHWF0FiPjyw14hYeflkzYWIJuyBtiESibJEKMZsloAi9pVQjgDs4Okt+U 5IYjlMY2DCvTz2O3o4Q7CW3syoipUBPPSTzGf4K93jZtDi1q5xSm1znRS1k2uDeido 7h1G/jKbEqTXTiiaBCVB+ukzNKCE2Nyp30vF8wErs9P+P3jJXmFw0PauGgJkFhws/S 5uDTxJsNqGwUiGgU0c+74S9IXIkR8BntmOkc2NGiup0QN4AyKfoARQl2dcsUoMpq8n W8RLaLsqdsMNQ== 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 v2 7/8] drm/i915/ttm: trust snooping when gen 6+ when deciding default cache_level Date: Wed, 8 Jun 2022 20:51:30 +0000 Message-Id: <20220608205132.438596-8-bob.beckett@collabora.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220608205132.438596-1-bob.beckett@collabora.com> References: <20220608205132.438596-1-bob.beckett@collabora.com> MIME-Version: 1.0 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, so limit to gen6+ Signed-off-by: Robert Beckett --- 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..e6cce35edb65 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) && (GRAPHICS_VER(i915) > 5); + + 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