Otherwise amdgpu.vramlimit breaks on GFX10.3 because the BO offset is
out of bounds.

Signed-off-by: Natalie Vock <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index 3d620ec2937f4..b77c94178296e 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -1798,7 +1798,7 @@ static void amdgpu_ttm_init_mem_train_resv_region(struct 
amdgpu_device *adev)
                return;
 
        reserve_size = adev->mman.resv_region[AMDGPU_RESV_FW].size;
-       offset = ALIGN((adev->gmc.mc_vram_size - reserve_size - SZ_1M), SZ_1M);
+       offset = ALIGN((adev->gmc.real_vram_size - reserve_size - SZ_1M), 
SZ_1M);
        amdgpu_ttm_init_vram_resv(adev, AMDGPU_RESV_MEM_TRAIN,
                                  offset,
                                  GDDR6_MEM_TRAINING_DATA_SIZE_IN_BYTES,
-- 
2.55.0

Reply via email to