Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Kevin Wang and committed by
Alex Deucher
4dee6e4c bd68fb94

+3 -10
+3 -3
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
··· 1719 1719 1720 1720 static u64 amdgpu_ttm_training_get_c2p_offset(u64 vram_size) 1721 1721 { 1722 - if ((vram_size & (ONE_MiB - 1)) < (4 * ONE_KiB + 1) ) 1723 - vram_size -= ONE_MiB; 1722 + if ((vram_size & (SZ_1M - 1)) < (SZ_4K + 1) ) 1723 + vram_size -= SZ_1M; 1724 1724 1725 - return ALIGN(vram_size, ONE_MiB); 1725 + return ALIGN(vram_size, SZ_1M); 1726 1726 } 1727 1727 1728 1728 /**
-7
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h
··· 66 66 unsigned long offset; 67 67 }; 68 68 69 - /* Definitions for constance */ 70 - enum amdgpu_internal_constants 71 - { 72 - ONE_KiB = 0x400, 73 - ONE_MiB = 0x100000, 74 - }; 75 - 76 69 extern const struct ttm_mem_type_manager_func amdgpu_gtt_mgr_func; 77 70 extern const struct ttm_mem_type_manager_func amdgpu_vram_mgr_func; 78 71