From patchwork Wed May 3 23:02:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yang, Fei" X-Patchwork-Id: 13230637 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 56FF7C77B7F for ; Wed, 3 May 2023 23:01:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 06B9010E36E; Wed, 3 May 2023 23:01:46 +0000 (UTC) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id 40BD810E165; Wed, 3 May 2023 23:01:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1683154901; x=1714690901; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=A28PQ/Do/esxePqchAD2ImFRH3iRH5hRR/Fh4zCcNac=; b=e9AE7oIIiy9xrKsaDoBj/m4TKx/4YvhnVDeWVFMRwM43e/du6dP/t9H8 U+Jx8/HYKrhpevdav1umrlJrViU/H6HZPi/DP/2JhUK7g8i+zL90zteyZ MuduDClALlrVHsVTmZaIE7H94BEIS/1MMP/rghOb0RfF9QRxDaCDwbO4T NZyMTqbAlbSdHP3Nb0aYxgY/uk/RcMrYIKwy4EDoGC5NPoCPtyuTx7oay IaF4Hqw9wdRnAyuGCDwD1/TlKckC7atXT1a0Waxtlqtor7k7PNbZerbLn YtJ5vaOZy1DBX9VBUTT0iGV0V+oU51g9u1uWzvdyIQJe5a/WusdCfvZt7 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10699"; a="350868542" X-IronPort-AV: E=Sophos;i="5.99,248,1677571200"; d="scan'208";a="350868542" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 May 2023 16:01:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10699"; a="943061854" X-IronPort-AV: E=Sophos;i="5.99,248,1677571200"; d="scan'208";a="943061854" Received: from fyang16-desk.jf.intel.com ([10.24.96.243]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 May 2023 16:01:11 -0700 From: fei.yang@intel.com To: intel-gfx@lists.freedesktop.org Subject: [PATCH v5 3/5] drm/i915: make sure correct pte encode is used Date: Wed, 3 May 2023 16:02:09 -0700 Message-Id: <20230503230211.2834340-4-fei.yang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230503230211.2834340-1-fei.yang@intel.com> References: <20230503230211.2834340-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 Signed-off-by: Fei Yang Reviewed-by: Andi Shyti --- drivers/gpu/drm/i915/gt/gen8_ppgtt.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/gen8_ppgtt.c b/drivers/gpu/drm/i915/gt/gen8_ppgtt.c index f2334a713c4e..d1e3d3b90e95 100644 --- a/drivers/gpu/drm/i915/gt/gen8_ppgtt.c +++ b/drivers/gpu/drm/i915/gt/gen8_ppgtt.c @@ -55,9 +55,9 @@ static u64 gen8_pte_encode(dma_addr_t addr, return pte; } -static u64 mtl_pte_encode(dma_addr_t addr, - unsigned int pat_index, - u32 flags) +static u64 gen12_pte_encode(dma_addr_t addr, + unsigned int pat_index, + u32 flags) { gen8_pte_t pte = addr | GEN8_PAGE_PRESENT | GEN8_PAGE_RW; @@ -995,8 +995,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;