[PATCH 1/5] drm/ttm: fix eviction valuable range check.

Christian König christian.koenig at amd.com
Tue Oct 20 08:46:56 UTC 2020


Am 20.10.20 um 00:22 schrieb Dave Airlie:
> From: Dave Airlie <airlied at redhat.com>
>
> This was adding size to start, but pfn and start are in pages,
> so it should be using num_pages.
>
> Not sure this fixes anything in the real world, just noticed it
> during refactoring.

Oh, yes it most likely does!

> Signed-off-by: Dave Airlie <airlied at redhat.com>

Reviewed-by: Christian König <christian.koenig at amd.com>

CC stable?

> ---
>   drivers/gpu/drm/ttm/ttm_bo.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
> index cbc74a320db2..3101650c01b4 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo.c
> @@ -620,7 +620,7 @@ bool ttm_bo_eviction_valuable(struct ttm_buffer_object *bo,
>   	/* Don't evict this BO if it's outside of the
>   	 * requested placement range
>   	 */
> -	if (place->fpfn >= (bo->mem.start + bo->mem.size) ||
> +	if (place->fpfn >= (bo->mem.start + bo->mem.num_pages) ||
>   	    (place->lpfn && place->lpfn <= bo->mem.start))
>   		return false;
>   



More information about the dri-devel mailing list