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

Configure Feed

Select the types of activity you want to include in your feed.

drm/amdgpu: Add memory training reserve-region

Use reserve region helpers for initializing/reserving memory training
region.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Lijo Lazar and committed by
Alex Deucher
bb92be60 4c616e84

+6 -10
-1
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h
··· 277 277 278 278 /*vram offset of the c2p training data*/ 279 279 u64 c2p_train_data_offset; 280 - struct amdgpu_bo *c2p_bo; 281 280 282 281 enum psp_memory_training_init_flag init; 283 282 u32 training_cnt;
+6 -9
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
··· 1745 1745 struct psp_memory_training_context *ctx = &adev->psp.mem_train_ctx; 1746 1746 1747 1747 ctx->init = PSP_MEM_TRAIN_NOT_SUPPORT; 1748 - amdgpu_bo_free_kernel(&ctx->c2p_bo, NULL, NULL); 1749 - ctx->c2p_bo = NULL; 1748 + amdgpu_ttm_unmark_vram_reserved(adev, AMDGPU_RESV_MEM_TRAIN); 1750 1749 1751 1750 return 0; 1752 1751 } ··· 1816 1817 if (mem_train_support) { 1817 1818 /* reserve vram for mem train according to TMR location */ 1818 1819 amdgpu_ttm_training_data_block_init(adev, reserve_size); 1819 - ret = amdgpu_bo_create_kernel_at(adev, 1820 - ctx->c2p_train_data_offset, 1821 - ctx->train_data_size, 1822 - &ctx->c2p_bo, 1823 - NULL); 1820 + amdgpu_ttm_init_vram_resv(adev, AMDGPU_RESV_MEM_TRAIN, 1821 + ctx->c2p_train_data_offset, 1822 + ctx->train_data_size, false); 1823 + ret = amdgpu_ttm_mark_vram_reserved(adev, AMDGPU_RESV_MEM_TRAIN); 1824 1824 if (ret) { 1825 - dev_err(adev->dev, "alloc c2p_bo failed(%d)!\n", ret); 1826 - amdgpu_ttm_training_reserve_vram_fini(adev); 1825 + dev_err(adev->dev, "memory training region reservation failed(%d)!\n", ret); 1827 1826 return ret; 1828 1827 } 1829 1828 ctx->init = PSP_MEM_TRAIN_RESERVE_SUCCESS;