Skip to content

Commit 4d2f6b4

Browse files
John Olenderalexdeucher
authored andcommitted
drm/amdgpu: amdgpu_vram_mgr_new(): Clamp lpfn to total vram
The drm_mm allocator tolerated being passed end > mm->size, but the drm_buddy allocator does not. Restore the pre-buddy-allocator behavior of allowing such placements. Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3448 Signed-off-by: John Olender <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: Arunpravin Paneer Selvam <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected]
1 parent bf394d2 commit 4d2f6b4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ static int amdgpu_vram_mgr_new(struct ttm_resource_manager *man,
463463
int r;
464464

465465
lpfn = (u64)place->lpfn << PAGE_SHIFT;
466-
if (!lpfn)
466+
if (!lpfn || lpfn > man->size)
467467
lpfn = man->size;
468468

469469
fpfn = (u64)place->fpfn << PAGE_SHIFT;

0 commit comments

Comments
 (0)