[PATCH v3 1/1] drm/xe: correct the calculation of remaining size

Matt Roper matthew.d.roper at intel.com
Tue Jan 16 22:41:02 UTC 2024


On Tue, Jan 16, 2024 at 02:37:09PM -0800, fei.yang at intel.com wrote:
> From: Fei Yang <fei.yang at intel.com>
> 
> In function write_pgtable, the calculation of chunk in the do-while
> loop is wrong, we should always compare against remaining size instead
> of the total size update->qwords.
> 
> Signed-off-by: Fei Yang <fei.yang at intel.com>

Reviewed-by: Matt Roper <matthew.d.roper at intel.com>

> ---
>  drivers/gpu/drm/xe/xe_migrate.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_migrate.c b/drivers/gpu/drm/xe/xe_migrate.c
> index 44725f978f3e..d5392cbbdb49 100644
> --- a/drivers/gpu/drm/xe/xe_migrate.c
> +++ b/drivers/gpu/drm/xe/xe_migrate.c
> @@ -1116,7 +1116,7 @@ static void write_pgtable(struct xe_tile *tile, struct xe_bb *bb, u64 ppgtt_ofs,
>  	do {
>  		u64 addr = ppgtt_ofs + ofs * 8;
>  
> -		chunk = min(update->qwords, MAX_PTE_PER_SDI);
> +		chunk = min(size, MAX_PTE_PER_SDI);
>  
>  		/* Ensure populatefn can do memset64 by aligning bb->cs */
>  		if (!(bb->len & 1))
> -- 
> 2.25.1
> 

-- 
Matt Roper
Graphics Software Engineer
Linux GPU Platform Enablement
Intel Corporation


More information about the Intel-xe mailing list