[PATCH 1/3] drm/i915: Fix HAS_REGION() usage in intel_gt_probe_lmem()

Rodrigo Vivi rodrigo.vivi at intel.com
Thu May 2 12:52:51 UTC 2024


On Thu, May 02, 2024 at 03:14:21PM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> 
> HAS_REGION() takes a bitmask, not the region ID. This causes the
> GEM_BUG_ON() to assert that the SMEM region is available rather
> than the intended LMEM region. No real harm since SMEM is always
> available, but also not checking what was intended.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>

Reviewed-by: Rodrigo Vivi <rodrigo.vivi at intel.com>

> ---
>  drivers/gpu/drm/i915/gt/intel_gt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/gt/intel_gt.c b/drivers/gpu/drm/i915/gt/intel_gt.c
> index 626b166e67ef..5a7ecf823ae6 100644
> --- a/drivers/gpu/drm/i915/gt/intel_gt.c
> +++ b/drivers/gpu/drm/i915/gt/intel_gt.c
> @@ -105,7 +105,7 @@ static int intel_gt_probe_lmem(struct intel_gt *gt)
>  
>  	intel_memory_region_set_name(mem, "local%u", mem->instance);
>  
> -	GEM_BUG_ON(!HAS_REGION(i915, id));
> +	GEM_BUG_ON(!HAS_REGION(i915, BIT(id)));
>  	GEM_BUG_ON(i915->mm.regions[id]);
>  	i915->mm.regions[id] = mem;
>  
> -- 
> 2.43.2
> 


More information about the Intel-gfx mailing list