Commit 030c5b52 authored by xinhui pan's avatar xinhui pan Committed by Dave Airlie

drm/amdgpu: Fix size calculation when init onchip memory

Size is page count here.

Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/1372Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarxinhui pan <xinhui.pan@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
(cherry picked from commit d836917d)
[airlied: from drm-next]
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 418baf2c
...@@ -69,10 +69,10 @@ static int amdgpu_ttm_backend_bind(struct ttm_bo_device *bdev, ...@@ -69,10 +69,10 @@ static int amdgpu_ttm_backend_bind(struct ttm_bo_device *bdev,
static int amdgpu_ttm_init_on_chip(struct amdgpu_device *adev, static int amdgpu_ttm_init_on_chip(struct amdgpu_device *adev,
unsigned int type, unsigned int type,
uint64_t size) uint64_t size_in_page)
{ {
return ttm_range_man_init(&adev->mman.bdev, type, return ttm_range_man_init(&adev->mman.bdev, type,
false, size >> PAGE_SHIFT); false, size_in_page);
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment