[Intel-gfx] [PATCH v2] drm/i915/mtl: Disable stolen memory backed FB for A0

Andrzej Hajda andrzej.hajda at intel.com
Wed Mar 15 15:28:29 UTC 2023


On 10.03.2023 10:45, Nirmoy Das wrote:
> 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 at intel.com>
> Cc: Andi Shyti <andi.shyti at linux.intel.com>
> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio at intel.com>
> Cc: Lucas De Marchi <lucas.demarchi at intel.com>
> Signed-off-by: Nirmoy Das <nirmoy.das at intel.com>
> Reviewed-by: Andi Shyti <andi.shyti at linux.intel.com>

Reviewed-by: Andrzej Hajda <andrzej.hajda at intel.com>

Regards
Andrzej
> ---
>   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;
>   }
>   



More information about the dri-devel mailing list