diff options
author | Amber Lin <Amber.Lin@amd.com> | 2018-08-23 10:52:34 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-08-28 12:51:11 -0400 |
commit | 521fb7d021f7952aa3030e56c19edf342309cf9f (patch) | |
tree | b8cb899572b8e2ccb9562d7708de3d328b06a345 /drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | |
parent | 82b7b619c44c5cd5b92134cbb58bd62558079ba4 (diff) |
drm/amdgpu: Move KFD parameters to amdgpu (v3)
After merging KFD into amdgpu, move module parameters defined in KFD to
amdgpu_drv.c, where other module parameters are declared.
v2: add kernel-doc comments
v3: rebase and fix parameter variable name (Alex)
Signed-off-by: Amber Lin <Amber.Lin@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index 2221f6b1dd7c..82e6b6746511 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #include "amdgpu_gem.h" | 39 | #include "amdgpu_gem.h" |
40 | 40 | ||
41 | #include "amdgpu_amdkfd.h" | 41 | #include "amdgpu_amdkfd.h" |
42 | #include "kfd_priv.h" | ||
42 | 43 | ||
43 | /* | 44 | /* |
44 | * KMS wrapper. | 45 | * KMS wrapper. |
@@ -127,6 +128,16 @@ int amdgpu_compute_multipipe = -1; | |||
127 | int amdgpu_gpu_recovery = -1; /* auto */ | 128 | int amdgpu_gpu_recovery = -1; /* auto */ |
128 | int amdgpu_emu_mode = 0; | 129 | int amdgpu_emu_mode = 0; |
129 | uint amdgpu_smu_memory_pool_size = 0; | 130 | uint amdgpu_smu_memory_pool_size = 0; |
131 | /* KFD parameters */ | ||
132 | int sched_policy = KFD_SCHED_POLICY_HWS; | ||
133 | int hws_max_conc_proc = 8; | ||
134 | int cwsr_enable = 1; | ||
135 | int max_num_of_queues_per_device = KFD_MAX_NUM_OF_QUEUES_PER_DEVICE_DEFAULT; | ||
136 | int send_sigterm; | ||
137 | int debug_largebar; | ||
138 | int ignore_crat; | ||
139 | int noretry; | ||
140 | int halt_if_hws_hang; | ||
130 | 141 | ||
131 | /** | 142 | /** |
132 | * DOC: vramlimit (int) | 143 | * DOC: vramlimit (int) |
@@ -532,6 +543,91 @@ MODULE_PARM_DESC(smu_memory_pool_size, | |||
532 | "0x1 = 256Mbyte, 0x2 = 512Mbyte, 0x4 = 1 Gbyte, 0x8 = 2GByte"); | 543 | "0x1 = 256Mbyte, 0x2 = 512Mbyte, 0x4 = 1 Gbyte, 0x8 = 2GByte"); |
533 | module_param_named(smu_memory_pool_size, amdgpu_smu_memory_pool_size, uint, 0444); | 544 | module_param_named(smu_memory_pool_size, amdgpu_smu_memory_pool_size, uint, 0444); |
534 | 545 | ||
546 | /** | ||
547 | * DOC: sched_policy (int) | ||
548 | * Set scheduling policy. Default is HWS(hardware scheduling) with over-subscription. | ||
549 | * Setting 1 disables over-subscription. Setting 2 disables HWS and statically | ||
550 | * assigns queues to HQDs. | ||
551 | */ | ||
552 | module_param(sched_policy, int, 0444); | ||
553 | MODULE_PARM_DESC(sched_policy, | ||
554 | "Scheduling policy (0 = HWS (Default), 1 = HWS without over-subscription, 2 = Non-HWS (Used for debugging only)"); | ||
555 | |||
556 | /** | ||
557 | * DOC: hws_max_conc_proc (int) | ||
558 | * Maximum number of processes that HWS can schedule concurrently. The maximum is the | ||
559 | * number of VMIDs assigned to the HWS, which is also the default. | ||
560 | */ | ||
561 | module_param(hws_max_conc_proc, int, 0444); | ||
562 | MODULE_PARM_DESC(hws_max_conc_proc, | ||
563 | "Max # processes HWS can execute concurrently when sched_policy=0 (0 = no concurrency, #VMIDs for KFD = Maximum(default))"); | ||
564 | |||
565 | /** | ||
566 | * DOC: cwsr_enable (int) | ||
567 | * CWSR(compute wave store and resume) allows the GPU to preempt shader execution in | ||
568 | * the middle of a compute wave. Default is 1 to enable this feature. Setting 0 | ||
569 | * disables it. | ||
570 | */ | ||
571 | module_param(cwsr_enable, int, 0444); | ||
572 | MODULE_PARM_DESC(cwsr_enable, "CWSR enable (0 = Off, 1 = On (Default))"); | ||
573 | |||
574 | /** | ||
575 | * DOC: max_num_of_queues_per_device (int) | ||
576 | * Maximum number of queues per device. Valid setting is between 1 and 4096. Default | ||
577 | * is 4096. | ||
578 | */ | ||
579 | module_param(max_num_of_queues_per_device, int, 0444); | ||
580 | MODULE_PARM_DESC(max_num_of_queues_per_device, | ||
581 | "Maximum number of supported queues per device (1 = Minimum, 4096 = default)"); | ||
582 | |||
583 | /** | ||
584 | * DOC: send_sigterm (int) | ||
585 | * Send sigterm to HSA process on unhandled exceptions. Default is not to send sigterm | ||
586 | * but just print errors on dmesg. Setting 1 enables sending sigterm. | ||
587 | */ | ||
588 | module_param(send_sigterm, int, 0444); | ||
589 | MODULE_PARM_DESC(send_sigterm, | ||
590 | "Send sigterm to HSA process on unhandled exception (0 = disable, 1 = enable)"); | ||
591 | |||
592 | /** | ||
593 | * DOC: debug_largebar (int) | ||
594 | * Set debug_largebar as 1 to enable simulating large-bar capability on non-large bar | ||
595 | * system. This limits the VRAM size reported to ROCm applications to the visible | ||
596 | * size, usually 256MB. | ||
597 | * Default value is 0, diabled. | ||
598 | */ | ||
599 | module_param(debug_largebar, int, 0444); | ||
600 | MODULE_PARM_DESC(debug_largebar, | ||
601 | "Debug large-bar flag used to simulate large-bar capability on non-large bar machine (0 = disable, 1 = enable)"); | ||
602 | |||
603 | /** | ||
604 | * DOC: ignore_crat (int) | ||
605 | * Ignore CRAT table during KFD initialization. By default, KFD uses the ACPI CRAT | ||
606 | * table to get information about AMD APUs. This option can serve as a workaround on | ||
607 | * systems with a broken CRAT table. | ||
608 | */ | ||
609 | module_param(ignore_crat, int, 0444); | ||
610 | MODULE_PARM_DESC(ignore_crat, | ||
611 | "Ignore CRAT table during KFD initialization (0 = use CRAT (default), 1 = ignore CRAT)"); | ||
612 | |||
613 | /** | ||
614 | * DOC: noretry (int) | ||
615 | * This parameter sets sh_mem_config.retry_disable. Default value, 0, enables retry. | ||
616 | * Setting 1 disables retry. | ||
617 | * Retry is needed for recoverable page faults. | ||
618 | */ | ||
619 | module_param(noretry, int, 0644); | ||
620 | MODULE_PARM_DESC(noretry, | ||
621 | "Set sh_mem_config.retry_disable on Vega10 (0 = retry enabled (default), 1 = retry disabled)"); | ||
622 | |||
623 | /** | ||
624 | * DOC: halt_if_hws_hang (int) | ||
625 | * Halt if HWS hang is detected. Default value, 0, disables the halt on hang. | ||
626 | * Setting 1 enables halt on hang. | ||
627 | */ | ||
628 | module_param(halt_if_hws_hang, int, 0644); | ||
629 | MODULE_PARM_DESC(halt_if_hws_hang, "Halt if HWS hang is detected (0 = off (default), 1 = on)"); | ||
630 | |||
535 | static const struct pci_device_id pciidlist[] = { | 631 | static const struct pci_device_id pciidlist[] = { |
536 | #ifdef CONFIG_DRM_AMDGPU_SI | 632 | #ifdef CONFIG_DRM_AMDGPU_SI |
537 | {0x1002, 0x6780, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI}, | 633 | {0x1002, 0x6780, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI}, |