[Intel-gfx] [PATCH v1 1/4] drm/i915: Move dsm assignment to be after adjustment

Iddamsetty, Aravind aravind.iddamsetty at intel.com
Fri Sep 16 11:57:18 UTC 2022



On 16-09-2022 02:09, Lucas De Marchi wrote:
> Reduce possible side effects of assigning the region and bailing out due
> to errors.
> 
> Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>
> 
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_stolen.c b/drivers/gpu/drm/i915/gem/i915_gem_stolen.c
> index acc561c0f0aa..42f4769bb4ac 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_stolen.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_stolen.c
> @@ -418,14 +418,14 @@ static int i915_gem_init_stolen(struct intel_memory_region *mem)
>  	if (resource_size(&mem->region) == 0)
>  		return 0;
>  
> -	i915->dsm = mem->region;
> -
> -	if (i915_adjust_stolen(i915, &i915->dsm))
> +	if (i915_adjust_stolen(i915, &mem->region))
>  		return 0;
>  
>  	GEM_BUG_ON(i915->dsm.start == 0);
>  	GEM_BUG_ON(i915->dsm.end <= i915->dsm.start);
>  
> +	i915->dsm = mem->region;

assignment should be above the GEM_BUG_ON.
but why don't you squash this into 3rd patch

thanks,
Aravind.
> +
>  	stolen_top = i915->dsm.end + 1;
>  	reserved_base = stolen_top;
>  	reserved_size = 0;
> 


More information about the Intel-gfx mailing list