From patchwork Tue Apr 11 04:26:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yang, Fei" X-Patchwork-Id: 13207030 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 C506AC7619A for ; Tue, 11 Apr 2023 04:25:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B6A3510E493; Tue, 11 Apr 2023 04:24:58 +0000 (UTC) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTPS id C3FEB10E480; Tue, 11 Apr 2023 04:24:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681187095; x=1712723095; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=A4naRANSjsjYeplPa1kg1NbWiOttPOmgtjWLrvvRLew=; b=cRiG8Fbx4Z60hUR+bG1DCRtBHgQ0AB2xaBalNd/gFixHFnPrxvcHp7Ik q8WyvWJRBDPeIMKaA33Lm0mbn20/13fT/1yXKdaacgiWoMsMMSh4+yH/X aw/IWZys1lmm9G/yLZCIimFPn4/3LfeewCoIzebR3VCG5zCeRA45qwcBW hFJm6kPXUIpbYfpVnt6tOAYGlXhbQhFFxwRvwva2r1X7vRj6nKvZtBpUG A08oyhL0Fb+925iPlkudruAWJyw/+ax38pqR1nZ7x86RuSNeua+TxUzZo Q6ubV04keD+msQ8WfzCjeXFx1/KWkadzujdt7EH5juGzkgrzLm6OTAiUt A==; X-IronPort-AV: E=McAfee;i="6600,9927,10676"; a="343524163" X-IronPort-AV: E=Sophos;i="5.98,335,1673942400"; d="scan'208";a="343524163" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Apr 2023 21:24:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10676"; a="777763929" X-IronPort-AV: E=Sophos;i="5.98,335,1673942400"; d="scan'208";a="777763929" Received: from fyang16-desk.jf.intel.com ([10.24.96.243]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Apr 2023 21:24:55 -0700 From: fei.yang@intel.com To: intel-gfx@lists.freedesktop.org Subject: [PATCH 8/9] drm/i915: making mtl pte encode generic for gen12 Date: Mon, 10 Apr 2023 21:26:12 -0700 Message-Id: <20230411042613.3178711-9-fei.yang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230411042613.3178711-1-fei.yang@intel.com> References: <20230411042613.3178711-1-fei.yang@intel.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Matt Roper , Chris Wilson , Fei Yang , dri-devel@lists.freedesktop.org, Andi Shyti Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Fei Yang PTE encode is platform dependent. After replacing cache_level with pat_index, the newly introduced mtl_pte_encode is actually generic for all gen12 platforms, thus rename it to gen12_pte_encode and apply it to all gen12 platforms. Cc: Chris Wilson Cc: Matt Roper Cc: Andi Shyti Signed-off-by: Fei Yang --- drivers/gpu/drm/i915/gt/gen8_ppgtt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/gen8_ppgtt.c b/drivers/gpu/drm/i915/gt/gen8_ppgtt.c index f76ec2cb29ef..e393e20b5894 100644 --- a/drivers/gpu/drm/i915/gt/gen8_ppgtt.c +++ b/drivers/gpu/drm/i915/gt/gen8_ppgtt.c @@ -60,7 +60,7 @@ static u64 gen8_pte_encode(dma_addr_t addr, return pte; } -static u64 mtl_pte_encode(dma_addr_t addr, +static u64 gen12_pte_encode(dma_addr_t addr, unsigned int pat_index, u32 flags) { @@ -999,8 +999,8 @@ struct i915_ppgtt *gen8_ppgtt_create(struct intel_gt *gt, */ ppgtt->vm.alloc_scratch_dma = alloc_pt_dma; - if (GRAPHICS_VER_FULL(gt->i915) >= IP_VER(12, 70)) - ppgtt->vm.pte_encode = mtl_pte_encode; + if (GRAPHICS_VER(gt->i915) >= 12) + ppgtt->vm.pte_encode = gen12_pte_encode; else ppgtt->vm.pte_encode = gen8_pte_encode;