Commit ca921624 authored by Matthew Auld's avatar Matthew Auld Committed by Ramalingam C

drm/i915/xehpsdv: set min page-size to 64K

Conditionally allocate LMEM with 64K granularity, since 4K page support
for LMEM will be dropped on some platforms when using the PPGTT.

v2:
  updated commit msg [Thomas]
Signed-off-by: default avatarMatthew Auld <matthew.auld@intel.com>
Signed-off-by: default avatarStuart Summers <stuart.summers@intel.com>
Signed-off-by: default avatarRamalingam C <ramalingam.c@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: default avatarThomas Hellstrom <thomas.hellstrom@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211208154854.28037-1-ramalingam.c@intel.com
parent c83125bb
...@@ -780,6 +780,7 @@ i915_gem_stolen_lmem_setup(struct drm_i915_private *i915, u16 type, ...@@ -780,6 +780,7 @@ i915_gem_stolen_lmem_setup(struct drm_i915_private *i915, u16 type,
struct intel_uncore *uncore = &i915->uncore; struct intel_uncore *uncore = &i915->uncore;
struct pci_dev *pdev = to_pci_dev(i915->drm.dev); struct pci_dev *pdev = to_pci_dev(i915->drm.dev);
struct intel_memory_region *mem; struct intel_memory_region *mem;
resource_size_t min_page_size;
resource_size_t io_start; resource_size_t io_start;
resource_size_t lmem_size; resource_size_t lmem_size;
u64 lmem_base; u64 lmem_base;
...@@ -791,8 +792,11 @@ i915_gem_stolen_lmem_setup(struct drm_i915_private *i915, u16 type, ...@@ -791,8 +792,11 @@ i915_gem_stolen_lmem_setup(struct drm_i915_private *i915, u16 type,
lmem_size = pci_resource_len(pdev, 2) - lmem_base; lmem_size = pci_resource_len(pdev, 2) - lmem_base;
io_start = pci_resource_start(pdev, 2) + lmem_base; io_start = pci_resource_start(pdev, 2) + lmem_base;
min_page_size = HAS_64K_PAGES(i915) ? I915_GTT_PAGE_SIZE_64K :
I915_GTT_PAGE_SIZE_4K;
mem = intel_memory_region_create(i915, lmem_base, lmem_size, mem = intel_memory_region_create(i915, lmem_base, lmem_size,
I915_GTT_PAGE_SIZE_4K, io_start, min_page_size, io_start,
type, instance, type, instance,
&i915_region_stolen_lmem_ops); &i915_region_stolen_lmem_ops);
if (IS_ERR(mem)) if (IS_ERR(mem))
......
...@@ -197,6 +197,7 @@ static struct intel_memory_region *setup_lmem(struct intel_gt *gt) ...@@ -197,6 +197,7 @@ static struct intel_memory_region *setup_lmem(struct intel_gt *gt)
struct intel_uncore *uncore = gt->uncore; struct intel_uncore *uncore = gt->uncore;
struct pci_dev *pdev = to_pci_dev(i915->drm.dev); struct pci_dev *pdev = to_pci_dev(i915->drm.dev);
struct intel_memory_region *mem; struct intel_memory_region *mem;
resource_size_t min_page_size;
resource_size_t io_start; resource_size_t io_start;
resource_size_t lmem_size; resource_size_t lmem_size;
int err; int err;
...@@ -211,10 +212,12 @@ static struct intel_memory_region *setup_lmem(struct intel_gt *gt) ...@@ -211,10 +212,12 @@ static struct intel_memory_region *setup_lmem(struct intel_gt *gt)
if (GEM_WARN_ON(lmem_size > pci_resource_len(pdev, 2))) if (GEM_WARN_ON(lmem_size > pci_resource_len(pdev, 2)))
return ERR_PTR(-ENODEV); return ERR_PTR(-ENODEV);
min_page_size = HAS_64K_PAGES(i915) ? I915_GTT_PAGE_SIZE_64K :
I915_GTT_PAGE_SIZE_4K;
mem = intel_memory_region_create(i915, mem = intel_memory_region_create(i915,
0, 0,
lmem_size, lmem_size,
I915_GTT_PAGE_SIZE_4K, min_page_size,
io_start, io_start,
INTEL_MEMORY_LOCAL, INTEL_MEMORY_LOCAL,
0, 0,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment