[PATCH 25/26] drm/i915: use LMEM for the initial fb on DG2+

Matthew Auld matthew.auld at intel.com
Mon Feb 14 10:12:28 UTC 2022


On DG2+ the initial-fb shouldn't be placed anywhere close to DSM, and so
should just be allocated directly from LMEM. With this there should
hopefully be nothing in stolen local memory that potentially needs CPU
access, where we might also need to support small BAR.

Signed-off-by: Matthew Auld <matthew.auld at intel.com>
Cc: Thomas Hellström <thomas.hellstrom at linux.intel.com>
---
 .../gpu/drm/i915/display/intel_plane_initial.c   | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_plane_initial.c b/drivers/gpu/drm/i915/display/intel_plane_initial.c
index 6c0ab36848df..090e922b24fc 100644
--- a/drivers/gpu/drm/i915/display/intel_plane_initial.c
+++ b/drivers/gpu/drm/i915/display/intel_plane_initial.c
@@ -47,11 +47,22 @@ static struct i915_vma *
 initial_plane_vma(struct drm_i915_private *i915,
 		  struct intel_initial_plane_config *plane_config)
 {
-	struct intel_memory_region *mem = i915->mm.stolen_region;
+	struct intel_memory_region *mem;
 	struct drm_i915_gem_object *obj;
 	struct i915_vma *vma;
 	u32 base, size;
 
+	/*
+	 * FIXME: We should try to unify all discrete platforms. Likely we would
+	 * need to ditch the whole DSM thing and just make it part of LMEM,
+	 * ensuring that we still reserve the parts that are only for HW use,
+	 * and possibly create a small memory pool for fbc.
+	 */
+	if (IS_DGFX(i915) && !IS_DG1(i915))
+		mem = i915->mm.regions[INTEL_MEMORY_LOCAL];
+	else
+		mem = i915->mm.stolen_region;
+
 	if (!mem || plane_config->size == 0)
 		return NULL;
 
@@ -79,8 +90,7 @@ initial_plane_vma(struct drm_i915_private *i915,
 	    size * 2 > i915->stolen_usable_size)
 		return NULL;
 
-	obj = i915_gem_object_create_region_at(i915->mm.stolen_region,
-					       base, size, 0);
+	obj = i915_gem_object_create_region_at(mem, base, size, 0);
 	if (IS_ERR(obj))
 		return NULL;
 
-- 
2.34.1



More information about the Intel-gfx-trybot mailing list