diff mbox series

[8/8] drm/i915: fixup the initial fb on DG2

Message ID 20220304172333.991778-9-matthew.auld@intel.com (mailing list archive)
State New, archived
Headers show
Series Some more bits for small BAR enabling | expand

Commit Message

Matthew Auld March 4, 2022, 5:23 p.m. UTC
On DG2+ the initial fb shouldn't be placed anywhere close to DSM, and so
should just be allocated directly from LMEM.

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

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_plane_initial.c b/drivers/gpu/drm/i915/display/intel_plane_initial.c
index b39d3a8dfe45..5a3baeb620a6 100644
--- a/drivers/gpu/drm/i915/display/intel_plane_initial.c
+++ b/drivers/gpu/drm/i915/display/intel_plane_initial.c
@@ -68,8 +68,12 @@  initial_plane_vma(struct drm_i915_private *i915,
 		 * On future discrete HW, like DG2, we should be able to just
 		 * allocate directly from LMEM, due to larger LMEM size.
 		 */
-		if (base >= i915->dsm.start)
+		if (base >= i915->dsm.start) {
 			base -= i915->dsm.start;
+		} else {
+			WARN_ON_ONCE(IS_DG1(i915));
+			mem = i915->mm.regions[INTEL_REGION_LMEM];
+		}
 	}
 
 	size = roundup(base + plane_config->size, mem->min_page_size);
@@ -82,11 +86,11 @@  initial_plane_vma(struct drm_i915_private *i915,
 	 * features.
 	 */
 	if (IS_ENABLED(CONFIG_FRAMEBUFFER_CONSOLE) &&
+	    mem == i915->mm.stolen_region &&
 	    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;