[PATCH] drm/amdgpu: Fix size calculation when init onchip memory

xinhui pan xinhui.pan at amd.com
Fri Oct 23 05:41:12 UTC 2020


Size is page count here.

Signed-off-by: xinhui pan <xinhui.pan at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index 4a85f8cedd77..11dd3d9eac15 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -65,11 +65,11 @@
 
 static int amdgpu_ttm_init_on_chip(struct amdgpu_device *adev,
 				    unsigned int type,
-				    uint64_t size)
+				    uint64_t size_in_page)
 {
 	return ttm_range_man_init(&adev->mman.bdev, type,
 				  TTM_PL_FLAG_UNCACHED, TTM_PL_FLAG_UNCACHED,
-				  false, size >> PAGE_SHIFT);
+				  false, size_in_page);
 }
 
 /**
-- 
2.25.1



More information about the amd-gfx mailing list