diff mbox series

[v2,1/3] drm/i915: Distinction of memory regions

Message ID 20210203141313.498462-1-matthew.auld@intel.com (mailing list archive)
State New, archived
Headers show
Series [v2,1/3] drm/i915: Distinction of memory regions | expand

Commit Message

Matthew Auld Feb. 3, 2021, 2:13 p.m. UTC
From: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>

In preparation for Xe HP multi-tile architecture with multiple memory
regions, we need to be able differentiate multiple instances of device
local-memory.

Note that the region name is just to give it a human friendly
identifier, instead of using class/instance which also uniquely
identifies the region. So far the region name is only for our own
internal debugging in the kernel(like in the selftests), or debugfs
which prints the list of regions, including the regions name.

v2: add commentary for our current region name use

Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
---
 drivers/gpu/drm/i915/gt/intel_gt.c          | 2 ++
 drivers/gpu/drm/i915/gt/intel_region_lmem.c | 2 --
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Chris Wilson Feb. 3, 2021, 2:44 p.m. UTC | #1
Quoting Matthew Auld (2021-02-03 14:13:11)
> From: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
> 
> In preparation for Xe HP multi-tile architecture with multiple memory
> regions, we need to be able differentiate multiple instances of device
> local-memory.
> 
> Note that the region name is just to give it a human friendly
> identifier, instead of using class/instance which also uniquely
> identifies the region. So far the region name is only for our own
> internal debugging in the kernel(like in the selftests), or debugfs
> which prints the list of regions, including the regions name.
> 
> v2: add commentary for our current region name use
> 
> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
> ---
>  drivers/gpu/drm/i915/gt/intel_gt.c          | 2 ++
>  drivers/gpu/drm/i915/gt/intel_region_lmem.c | 2 --
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gt/intel_gt.c b/drivers/gpu/drm/i915/gt/intel_gt.c
> index 35ff68ada4f1..ca76f93bc03d 100644
> --- a/drivers/gpu/drm/i915/gt/intel_gt.c
> +++ b/drivers/gpu/drm/i915/gt/intel_gt.c
> @@ -68,6 +68,8 @@ int intel_gt_probe_lmem(struct intel_gt *gt)
>         mem->type = INTEL_MEMORY_LOCAL;
>         mem->instance = 0;
>  
> +       intel_memory_region_set_name(mem, "local%u", mem->instance);
> +
>         GEM_BUG_ON(!HAS_REGION(i915, id));
>         GEM_BUG_ON(i915->mm.regions[id]);
>         i915->mm.regions[id] = mem;
> diff --git a/drivers/gpu/drm/i915/gt/intel_region_lmem.c b/drivers/gpu/drm/i915/gt/intel_region_lmem.c
> index 8c498e96b01d..be6f2c8f5184 100644
> --- a/drivers/gpu/drm/i915/gt/intel_region_lmem.c
> +++ b/drivers/gpu/drm/i915/gt/intel_region_lmem.c
> @@ -90,8 +90,6 @@ region_lmem_init(struct intel_memory_region *mem)
>         if (ret)
>                 io_mapping_fini(&mem->iomap);
>  
> -       intel_memory_region_set_name(mem, "local");

Ok. So in gt_probe_lmem we set up the struct, and in region_lmem_init()
we set up the HW interface and bookkeeping.

Moving the name to probe_lmem alongside the other naming makes sense,
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/gt/intel_gt.c b/drivers/gpu/drm/i915/gt/intel_gt.c
index 35ff68ada4f1..ca76f93bc03d 100644
--- a/drivers/gpu/drm/i915/gt/intel_gt.c
+++ b/drivers/gpu/drm/i915/gt/intel_gt.c
@@ -68,6 +68,8 @@  int intel_gt_probe_lmem(struct intel_gt *gt)
 	mem->type = INTEL_MEMORY_LOCAL;
 	mem->instance = 0;
 
+	intel_memory_region_set_name(mem, "local%u", mem->instance);
+
 	GEM_BUG_ON(!HAS_REGION(i915, id));
 	GEM_BUG_ON(i915->mm.regions[id]);
 	i915->mm.regions[id] = mem;
diff --git a/drivers/gpu/drm/i915/gt/intel_region_lmem.c b/drivers/gpu/drm/i915/gt/intel_region_lmem.c
index 8c498e96b01d..be6f2c8f5184 100644
--- a/drivers/gpu/drm/i915/gt/intel_region_lmem.c
+++ b/drivers/gpu/drm/i915/gt/intel_region_lmem.c
@@ -90,8 +90,6 @@  region_lmem_init(struct intel_memory_region *mem)
 	if (ret)
 		io_mapping_fini(&mem->iomap);
 
-	intel_memory_region_set_name(mem, "local");
-
 	return ret;
 }