From patchwork Fri Oct 13 10:31:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nirmoy Das X-Patchwork-Id: 13420621 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3BC38CDB47E for ; Fri, 13 Oct 2023 10:32:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C3B0C10E5D4; Fri, 13 Oct 2023 10:32:01 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by gabe.freedesktop.org (Postfix) with ESMTPS id 028E210E5CD; Fri, 13 Oct 2023 10:31:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697193119; x=1728729119; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=X++2G+YUqWczaUzQS65eL9UdoWL/0d4/ZPEZXAE4zGc=; b=i+atOeMSP/J7MSyI0ypN6BPPJRX0K49tJQyMWfypVHjV6iAzbysNP+zy uorL+ktz4m/6oYlTvcWro76IUX/YwaURrpzcN80SPkHnZ8eHjbX/BdqWg 9yNE+j4N6FSEybIYP9B615nR3qXDTaYy74KTz1H4UPz1V5rPfNlkQwpI6 JWlUFsoyw8A6/lGSjxgOI2dGLwRlLLb9NRgreeYydS95ELCYvxtvDJHMf Hsu6MfMLBBJMn8qvxbw5P83am6Z5X/KKTfr2M5+SkLvaV3/O5szdfxGgf o0s92arzCu8hanW7XPf4NQX1rTLN/y9k0Hx62h6ZbxBDxv6OasLEsZ/pe A==; X-IronPort-AV: E=McAfee;i="6600,9927,10861"; a="3749859" X-IronPort-AV: E=Sophos;i="6.03,221,1694761200"; d="scan'208";a="3749859" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Oct 2023 03:31:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10861"; a="825014124" X-IronPort-AV: E=Sophos;i="6.03,221,1694761200"; d="scan'208";a="825014124" Received: from nirmoyda-desk.igk.intel.com ([10.102.138.190]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Oct 2023 03:31:49 -0700 From: Nirmoy Das To: intel-gfx@lists.freedesktop.org Date: Fri, 13 Oct 2023 12:31:40 +0200 Message-ID: <20231013103140.12192-1-nirmoy.das@intel.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Organization: Intel Deutschland GmbH, Registered Address: Am Campeon 10, 85579 Neubiberg, Germany, Commercial Register: Amtsgericht Muenchen HRB 186928 Subject: [Intel-gfx] [PATCH] drm/i915: Flush WC GGTT only on required platforms X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jonathan Cavitt , dri-devel@lists.freedesktop.org, Rodrigo Vivi , stable@vger.kernel.org, Matt Roper , Nirmoy Das Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" gen8_ggtt_invalidate() is only needed for limitted set of platforms where GGTT is mapped as WC otherwise this can cause unwanted side-effects on XE_HP platforms where GFX_FLSH_CNTL_GEN6 is not valid. Fixes: d2eae8e98d59 ("drm/i915/dg2: Drop force_probe requirement") Cc: Rodrigo Vivi Cc: Tvrtko Ursulin Cc: Joonas Lahtinen Cc: Jani Nikula Cc: Jonathan Cavitt Cc: John Harrison Cc: Andi Shyti Cc: # v6.2+ Suggested-by: Matt Roper Signed-off-by: Nirmoy Das Acked-by: Andi Shyti --- drivers/gpu/drm/i915/gt/intel_ggtt.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gt/intel_ggtt.c b/drivers/gpu/drm/i915/gt/intel_ggtt.c index 4d7d88b92632..c2858d434bce 100644 --- a/drivers/gpu/drm/i915/gt/intel_ggtt.c +++ b/drivers/gpu/drm/i915/gt/intel_ggtt.c @@ -197,13 +197,17 @@ void gen6_ggtt_invalidate(struct i915_ggtt *ggtt) static void gen8_ggtt_invalidate(struct i915_ggtt *ggtt) { + struct drm_i915_private *i915 = ggtt->vm.i915; struct intel_uncore *uncore = ggtt->vm.gt->uncore; /* * Note that as an uncached mmio write, this will flush the * WCB of the writes into the GGTT before it triggers the invalidate. + * + * Only perform this when GGTT is mapped as WC, see ggtt_probe_common(). */ - intel_uncore_write_fw(uncore, GFX_FLSH_CNTL_GEN6, GFX_FLSH_CNTL_EN); + if (!IS_GEN9_LP(i915) && GRAPHICS_VER(i915) < 11) + intel_uncore_write_fw(uncore, GFX_FLSH_CNTL_GEN6, GFX_FLSH_CNTL_EN); } static void guc_ggtt_invalidate(struct i915_ggtt *ggtt)