summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLijo Lazar <lijo.lazar@amd.com>2026-03-25 14:38:45 +0300
committerAlex Deucher <alexander.deucher@amd.com>2026-04-03 20:49:43 +0300
commit272a9c8f6f711c283f18aa954e54ede7ed32bdd8 (patch)
treeb99b5c5581b30d50f2db3085c39fb02c7a409071
parent941c50330ec4ab07b67abd37749da0687aadab1e (diff)
downloadlinux-272a9c8f6f711c283f18aa954e54ede7ed32bdd8.tar.xz
drm/amdgpu: Add stolen_reserved reserve-region
Use reserve region helpers for initializing/reserving stolen_reserved region. Signed-off-by: Lijo Lazar <lijo.lazar@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c7
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c10
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h4
3 files changed, 4 insertions, 17 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
index 4d066955be85..c3b83d9f110e 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
@@ -1041,9 +1041,6 @@ void amdgpu_gmc_get_vbios_allocations(struct amdgpu_device *adev)
* Some ASICs need to reserve a region of video memory to avoid access
* from driver
*/
- adev->mman.stolen_reserved_offset = 0;
- adev->mman.stolen_reserved_size = 0;
-
/*
* TODO:
* Currently there is a bug where some memory client outside
@@ -1060,8 +1057,8 @@ void amdgpu_gmc_get_vbios_allocations(struct amdgpu_device *adev)
*/
#ifdef CONFIG_X86
if (amdgpu_sriov_vf(adev) && hypervisor_is_type(X86_HYPER_MS_HYPERV)) {
- adev->mman.stolen_reserved_offset = 0x500000;
- adev->mman.stolen_reserved_size = 0x200000;
+ amdgpu_ttm_init_vram_resv(adev, AMDGPU_RESV_STOLEN_RESERVED,
+ 0x500000, 0x200000, false);
}
#endif
break;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index 256bf490ee15..30e2478cf474 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -2214,11 +2214,7 @@ int amdgpu_ttm_init(struct amdgpu_device *adev)
if (r)
return r;
- r = amdgpu_bo_create_kernel_at(adev,
- adev->mman.stolen_reserved_offset,
- adev->mman.stolen_reserved_size,
- &adev->mman.stolen_reserved_memory,
- NULL);
+ r = amdgpu_ttm_mark_vram_reserved(adev, AMDGPU_RESV_STOLEN_RESERVED);
if (r)
return r;
} else {
@@ -2342,9 +2338,7 @@ void amdgpu_ttm_fini(struct amdgpu_device *adev)
NULL);
amdgpu_bo_free_kernel(&adev->mman.fw_reserved_memory_extend, NULL,
NULL);
- if (adev->mman.stolen_reserved_size)
- amdgpu_bo_free_kernel(&adev->mman.stolen_reserved_memory,
- NULL, NULL);
+ amdgpu_ttm_unmark_vram_reserved(adev, AMDGPU_RESV_STOLEN_RESERVED);
}
amdgpu_bo_free_kernel(&adev->mman.sdma_access_bo, NULL,
&adev->mman.sdma_access_ptr);
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h
index b62f9208eb9a..63e8a7fe441d 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h
@@ -105,10 +105,6 @@ struct amdgpu_mman {
bool keep_stolen_vga_memory;
- struct amdgpu_bo *stolen_reserved_memory;
- uint64_t stolen_reserved_offset;
- uint64_t stolen_reserved_size;
-
/* fw reserved memory */
struct amdgpu_bo *fw_reserved_memory;
struct amdgpu_bo *fw_reserved_memory_extend;