[Intel-gfx] [PATCH 2/9] drm/i915: mark stolen as private

Matthew Auld matthew.auld at intel.com
Mon Apr 26 09:38:54 UTC 2021


In the next patch we want to expose the supported regions to userspace,
which can then be fed into the gem_create_ext placement extensions. For
now treat stolen memory as private from userspace pov.

Signed-off-by: Matthew Auld <matthew.auld at intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
Cc: Thomas Hellström <thomas.hellstrom at linux.intel.com>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio at intel.com>
Cc: Lionel Landwerlin <lionel.g.landwerlin at linux.intel.com>
Cc: Jon Bloomfield <jon.bloomfield at intel.com>
Cc: Jordan Justen <jordan.l.justen at intel.com>
Cc: Daniel Vetter <daniel.vetter at intel.com>
Cc: Kenneth Graunke <kenneth at whitecape.org>
Cc: Jason Ekstrand <jason at jlekstrand.net>
Cc: Dave Airlie <airlied at gmail.com>
Cc: dri-devel at lists.freedesktop.org
Cc: mesa-dev at lists.freedesktop.org
---
 drivers/gpu/drm/i915/gem/i915_gem_stolen.c | 4 ++++
 drivers/gpu/drm/i915/intel_memory_region.h | 1 +
 2 files changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_stolen.c b/drivers/gpu/drm/i915/gem/i915_gem_stolen.c
index c5b64b2400e8..3bcbb146511a 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_stolen.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_stolen.c
@@ -803,6 +803,8 @@ i915_gem_stolen_lmem_setup(struct drm_i915_private *i915)
 
 	intel_memory_region_set_name(mem, "stolen-local");
 
+	mem->private = true;
+
 	return mem;
 }
 
@@ -821,6 +823,8 @@ i915_gem_stolen_smem_setup(struct drm_i915_private *i915)
 
 	intel_memory_region_set_name(mem, "stolen-system");
 
+	mem->private = true;
+
 	return mem;
 }
 
diff --git a/drivers/gpu/drm/i915/intel_memory_region.h b/drivers/gpu/drm/i915/intel_memory_region.h
index 4c8ec15af55f..942fc4f68764 100644
--- a/drivers/gpu/drm/i915/intel_memory_region.h
+++ b/drivers/gpu/drm/i915/intel_memory_region.h
@@ -86,6 +86,7 @@ struct intel_memory_region {
 	u16 instance;
 	enum intel_region_id id;
 	char name[16];
+	bool private; /* not for userspace */
 
 	struct list_head reserved;
 
-- 
2.26.3



More information about the Intel-gfx mailing list