Skip to content

Commit 3001867

Browse files
committed
drm/amdgpu: fix size calculation with stolen vga memory
If we need to keep the stolen vga memory, make sure it is at least as big as the legacy vga size. Acked-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 64f2c15 commit 3001867

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,9 @@ void amdgpu_gmc_get_vbios_allocations(struct amdgpu_device *adev)
501501
else
502502
size = amdgpu_gmc_get_vbios_fb_size(adev);
503503

504+
if (adev->mman.keep_stolen_vga_memory)
505+
size = max(size, (unsigned)AMDGPU_VBIOS_VGA_ALLOCATION);
506+
504507
/* set to 0 if the pre-OS buffer uses up most of vram */
505508
if ((adev->gmc.real_vram_size - size) < (8 * 1024 * 1024))
506509
size = 0;

0 commit comments

Comments
 (0)