Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4120928imw; Thu, 7 Jul 2022 13:08:19 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uja3u6fw0Mr6DpyHACF0BgEuH6WSyfqmioKaEOuToABj8SvVZs0+BTsp6krvh3+DeJGSvp X-Received: by 2002:a63:1607:0:b0:412:8fc0:756b with SMTP id w7-20020a631607000000b004128fc0756bmr10617748pgl.142.1657224498805; Thu, 07 Jul 2022 13:08:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657224498; cv=none; d=google.com; s=arc-20160816; b=lHA2qdG0cbzk+e/7HJ/a3cxJ58IcN/PkIaFOwdOSYHDTw2umbIQEcmYPC6CcGuXxm1 MK1IX3ysLgpafDofKic/+0zflblbsGcU+2GfW6T2NIwXMBpJxMd86IJ2xHrHPsE8wY94 2CRub1nRoUz97sGoFQKsYwBQIckI0DPOxjMmfyU/r5z2Qbh4d4OEiOHaEux3G2uO44Zy B68KjYM+E2wngzjLeDrpgHCLCCYeZ3IupgaDNhH51aEdgeglROuKjSQl8vPpISJ57Z26 sNy3YSQaqc/ahe+hSULiTjvm4H4k5uFuKajX2VyECAvfG4W6WY9qwPqSEovRRyO83Ciz 3b1w== 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=eI2NYW+XC9xq+kGo7xh0SdNyOI+jC9q8ZaXcudidkntIkgzStDDNTQmZn1dmp/uGjr ejN+BSf6gY9tBI4607YH6zC4ONvy56z36PX5ZZx4+6TR7RhwbFv+HRtR0uTL9a4KbKQW NG1U1m147eKeOXbCAM1tn+TPPu/mvrgpvqaJBTRhbFtIdkzsC7WKhkgJwLH3l6/T1AOX u52rNMEPnL/0uqFUsVGlUu2DbO3U0JZnvFBvpsAWlTYAiSjxLgrxAEF4fDNLsW2umBr/ /GhSGNs2pIpQWuvGyqdmxYKkABeR9+flvAMs9xL9kGfGvOrMBEroTEpBzKSIm2OsgVew PtVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=dnSzpR2V; 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 q13-20020a056a00084d00b0051c44065606si24252672pfk.357.2022.07.07.13.08.06; Thu, 07 Jul 2022 13:08:18 -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=dnSzpR2V; 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 S236739AbiGGUCz (ORCPT + 99 others); Thu, 7 Jul 2022 16:02:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236744AbiGGUCr (ORCPT ); Thu, 7 Jul 2022 16:02:47 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E2BF1E3F2 for ; Thu, 7 Jul 2022 13:02:46 -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 247CD66019D1; Thu, 7 Jul 2022 21:02:45 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1657224165; bh=x5DY8lqdscLPNZjf5Ukvpn+M8BELAAg44M2twj/KzYc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dnSzpR2Vluyq95hA7h6IbToJQcYmv/0Euqnjfjf+LmuZhruMRFStGs3MVcJxZqS2K GAR2cyWytyFzinh5+mtZFpBM6AzMUNZ0/Sltc8kBnDXGmsACWax1GcVrgEFSC0u8wh D8tuiXBDBlYo3NkbyqF7x/Oo8DWA/Ek7Mq5z8kKxwkH6dqYXCVirAhggobqMFD8/cJ jPk01m14GFg4GdtIMCrXQMqT9FumaiIUpdmtPmyi9M+LaEHijvtQKNYi+J34bBONQ9 BJZfeAWqmZG8yk9OPqae1urnOwPrdbHbH3Z4sTlhITbLBXHNYfccc3NEh/0fE9yNPo 4w2R6LvVZA31g== 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 v10 03/11] drm/i915/ttm: only trust snooping for dgfx when deciding default cache_level Date: Thu, 7 Jul 2022 20:02:21 +0000 Message-Id: <20220707200230.1657555-4-bob.beckett@collabora.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220707200230.1657555-1-bob.beckett@collabora.com> References: <20220707200230.1657555-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