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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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@xxxxxxxxx>
> 
> 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;
> 



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux