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

Matthew Auld matthew.auld at intel.com
Thu Feb 10 15:28:25 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>
---
 drivers/gpu/drm/i915/display/intel_plane_initial.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_plane_initial.c b/drivers/gpu/drm/i915/display/intel_plane_initial.c
index 5589504cf933..f0053156affc 100644
--- a/drivers/gpu/drm/i915/display/intel_plane_initial.c
+++ b/drivers/gpu/drm/i915/display/intel_plane_initial.c
@@ -48,6 +48,7 @@ initial_plane_vma(struct drm_i915_private *i915,
 		  struct intel_initial_plane_config *plane_config)
 {
 	struct drm_i915_gem_object *obj;
+	struct intel_memory_region *mr;
 	struct i915_vma *vma;
 	u32 base, size;
 
@@ -78,8 +79,17 @@ 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);
+	/*
+	 * 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))
+		mr = i915->mm.regions[INTEL_MEMORY_LOCAL];
+	else
+		mr = i915->mm.stolen_region;
+	obj = i915_gem_object_create_region_at(mr, base, size, 0);
 	if (IS_ERR(obj))
 		return NULL;
 
-- 
2.34.1



More information about the Intel-gfx-trybot mailing list