drm/amdgpu: Fix the lpfn checking condition in drm buddy
Subsystems (2)
PATCH 1/1 drm/amdgpu: Fix the lpfn checking condition in drm buddy
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 <[email protected]>
Suggested-by Christian König <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c +1 -1
@@ -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 ;
Signature · 1 line
2.25.1
Am 14.09.22 um 14:53 schrieb Ma Jun:
Quoted 5 lines
Because the value of
man->sizeis changed during suspend/resume process, usemgr->mm.sizeinstead ofman->sizehere for lpfn checking.Signed-off-by Ma Jun <[email protected]>Suggested-by Christian König <[email protected]>
Reviewed-by Christian König <[email protected]>
Quoted 17 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c +1
-1@@ -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 ;