[PATCH] drm/amdgpu: Fix the lpfn checking condition in drm buddy

Christian König christian.koenig at amd.com
Wed Sep 14 13:50:14 UTC 2022


Am 14.09.22 um 14:53 schrieb Ma Jun:
> Because the value of man->size is changed during suspend/resume process,
> use mgr->mm.size instead of man->size here for lpfn checking.
>
> Signed-off-by: Ma Jun <Jun.Ma2 at amd.com>
> Suggested-by: Christian König <christian.koenig at amd.com>

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

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
> index 48e3dc28b156..0b598b510bd8 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
> @@ -441,7 +441,7 @@ static int amdgpu_vram_mgr_new(struct ttm_resource_manager *man,
>   	if (place->flags & TTM_PL_FLAG_TOPDOWN)
>   		vres->flags |= DRM_BUDDY_TOPDOWN_ALLOCATION;
>   
> -	if (fpfn || lpfn != man->size)
> +	if (fpfn || lpfn != mgr->mm.size)
>   		/* Allocate blocks in desired range */
>   		vres->flags |= DRM_BUDDY_RANGE_ALLOCATION;
>   



More information about the amd-gfx mailing list