intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH v2] drm/i915/mtl: Disable stolen memory backed FB for A0
@ 2023-03-10  9:45 Nirmoy Das
  2023-03-15 14:53 ` [Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915/mtl: Disable stolen memory backed FB for A0 (rev2) Patchwork
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: Nirmoy Das @ 2023-03-10  9:45 UTC (permalink / raw)
  To: intel-gfx; +Cc: Lucas De Marchi, dri-devel, Matthew Auld, Nirmoy Das

Stolen memory is not usable for MTL A0 stepping beyond
certain access size and we have no control over userspace
access size of /dev/fb which can be backed by stolen memory.
So disable stolen memory backed fb by setting i915->dsm.usable_size
to zero.

v2: remove hsdes reference and fix commit message(Andi)

Cc: Matthew Auld <matthew.auld@intel.com>
Cc: Andi Shyti <andi.shyti@linux.intel.com>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
---
 drivers/gpu/drm/i915/gem/i915_gem_stolen.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_stolen.c b/drivers/gpu/drm/i915/gem/i915_gem_stolen.c
index d8e06e783e30..bf0f0a5f2a5c 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_stolen.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_stolen.c
@@ -535,6 +535,15 @@ static int i915_gem_init_stolen(struct intel_memory_region *mem)
 	/* Basic memrange allocator for stolen space. */
 	drm_mm_init(&i915->mm.stolen, 0, i915->dsm.usable_size);
 
+	/*
+	 * Access to stolen lmem beyond certain size for MTL A0 stepping
+	 * would crash the machine. Disable stolen lmem for userspace access
+	 * by setting usable_size to zero.
+	 */
+	if (IS_MTL_GRAPHICS_STEP(i915, M, STEP_A0, STEP_B0) ||
+	    IS_MTL_GRAPHICS_STEP(i915, P, STEP_A0, STEP_B0))
+		i915->dsm.usable_size = 0;
+
 	return 0;
 }
 
-- 
2.39.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-03-21 19:28 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-10  9:45 [Intel-gfx] [PATCH v2] drm/i915/mtl: Disable stolen memory backed FB for A0 Nirmoy Das
2023-03-15 14:53 ` [Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915/mtl: Disable stolen memory backed FB for A0 (rev2) Patchwork
2023-03-15 15:28 ` [Intel-gfx] [PATCH v2] drm/i915/mtl: Disable stolen memory backed FB for A0 Andrzej Hajda
2023-03-21  4:40 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/mtl: Disable stolen memory backed FB for A0 (rev4) Patchwork
2023-03-21  4:40 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2023-03-21  4:40 ` [Intel-gfx] ✗ Fi.CI.DOCS: " Patchwork
2023-03-21  4:50 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-03-21  8:18 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2023-03-21 14:27 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/mtl: Disable stolen memory backed FB for A0 (rev5) Patchwork
2023-03-21 14:27 ` [Intel-gfx] ✗ Fi.CI.DOCS: " Patchwork
2023-03-21 14:36 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-03-21 19:28 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).