drm/amdgpu: Fix the lpfn checking condition in drm buddy
authorMa Jun <Jun.Ma2@amd.com>
Wed, 14 Sep 2022 12:53:31 +0000 (20:53 +0800)
committerChristian König <christian.koenig@amd.com>
Tue, 8 Nov 2022 13:00:18 +0000 (14:00 +0100)
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@amd.com>
Suggested-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220914125331.2467162-1-Jun.Ma2@amd.com
Signed-off-by: Christian König <christian.koenig@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c

index 73a517b..80dd134 100644 (file)
@@ -435,7 +435,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;