[Intel-gfx] [RFC 02/13] drm/i915/xehpsdv: set min page-size to 64K
Ayaz A Siddiqui
ayaz.siddiqui at intel.com
Sun Aug 22 16:26:55 UTC 2021
From: Matthew Auld <matthew.auld at intel.com>
LMEM should be allocated at 64K granularity, since 4K page support will
eventually be dropped for LMEM when using the PPGTT.
Signed-off-by: Matthew Auld <matthew.auld at intel.com>
Signed-off-by: Stuart Summers <stuart.summers at intel.com>
Signed-off-by: Ayaz A Siddiqui <ayaz.siddiqui at intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi at intel.com>
---
drivers/gpu/drm/i915/gem/i915_gem_stolen.c | 4 +++-
drivers/gpu/drm/i915/gt/intel_region_lmem.c | 4 +++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_stolen.c b/drivers/gpu/drm/i915/gem/i915_gem_stolen.c
index ddd37ccb1362..291fc3ec98de 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_stolen.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_stolen.c
@@ -780,6 +780,8 @@ i915_gem_stolen_lmem_setup(struct drm_i915_private *i915, u16 type,
struct intel_memory_region *mem;
resource_size_t io_start;
resource_size_t lmem_size;
+ resource_size_t min_page_size = HAS_64K_PAGES(i915) ?
+ I915_GTT_PAGE_SIZE_64K : I915_GTT_PAGE_SIZE_4K;
u64 lmem_base;
lmem_base = intel_uncore_read64(uncore, GEN12_DSMBASE);
@@ -790,7 +792,7 @@ i915_gem_stolen_lmem_setup(struct drm_i915_private *i915, u16 type,
io_start = pci_resource_start(pdev, 2) + lmem_base;
mem = intel_memory_region_create(i915, lmem_base, lmem_size,
- I915_GTT_PAGE_SIZE_4K, io_start,
+ min_page_size, io_start,
type, instance,
&i915_region_stolen_lmem_ops);
if (IS_ERR(mem))
diff --git a/drivers/gpu/drm/i915/gt/intel_region_lmem.c b/drivers/gpu/drm/i915/gt/intel_region_lmem.c
index a74b72f50cc9..4ea0ad9435df 100644
--- a/drivers/gpu/drm/i915/gt/intel_region_lmem.c
+++ b/drivers/gpu/drm/i915/gt/intel_region_lmem.c
@@ -195,6 +195,8 @@ static struct intel_memory_region *setup_lmem(struct intel_gt *gt)
struct intel_memory_region *mem;
resource_size_t io_start;
resource_size_t lmem_size;
+ resource_size_t min_page_size = HAS_64K_PAGES(i915) ?
+ I915_GTT_PAGE_SIZE_64K : I915_GTT_PAGE_SIZE_4K;
int err;
if (!IS_DGFX(i915))
@@ -210,7 +212,7 @@ static struct intel_memory_region *setup_lmem(struct intel_gt *gt)
mem = intel_memory_region_create(i915,
0,
lmem_size,
- I915_GTT_PAGE_SIZE_4K,
+ min_page_size,
io_start,
INTEL_MEMORY_LOCAL,
0,
--
2.26.2
More information about the Intel-gfx
mailing list