[PATCH 2/3] drm/ttm: check with temporary GTT memory in BO validation

Christian König ckoenig.leichtzumerken at gmail.com
Mon May 31 09:04:56 UTC 2021



Am 31.05.21 um 10:22 schrieb Lang Yu:
> If a BO's backing store is temporary GTT memory, we should
> move it in BO validation.
>
> Signed-off-by: Lang Yu <Lang.Yu at amd.com>
> ---
>   drivers/gpu/drm/ttm/ttm_bo.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
> index c32a37d0a460..80c8cb2c3f31 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo.c
> @@ -944,6 +944,8 @@ static bool ttm_bo_places_compat(const struct ttm_place *places,
>   		if ((mem->start < heap->fpfn ||
>   		     (heap->lpfn != 0 && (mem->start + mem->num_pages) > heap->lpfn)))
>   			continue;
> +		if (mem->placement & TTM_PL_FLAG_TEMPORARY)
> +			continue;

Oh, good idea. But please move the check outside of the loop since mem 
never changes here we can return false right away.

Thanks,
Christian.

>   
>   		*new_flags = heap->flags;
>   		if ((mem->mem_type == heap->mem_type) &&



More information about the dri-devel mailing list