Commit b4559a16 authored by Tom St Denis's avatar Tom St Denis Committed by Alex Deucher

drm/amd/amdgpu: remove vram_page_split kernel option (v3)

This option is no longer needed.  The default code paths
are now the only option.

v2: Add HPAGE support and a default for non contiguous maps
v3: Misread 512 pages as MiB ...
Signed-off-by: default avatarTom St Denis <tom.stdenis@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent f04bee34
...@@ -142,7 +142,6 @@ extern uint amdgpu_sdma_phase_quantum; ...@@ -142,7 +142,6 @@ extern uint amdgpu_sdma_phase_quantum;
extern char *amdgpu_disable_cu; extern char *amdgpu_disable_cu;
extern char *amdgpu_virtual_display; extern char *amdgpu_virtual_display;
extern uint amdgpu_pp_feature_mask; extern uint amdgpu_pp_feature_mask;
extern int amdgpu_vram_page_split;
extern int amdgpu_ngg; extern int amdgpu_ngg;
extern int amdgpu_prim_buf_per_se; extern int amdgpu_prim_buf_per_se;
extern int amdgpu_pos_buf_per_se; extern int amdgpu_pos_buf_per_se;
......
...@@ -973,13 +973,6 @@ static int amdgpu_device_check_arguments(struct amdgpu_device *adev) ...@@ -973,13 +973,6 @@ static int amdgpu_device_check_arguments(struct amdgpu_device *adev)
amdgpu_device_check_block_size(adev); amdgpu_device_check_block_size(adev);
if (amdgpu_vram_page_split != -1 && (amdgpu_vram_page_split < 16 ||
!is_power_of_2(amdgpu_vram_page_split))) {
dev_warn(adev->dev, "invalid VRAM page split (%d)\n",
amdgpu_vram_page_split);
amdgpu_vram_page_split = 1024;
}
ret = amdgpu_device_get_job_timeout_settings(adev); ret = amdgpu_device_get_job_timeout_settings(adev);
if (ret) { if (ret) {
dev_err(adev->dev, "invalid lockup_timeout parameter syntax\n"); dev_err(adev->dev, "invalid lockup_timeout parameter syntax\n");
......
...@@ -108,7 +108,6 @@ int amdgpu_vm_fragment_size = -1; ...@@ -108,7 +108,6 @@ int amdgpu_vm_fragment_size = -1;
int amdgpu_vm_block_size = -1; int amdgpu_vm_block_size = -1;
int amdgpu_vm_fault_stop = 0; int amdgpu_vm_fault_stop = 0;
int amdgpu_vm_debug = 0; int amdgpu_vm_debug = 0;
int amdgpu_vram_page_split = 512;
int amdgpu_vm_update_mode = -1; int amdgpu_vm_update_mode = -1;
int amdgpu_exp_hw_support = 0; int amdgpu_exp_hw_support = 0;
int amdgpu_dc = -1; int amdgpu_dc = -1;
...@@ -342,13 +341,6 @@ module_param_named(vm_debug, amdgpu_vm_debug, int, 0644); ...@@ -342,13 +341,6 @@ module_param_named(vm_debug, amdgpu_vm_debug, int, 0644);
MODULE_PARM_DESC(vm_update_mode, "VM update using CPU (0 = never (default except for large BAR(LB)), 1 = Graphics only, 2 = Compute only (default for LB), 3 = Both"); MODULE_PARM_DESC(vm_update_mode, "VM update using CPU (0 = never (default except for large BAR(LB)), 1 = Graphics only, 2 = Compute only (default for LB), 3 = Both");
module_param_named(vm_update_mode, amdgpu_vm_update_mode, int, 0444); module_param_named(vm_update_mode, amdgpu_vm_update_mode, int, 0444);
/**
* DOC: vram_page_split (int)
* Override the number of pages after we split VRAM allocations (default 512, -1 = disable). The default is 512.
*/
MODULE_PARM_DESC(vram_page_split, "Number of pages after we split VRAM allocations (default 512, -1 = disable)");
module_param_named(vram_page_split, amdgpu_vram_page_split, int, 0444);
/** /**
* DOC: exp_hw_support (int) * DOC: exp_hw_support (int)
* Enable experimental hw support (1 = enable). The default is 0 (disabled). * Enable experimental hw support (1 = enable). The default is 0 (disabled).
......
...@@ -284,17 +284,21 @@ static int amdgpu_vram_mgr_new(struct ttm_mem_type_manager *man, ...@@ -284,17 +284,21 @@ static int amdgpu_vram_mgr_new(struct ttm_mem_type_manager *man,
if (!lpfn) if (!lpfn)
lpfn = man->size; lpfn = man->size;
if (place->flags & TTM_PL_FLAG_CONTIGUOUS || if (place->flags & TTM_PL_FLAG_CONTIGUOUS) {
amdgpu_vram_page_split == -1) {
pages_per_node = ~0ul; pages_per_node = ~0ul;
num_nodes = 1; num_nodes = 1;
} else { } else {
pages_per_node = max((uint32_t)amdgpu_vram_page_split, #ifdef CONFIG_TRANSPARENT_HUGEPAGE
mem->page_alignment); pages_per_node = HPAGE_PMD_NR;
#else
/* default to 2MB */
pages_per_node = (2UL << (20UL - PAGE_SHIFT));
#endif
pages_per_node = max((uint32_t)pages_per_node, mem->page_alignment);
num_nodes = DIV_ROUND_UP(mem->num_pages, pages_per_node); num_nodes = DIV_ROUND_UP(mem->num_pages, pages_per_node);
} }
nodes = kvmalloc_array(num_nodes, sizeof(*nodes), nodes = kvmalloc_array((uint32_t)num_nodes, sizeof(*nodes),
GFP_KERNEL | __GFP_ZERO); GFP_KERNEL | __GFP_ZERO);
if (!nodes) if (!nodes)
return -ENOMEM; return -ENOMEM;
......
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