diff options
author | Kevin Wang <kevin1.wang@amd.com> | 2020-01-02 13:59:17 +0800 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2020-01-07 11:58:44 -0500 |
commit | 4dee6e4ca50a6c8490b408906bb403dd6aebd721 (patch) | |
tree | 7be0d9c11337226d8010c83f276ad12a77ffda9e /drivers | |
parent | bd68fb94b3d4601b45a7e4558b9de0eebdb85ec1 (diff) |
drm/amdgpu: use linux size macro to simplify ONE_Kib & One_Mib
replace internal size macro with linux size macro
Signed-off-by: Kevin Wang <kevin1.wang@amd.com>
Reviewed-by: Tianci Yin <tianci.yin@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h | 7 |
2 files changed, 3 insertions, 10 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c index b2f8ba9e1f77..3114d8a47e88 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c @@ -1719,10 +1719,10 @@ static int amdgpu_ttm_training_reserve_vram_fini(struct amdgpu_device *adev) static u64 amdgpu_ttm_training_get_c2p_offset(u64 vram_size) { - if ((vram_size & (ONE_MiB - 1)) < (4 * ONE_KiB + 1) ) - vram_size -= ONE_MiB; + if ((vram_size & (SZ_1M - 1)) < (SZ_4K + 1) ) + vram_size -= SZ_1M; - return ALIGN(vram_size, ONE_MiB); + return ALIGN(vram_size, SZ_1M); } /** diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h index e8715287af04..0dddedc06ae3 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h @@ -66,13 +66,6 @@ struct amdgpu_copy_mem { unsigned long offset; }; -/* Definitions for constance */ -enum amdgpu_internal_constants -{ - ONE_KiB = 0x400, - ONE_MiB = 0x100000, -}; - extern const struct ttm_mem_type_manager_func amdgpu_gtt_mgr_func; extern const struct ttm_mem_type_manager_func amdgpu_vram_mgr_func; |