Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp4146117iog; Tue, 21 Jun 2022 13:03:08 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tI7+ILGfMeH+x5O/AkHTQR6LG1Z4XQpBFs+wrI/oEc7LplvehXvWXAk07/MF/eE3S767DJ X-Received: by 2002:a17:907:761c:b0:6d6:e553:7bd1 with SMTP id jx28-20020a170907761c00b006d6e5537bd1mr27140875ejc.5.1655841788425; Tue, 21 Jun 2022 13:03:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655841788; cv=none; d=google.com; s=arc-20160816; b=cZq3bEcOkjogn71i/aEz+t7SuONeMrYNUN7dvyqSmoM7Jgub7e3awJa9ECMK9dUhkh wX+N3lhzOGsOWwNECDniOeMU6rFchmAOaBcOJVDRDnIT0ttJVAB29yV1B+yRGtAPL7SV R1b3+dSgXyzliYt3qtmamZqEo9sSO44nOK/+OYpOMbFazi0HPhbmHR9/7gT9NRNEl5B2 irK1EVz5kWLJIPyK/ql0sPDKQQOM4OpcBnD2KujAA/sAMsC4JLT1jcK1385D806/0Ds7 Lgb5WPsqjSwsSbJZdIopQfZcRyXBChUkjUx7dxV/7W+GobXJG0E6VnXfP3TmLZ6zMmwG r78g== 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=Qt/VoeFs1B6ZhyaQ2J22z98R7zaofKsenaI5ZqCWXnQwHShxADhYJvrP6APGDPyhaX 2YPUqpIA9s7UElcQX6EKP6oOWho/6tDtyXBKx0mJVhUiyqjE6EqN9TvFjwzt9EKEGW8u VP2rQJCOUo/K6s5Bv76g5YuJZuPeK7jfkUCj3C+NAePs5g8I/C/ub+B9lX13w/l4+nqD Ck9Z9culHyhGHiglwAnOb/pNm1pDQePgg9rORVojyQupZjOU1RKQvC8teMRBZIoVwJZV +VHl03fYDwdn4/tyUJTvFztrGWFCRNJzGkjkzN0sEw6BACYkjuyglrtJgCJDuI72vX0H 3uEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=cKfR42W8; 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 b6-20020a170906728600b00702d74826fbsi17871098ejl.85.2022.06.21.13.02.41; Tue, 21 Jun 2022 13:03:08 -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=cKfR42W8; 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 S1354199AbiFUUBi (ORCPT + 99 others); Tue, 21 Jun 2022 16:01:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352731AbiFUUBZ (ORCPT ); Tue, 21 Jun 2022 16:01:25 -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 CBEA829829 for ; Tue, 21 Jun 2022 13:01:15 -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 E411866017FD; Tue, 21 Jun 2022 21:01:13 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1655841674; bh=8vOVoJXWNBNoAe7uHxF6kK6AtRixKpYtIjs6ocUktn4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cKfR42W8QhvBEZgFjvCi9uu9Tu3me7dH9jzTgZ0qNvBBDZitpkEaRxby0bpdBeX5u S3MM+bnwnJYpA6GgJVcL/fbwGDKeazRBIfuzrm0clmt2kY/J+zTNTW9y/NulZ5FIl5 BNa0JAM9wZqI8nAsGGR9QdIw55GTban3BM6CQympWrPIuEiJ5ZAmimICd4yz29t9xb ao5pUKV651RAZUuVRS/D+TtJItJ2s9DMartS2IdzhqgW9uC9LcCSzwWUBucNTSgNmL eEdyPBvbfrRhG4K4mAdo5fCSDK7EYOZtPRu7Ok5Xr4fqtjK6DIPu5rMN/5q1abc+7v 9q5fwYPwNSnQA== 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 v8 03/10] drm/i915/ttm: only trust snooping for dgfx when deciding default cache_level Date: Tue, 21 Jun 2022 20:00:51 +0000 Message-Id: <20220621200058.3536182-4-bob.beckett@collabora.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220621200058.3536182-1-bob.beckett@collabora.com> References: <20220621200058.3536182-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 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