[PATCH 24/26] drm/i915: fixup the initial fb base on DG1

Matthew Auld matthew.auld at intel.com
Fri Feb 11 11:14:29 UTC 2022


The offset we get looks to be the exact start of DSM, but the
inital_plane_vma expects the address to be relative.

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  | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_plane_initial.c b/drivers/gpu/drm/i915/display/intel_plane_initial.c
index 380032d28aae..5589504cf933 100644
--- a/drivers/gpu/drm/i915/display/intel_plane_initial.c
+++ b/drivers/gpu/drm/i915/display/intel_plane_initial.c
@@ -54,10 +54,19 @@ initial_plane_vma(struct drm_i915_private *i915,
 	if (plane_config->size == 0)
 		return NULL;
 
-	base = round_down(plane_config->base,
-			  I915_GTT_MIN_ALIGNMENT);
-	size = round_up(plane_config->base + plane_config->size,
-			I915_GTT_MIN_ALIGNMENT);
+	/*
+	 * On DG1 the initial fb should be located in DSM, but the probed
+	 * address is not relative for some reason(we were likely meant to just
+	 * treat it as part of LMEM, but for now let's just play along). On
+	 * future discrete devices this should instead be placed in normal
+	 * LMEM, and not DSM.
+	 */
+	base = plane_config->base;
+	if (IS_DG1(i915))
+		base -= i915->dsm.start;
+
+	base = round_down(base, I915_GTT_MIN_ALIGNMENT);
+	size = round_up(base + plane_config->size, I915_GTT_MIN_ALIGNMENT);
 	size -= base;
 
 	/*
-- 
2.34.1



More information about the Intel-gfx-trybot mailing list