Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp605067iol; Thu, 9 Jun 2022 09:57:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlwP7OWDCmnFV6fzvnG26E/QRx5FG/w5S2aiAkYyVk3sHhoarWERYbion4W5n5YOHyS5ZZ X-Received: by 2002:a05:6402:4411:b0:42b:a773:4800 with SMTP id y17-20020a056402441100b0042ba7734800mr47107171eda.37.1654793834005; Thu, 09 Jun 2022 09:57:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654793834; cv=none; d=google.com; s=arc-20160816; b=hFLIUzHEaf6kENZcmXx2g+fEjsRGiHoNtl5GK2fu/hfb7656mmibyPfOl4aFKnT5Np JukGTKI6IIJrj/ARAntaxDyd/gbL4mFIQUCSxoW3UA4e3RyjSq9TV+dH5TcEzXS9s/sY F6M/Tzlsqjrct8OwErxj5Qvnj2q9GwkBNx1qIhiX/lpz8nz7zqF16NeVJVt92m1J0j7j aqpCviizPz3rJV1exkf11mFtcJHuuvCXZaVQaEXsf8acD9diNJnvh3EYbj8d0t1ChJYJ rqr0f7nWcdlrO9GEw2yCFrItj+UeEkGzY4G43B9qz5vQpvcBv9rijHYHoRTcdZpfLpnw Uo/g== 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=ORQKW0ezgbOQeC+yXe3+60dUwkiT+Knp545DqgAN728=; b=Oqxhw3WzwhccaRxVJ8jcP6Ep65trdJ/Qm2bs299wGoYfonoJmtSde8batbqvt9rr6x 7jJzEO8TvK3wwNbneC0pk3pCOaROWL/eYyHuBy1W6iXxO5a3yYznPRdMjFg0iII94lLQ ioBaX8NWc0ky0pesI5rqNFr3iNYniiAX5N5+fcjAIkRKbd/bBJWmIR/ROWmnVspLua68 lYgU9UkliOuH1QXEltjXIHN/zOs0Mk5098m0HRpNYnljfS0xUu2LsQF9toZ2BmCsfz+D WfHD7Ry1OX9XZM1+if3hK/BLn+gwdRfXL5lJVU00kYMhW1NP4oplcyIjwL4+1yK0eRod g+3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Xihi5B5e; 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 w14-20020a05640234ce00b0042fac061a54si23449866edc.513.2022.06.09.09.56.37; Thu, 09 Jun 2022 09:57:13 -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=Xihi5B5e; 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 S1344836AbiFIQxJ (ORCPT + 99 others); Thu, 9 Jun 2022 12:53:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242030AbiFIQwc (ORCPT ); Thu, 9 Jun 2022 12:52:32 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DF3244A0A for ; Thu, 9 Jun 2022 09:52:30 -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 EBC5266017EC; Thu, 9 Jun 2022 17:52:27 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1654793548; bh=8vOVoJXWNBNoAe7uHxF6kK6AtRixKpYtIjs6ocUktn4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xihi5B5e5WHHgSAo6HedsLzSorg92CMGBrBGBqJ8uY5Rml9yp9GaLMXyJQd4zgYlx fQkX7x3wfEaMEqebyc8LVvxtzhtrGJRDpOF0bDzklafhaUfcCX23O6Y0FG45CJ4u+V 9zOdG/94nIeKMjWDxshowaCqawMaXhT+/+2yaSI3Hi3PVnw4MCDOqc8hBBfK8wKcKa BEC7VtPddb3oRQMdf4zH1YaSfRassGwea/vyR4N4hhYRB19ri/6DhRHtmDK4xToKwh Nvk1vqQij6fdjd2amg4aJN3DexdQdMb7j6sWxIa+0sGXNpb6Kg0AEpxvV5r1ZKCRCq v/4cMtg3TG6vA== 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 v3 7/8] drm/i915/ttm: only trust snooping for dgfx when deciding default cache_level Date: Thu, 9 Jun 2022 16:51:59 +0000 Message-Id: <20220609165200.842821-8-bob.beckett@collabora.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220609165200.842821-1-bob.beckett@collabora.com> References: <20220609165200.842821-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,URIBL_BLOCKED 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 --- 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