Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp753609imw; Wed, 13 Jul 2022 07:24:51 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sVpMCSzuy7YGZg2z/HDYjYZpSD28XPGbJ1WaiGCIp0e4qWxNZjrftt3yQTxHxzEY060gZ5 X-Received: by 2002:a05:6402:90a:b0:439:c144:24cd with SMTP id g10-20020a056402090a00b00439c14424cdmr5317878edz.209.1657722291223; Wed, 13 Jul 2022 07:24:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657722291; cv=none; d=google.com; s=arc-20160816; b=d/xxlBHL0gyGiYSTySD+5KwZ5n5Q9wdOE8sPE5OjiJIPXKf+M82OiCPNwDS0ABZ1Sv stb0PgJF49GS2M5Zu8p0HBwXhgEIo+gbPbszHfnKzym3ZjSfBw6HQYwsuM8yWg4x/BDq ntkt0tKsP3A6jaJCciGg6Gk7u9owT83MytxW/+tyQbUGe4Pibo3P1UnR+LZwJX7nLK7I 5WwpuigABienpGu/iIUjs2SXhUoN55xDJsEQtlwWuHbabaq8st6xXDVAyJpyKeuHHW0Y gCv145WPrxzxx+IYjgsNLt1dFzo/5hYpQQdBsQFDVLB1W3CdG2Xll2sjZDw+8BpTs7PC tFBw== 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=x1gRfmgYkQKCenMh9dx1wxrti40mbyt7TsxhthkznPZxrQnz/UmQdyUbCQZYglOddA 0qnsGxnRwD8EI8MuRgF9Yt1CrmJHGoHCDIp+hLJuFOsivbarIzTrRvrT+ijfD7N/A9Su 48/rjKNYoa0lniSCA7PL+OO5gN0MV0nXkVtyivlkwdXB2uYtNAjciq2m0guASd+xPX4P qlNMyyIPUIhB+fkGiKjlXde7YCzFOkzZVL57k5SH9m8BIBEMnAZgVhzAyu3zXy4wx6/H Espkk5r0UN+v5yJ2dLek24FI23s79P5Fw0t5g+fPbzvUlMjlBXrg7aPZgWaqc9THw9Yc hFZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=JTFfNaDU; 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 c21-20020a056402159500b0043a2601173csi16080849edv.50.2022.07.13.07.24.26; Wed, 13 Jul 2022 07:24:51 -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=JTFfNaDU; 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 S236318AbiGMNuz (ORCPT + 99 others); Wed, 13 Jul 2022 09:50:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234407AbiGMNun (ORCPT ); Wed, 13 Jul 2022 09:50:43 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D997B20194 for ; Wed, 13 Jul 2022 06:50:42 -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 7469D6601A38; Wed, 13 Jul 2022 14:50:41 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1657720241; bh=MULA0VYW5/ZsE36/5dPbAjqG53dPkqcAhW75h7Y1TfQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JTFfNaDU7FfT14/gIP2iieKeArmXXf47HWVJQQJMYtPtRV478blFtL0Sj7aKfOZ8n cPSpr1c2/V/8gjQEpZSvW4R1DErWfyMRZuf+eF67I5OVPTxQMOctPhNxLN5Lq2Cdye 3eJC9A4y2wb65TG7I9yvmd7uV6RAC+DIjBS2FymWMce9TYiJjIHzUy9K1Mg7YS7NXf yvBkLeDXccpfcmq/u6UK5wNIeJQXekul42lYYr1753J+Wb2W0z0TggRThJUrkPcGE3 d/4zLDszgrXLvClgIKFxKGiMBnW/0UWh3aAWkq60lAXywAoNbOPLaYB9sP4ozOalAK b09pXqKNfYKbw== 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 v11 03/10] drm/i915/ttm: only trust snooping for dgfx when deciding default cache_level Date: Wed, 13 Jul 2022 14:50:15 +0100 Message-Id: <20220713135022.3710682-4-bob.beckett@collabora.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220713135022.3710682-1-bob.beckett@collabora.com> References: <20220713135022.3710682-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