Commit fa732088 authored by Andi Shyti's avatar Andi Shyti Committed by Matthew Auld

drm/i915: Rename INTEL_REGION_LMEM with INTEL_REGION_LMEM_0

With the upcoming multitile support each tile will have its own
local memory. Mark the current LMEM with the suffix '0' to
emphasise that it belongs to the root tile.
Suggested-by: default avatarMichal Wajdeczko <michal.wajdeczko@intel.com>
Signed-off-by: default avatarAndi Shyti <andi.shyti@linux.intel.com>
Reviewed-by: default avatarMichal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: default avatarAndrzej Hajda <andrzej.hajda@intel.com>
Signed-off-by: default avatarMatthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220318233938.149744-2-andi.shyti@linux.intel.com
parent 6f270e14
...@@ -1981,7 +1981,7 @@ intel_user_framebuffer_create(struct drm_device *dev, ...@@ -1981,7 +1981,7 @@ intel_user_framebuffer_create(struct drm_device *dev,
/* object is backed with LMEM for discrete */ /* object is backed with LMEM for discrete */
i915 = to_i915(obj->base.dev); i915 = to_i915(obj->base.dev);
if (HAS_LMEM(i915) && !i915_gem_object_can_migrate(obj, INTEL_REGION_LMEM)) { if (HAS_LMEM(i915) && !i915_gem_object_can_migrate(obj, INTEL_REGION_LMEM_0)) {
/* object is "remote", not in local memory */ /* object is "remote", not in local memory */
i915_gem_object_put(obj); i915_gem_object_put(obj);
return ERR_PTR(-EREMOTE); return ERR_PTR(-EREMOTE);
......
...@@ -140,7 +140,7 @@ intel_pin_and_fence_fb_obj(struct drm_framebuffer *fb, ...@@ -140,7 +140,7 @@ intel_pin_and_fence_fb_obj(struct drm_framebuffer *fb,
if (!ret && phys_cursor) if (!ret && phys_cursor)
ret = i915_gem_object_attach_phys(obj, alignment); ret = i915_gem_object_attach_phys(obj, alignment);
else if (!ret && HAS_LMEM(dev_priv)) else if (!ret && HAS_LMEM(dev_priv))
ret = i915_gem_object_migrate(obj, &ww, INTEL_REGION_LMEM); ret = i915_gem_object_migrate(obj, &ww, INTEL_REGION_LMEM_0);
/* TODO: Do we need to sync when migration becomes async? */ /* TODO: Do we need to sync when migration becomes async? */
if (!ret) if (!ret)
ret = i915_gem_object_pin_pages(obj); ret = i915_gem_object_pin_pages(obj);
......
...@@ -72,7 +72,7 @@ initial_plane_vma(struct drm_i915_private *i915, ...@@ -72,7 +72,7 @@ initial_plane_vma(struct drm_i915_private *i915,
} }
phys_base = pte & I915_GTT_PAGE_MASK; phys_base = pte & I915_GTT_PAGE_MASK;
mem = i915->mm.regions[INTEL_REGION_LMEM]; mem = i915->mm.regions[INTEL_REGION_LMEM_0];
/* /*
* We don't currently expect this to ever be placed in the * We don't currently expect this to ever be placed in the
......
...@@ -100,7 +100,7 @@ __i915_gem_object_create_lmem_with_ps(struct drm_i915_private *i915, ...@@ -100,7 +100,7 @@ __i915_gem_object_create_lmem_with_ps(struct drm_i915_private *i915,
resource_size_t page_size, resource_size_t page_size,
unsigned int flags) unsigned int flags)
{ {
return i915_gem_object_create_region(i915->mm.regions[INTEL_REGION_LMEM], return i915_gem_object_create_region(i915->mm.regions[INTEL_REGION_LMEM_0],
size, page_size, flags); size, page_size, flags);
} }
...@@ -135,6 +135,6 @@ i915_gem_object_create_lmem(struct drm_i915_private *i915, ...@@ -135,6 +135,6 @@ i915_gem_object_create_lmem(struct drm_i915_private *i915,
resource_size_t size, resource_size_t size,
unsigned int flags) unsigned int flags)
{ {
return i915_gem_object_create_region(i915->mm.regions[INTEL_REGION_LMEM], return i915_gem_object_create_region(i915->mm.regions[INTEL_REGION_LMEM_0],
size, 0, flags); size, 0, flags);
} }
...@@ -88,7 +88,7 @@ static int igt_dmabuf_import_self(void *arg) ...@@ -88,7 +88,7 @@ static int igt_dmabuf_import_self(void *arg)
static int igt_dmabuf_import_same_driver_lmem(void *arg) static int igt_dmabuf_import_same_driver_lmem(void *arg)
{ {
struct drm_i915_private *i915 = arg; struct drm_i915_private *i915 = arg;
struct intel_memory_region *lmem = i915->mm.regions[INTEL_REGION_LMEM]; struct intel_memory_region *lmem = i915->mm.regions[INTEL_REGION_LMEM_0];
struct drm_i915_gem_object *obj; struct drm_i915_gem_object *obj;
struct drm_gem_object *import; struct drm_gem_object *import;
struct dma_buf *dmabuf; struct dma_buf *dmabuf;
...@@ -252,10 +252,10 @@ static int igt_dmabuf_import_same_driver_lmem_smem(void *arg) ...@@ -252,10 +252,10 @@ static int igt_dmabuf_import_same_driver_lmem_smem(void *arg)
struct drm_i915_private *i915 = arg; struct drm_i915_private *i915 = arg;
struct intel_memory_region *regions[2]; struct intel_memory_region *regions[2];
if (!i915->mm.regions[INTEL_REGION_LMEM]) if (!i915->mm.regions[INTEL_REGION_LMEM_0])
return 0; return 0;
regions[0] = i915->mm.regions[INTEL_REGION_LMEM]; regions[0] = i915->mm.regions[INTEL_REGION_LMEM_0];
regions[1] = i915->mm.regions[INTEL_REGION_SMEM]; regions[1] = i915->mm.regions[INTEL_REGION_SMEM];
return igt_dmabuf_import_same_driver(i915, regions, 2); return igt_dmabuf_import_same_driver(i915, regions, 2);
} }
......
...@@ -92,17 +92,17 @@ static int igt_create_migrate(struct intel_gt *gt, enum intel_region_id src, ...@@ -92,17 +92,17 @@ static int igt_create_migrate(struct intel_gt *gt, enum intel_region_id src,
static int igt_smem_create_migrate(void *arg) static int igt_smem_create_migrate(void *arg)
{ {
return igt_create_migrate(arg, INTEL_REGION_LMEM, INTEL_REGION_SMEM); return igt_create_migrate(arg, INTEL_REGION_LMEM_0, INTEL_REGION_SMEM);
} }
static int igt_lmem_create_migrate(void *arg) static int igt_lmem_create_migrate(void *arg)
{ {
return igt_create_migrate(arg, INTEL_REGION_SMEM, INTEL_REGION_LMEM); return igt_create_migrate(arg, INTEL_REGION_SMEM, INTEL_REGION_LMEM_0);
} }
static int igt_same_create_migrate(void *arg) static int igt_same_create_migrate(void *arg)
{ {
return igt_create_migrate(arg, INTEL_REGION_LMEM, INTEL_REGION_LMEM); return igt_create_migrate(arg, INTEL_REGION_LMEM_0, INTEL_REGION_LMEM_0);
} }
static int lmem_pages_migrate_one(struct i915_gem_ww_ctx *ww, static int lmem_pages_migrate_one(struct i915_gem_ww_ctx *ww,
...@@ -152,7 +152,7 @@ static int lmem_pages_migrate_one(struct i915_gem_ww_ctx *ww, ...@@ -152,7 +152,7 @@ static int lmem_pages_migrate_one(struct i915_gem_ww_ctx *ww,
} }
} else { } else {
err = i915_gem_object_migrate(obj, ww, INTEL_REGION_LMEM); err = i915_gem_object_migrate(obj, ww, INTEL_REGION_LMEM_0);
if (err) { if (err) {
pr_err("Object failed migration to lmem\n"); pr_err("Object failed migration to lmem\n");
if (err) if (err)
......
...@@ -76,7 +76,7 @@ int intel_gt_probe_lmem(struct intel_gt *gt) ...@@ -76,7 +76,7 @@ int intel_gt_probe_lmem(struct intel_gt *gt)
return err; return err;
} }
id = INTEL_REGION_LMEM; id = INTEL_REGION_LMEM_0;
mem->id = id; mem->id = id;
......
...@@ -17,7 +17,7 @@ static const struct { ...@@ -17,7 +17,7 @@ static const struct {
.class = INTEL_MEMORY_SYSTEM, .class = INTEL_MEMORY_SYSTEM,
.instance = 0, .instance = 0,
}, },
[INTEL_REGION_LMEM] = { [INTEL_REGION_LMEM_0] = {
.class = INTEL_MEMORY_LOCAL, .class = INTEL_MEMORY_LOCAL,
.instance = 0, .instance = 0,
}, },
......
...@@ -29,14 +29,14 @@ enum intel_memory_type { ...@@ -29,14 +29,14 @@ enum intel_memory_type {
enum intel_region_id { enum intel_region_id {
INTEL_REGION_SMEM = 0, INTEL_REGION_SMEM = 0,
INTEL_REGION_LMEM, INTEL_REGION_LMEM_0,
INTEL_REGION_STOLEN_SMEM, INTEL_REGION_STOLEN_SMEM,
INTEL_REGION_STOLEN_LMEM, INTEL_REGION_STOLEN_LMEM,
INTEL_REGION_UNKNOWN, /* Should be last */ INTEL_REGION_UNKNOWN, /* Should be last */
}; };
#define REGION_SMEM BIT(INTEL_REGION_SMEM) #define REGION_SMEM BIT(INTEL_REGION_SMEM)
#define REGION_LMEM BIT(INTEL_REGION_LMEM) #define REGION_LMEM BIT(INTEL_REGION_LMEM_0)
#define REGION_STOLEN_SMEM BIT(INTEL_REGION_STOLEN_SMEM) #define REGION_STOLEN_SMEM BIT(INTEL_REGION_STOLEN_SMEM)
#define REGION_STOLEN_LMEM BIT(INTEL_REGION_STOLEN_LMEM) #define REGION_STOLEN_LMEM BIT(INTEL_REGION_STOLEN_LMEM)
......
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