summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2020-07-28 18:05:11 -0400
committerAlex Deucher <alexander.deucher@amd.com>2020-08-04 17:29:28 -0400
commit0635019412eb2db60fb1d34be8ed8225a0c70bd9 (patch)
tree4cb5d0f29e0fae0b9fb0c328f93c6b81c11cc2b8 /drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
parent5db62dc8d4f35dc11054f24ba2c86f6c3422918a (diff)
downloadlwn-0635019412eb2db60fb1d34be8ed8225a0c70bd9.tar.gz
lwn-0635019412eb2db60fb1d34be8ed8225a0c70bd9.zip
drm/amdgpu: add support for extended stolen vga memory
This will allow us to split the allocation for systems where we have to keep the stolen memory around to avoid S3 issues. This way we don't waste as much memory and still avoid any screen artifacts during the bios to driver transition. Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index fd61769202b3..ec975251b171 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -1915,7 +1915,7 @@ int amdgpu_ttm_init(struct amdgpu_device *adev)
uint64_t gtt_size;
int r;
u64 vis_vram_limit;
- void *stolen_vga_buf;
+ void *stolen_vga_buf, *stolen_extended_buf;
mutex_init(&adev->mman.gtt_window_lock);
@@ -1985,6 +1985,13 @@ int amdgpu_ttm_init(struct amdgpu_device *adev)
&stolen_vga_buf);
if (r)
return r;
+ r = amdgpu_bo_create_kernel_at(adev, adev->gmc.stolen_vga_size,
+ adev->gmc.stolen_extended_size,
+ AMDGPU_GEM_DOMAIN_VRAM,
+ &adev->gmc.stolen_extended_memory,
+ &stolen_extended_buf);
+ if (r)
+ return r;
DRM_INFO("amdgpu: %uM of VRAM memory ready\n",
(unsigned) (adev->gmc.real_vram_size / (1024 * 1024)));
@@ -2041,11 +2048,13 @@ int amdgpu_ttm_init(struct amdgpu_device *adev)
*/
void amdgpu_ttm_late_init(struct amdgpu_device *adev)
{
- void *stolen_vga_buf;
+ void *stolen_vga_buf, *stolen_extended_buf;
/* return the VGA stolen memory (if any) back to VRAM */
if (!adev->gmc.keep_stolen_vga_memory)
amdgpu_bo_free_kernel(&adev->gmc.stolen_vga_memory, NULL, &stolen_vga_buf);
+ amdgpu_bo_free_kernel(&adev->gmc.stolen_extended_memory, NULL,
+ &stolen_extended_buf);
}
/**