@@ -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;
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(-)