[PATCH] ps64

Matthew Auld matthew.auld at intel.com
Wed Sep 21 12:01:26 UTC 2022


---
 drivers/gpu/drm/i915/gt/gen8_ppgtt.c | 23 ++++++++++-------------
 drivers/gpu/drm/i915/i915_pci.c      |  1 -
 2 files changed, 10 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/gen8_ppgtt.c b/drivers/gpu/drm/i915/gt/gen8_ppgtt.c
index c7bd5d71b03e..cc8ab2728fc5 100644
--- a/drivers/gpu/drm/i915/gt/gen8_ppgtt.c
+++ b/drivers/gpu/drm/i915/gt/gen8_ppgtt.c
@@ -463,6 +463,8 @@ gen8_ppgtt_insert_pte(struct i915_ppgtt *ppgtt,
 	return idx;
 }
 
+#define GEN12_PTE_PS64 BIT(8)
+
 static void
 xehpsdv_ppgtt_insert_huge(struct i915_address_space *vm,
 			  struct i915_vma_resource *vma_res,
@@ -506,21 +508,13 @@ xehpsdv_ppgtt_insert_huge(struct i915_address_space *vm,
 				GEM_BUG_ON(!IS_ALIGNED(iter->dma,
 						       I915_GTT_PAGE_SIZE_64K));
 
-				index = __gen8_pte_index(start, 0) / 16;
-				page_size = I915_GTT_PAGE_SIZE_64K;
-
-				max /= 16;
-
-				vaddr = px_vaddr(pd);
-				vaddr[__gen8_pte_index(start, 1)] |= GEN12_PDE_64K;
-
-				pt->is_compact = true;
-			} else {
-				GEM_BUG_ON(pt->is_compact);
-				index =  __gen8_pte_index(start, 0);
-				page_size = I915_GTT_PAGE_SIZE;
+				encode |= GEN12_PTE_PS64;
 			}
 
+			GEM_BUG_ON(pt->is_compact);
+			index =  __gen8_pte_index(start, 0);
+			page_size = I915_GTT_PAGE_SIZE;
+
 			vaddr = px_vaddr(pt);
 		}
 
@@ -548,6 +542,9 @@ xehpsdv_ppgtt_insert_huge(struct i915_address_space *vm,
 			}
 		} while (rem >= page_size && index < max);
 
+		if (encode & GEN12_PTE_PS64)
+			page_size = I915_GTT_PAGE_SIZE_64K;
+
 		vma_res->page_sizes_gtt |= page_size;
 	} while (iter->sg && sg_dma_len(iter->sg));
 }
diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
index 77e7df21f539..e1755c35b5c8 100644
--- a/drivers/gpu/drm/i915/i915_pci.c
+++ b/drivers/gpu/drm/i915/i915_pci.c
@@ -1063,7 +1063,6 @@ static const struct intel_device_info xehpsdv_info = {
 	.has_64k_pages = 1, \
 	.has_guc_deprivilege = 1, \
 	.has_heci_pxp = 1, \
-	.needs_compact_pt = 1, \
 	.has_media_ratio_mode = 1, \
 	.__runtime.platform_engine_mask = \
 		BIT(RCS0) | BIT(BCS0) | \
-- 
2.37.3



More information about the Intel-gfx-trybot mailing list