diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2020-12-07 19:12:29 +0100 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2020-12-09 16:06:40 +0100 |
commit | 157fe68d74c2ad2db438c91af9ed3d3a51de4ed7 (patch) | |
tree | 9bad07835944cc9d845ad442809f4fef8840dd82 /drivers | |
parent | drm/amd/pm: update smu10.h WORKLOAD_PPLIB setting for raven (diff) | |
download | linux-157fe68d74c2ad2db438c91af9ed3d3a51de4ed7.tar.xz linux-157fe68d74c2ad2db438c91af9ed3d3a51de4ed7.zip |
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 <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c index 36604d751d62..3e4892b7b7d3 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c @@ -499,6 +499,9 @@ void amdgpu_gmc_get_vbios_allocations(struct amdgpu_device *adev) else size = amdgpu_gmc_get_vbios_fb_size(adev); + if (adev->mman.keep_stolen_vga_memory) + size = max(size, (unsigned)AMDGPU_VBIOS_VGA_ALLOCATION); + /* set to 0 if the pre-OS buffer uses up most of vram */ if ((adev->gmc.real_vram_size - size) < (8 * 1024 * 1024)) size = 0; |