diff options
author | Hawking Zhang <Hawking.Zhang@amd.com> | 2017-05-26 02:40:36 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-05-31 14:16:35 -0400 |
commit | e8835e0e43ecf0eba2e2810bee04ff39dabb8996 (patch) | |
tree | 5d28298d55bd5e54fd0d52e7058cf2549a5d8770 /drivers/gpu/drm | |
parent | ba7bb6658e638d2235ce5abf8a24a08c7a1eff60 (diff) |
drm/amdgpu: enable lbpw on raven
Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 19 |
3 files changed, 23 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index c01b8b62682b..a3576dbefa0f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h | |||
@@ -111,6 +111,7 @@ extern int amdgpu_pos_buf_per_se; | |||
111 | extern int amdgpu_cntl_sb_buf_per_se; | 111 | extern int amdgpu_cntl_sb_buf_per_se; |
112 | extern int amdgpu_param_buf_per_se; | 112 | extern int amdgpu_param_buf_per_se; |
113 | extern int amdgpu_job_hang_limit; | 113 | extern int amdgpu_job_hang_limit; |
114 | extern int amdgpu_lbpw; | ||
114 | 115 | ||
115 | #define AMDGPU_DEFAULT_GTT_SIZE_MB 3072ULL /* 3GB by default */ | 116 | #define AMDGPU_DEFAULT_GTT_SIZE_MB 3072ULL /* 3GB by default */ |
116 | #define AMDGPU_WAIT_IDLE_TIMEOUT_IN_MS 3000 | 117 | #define AMDGPU_WAIT_IDLE_TIMEOUT_IN_MS 3000 |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index 39432b0802f7..89867782acf0 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | |||
@@ -113,6 +113,7 @@ int amdgpu_pos_buf_per_se = 0; | |||
113 | int amdgpu_cntl_sb_buf_per_se = 0; | 113 | int amdgpu_cntl_sb_buf_per_se = 0; |
114 | int amdgpu_param_buf_per_se = 0; | 114 | int amdgpu_param_buf_per_se = 0; |
115 | int amdgpu_job_hang_limit = 0; | 115 | int amdgpu_job_hang_limit = 0; |
116 | int amdgpu_lbpw = -1; | ||
116 | 117 | ||
117 | MODULE_PARM_DESC(vramlimit, "Restrict VRAM for testing, in megabytes"); | 118 | MODULE_PARM_DESC(vramlimit, "Restrict VRAM for testing, in megabytes"); |
118 | module_param_named(vramlimit, amdgpu_vram_limit, int, 0600); | 119 | module_param_named(vramlimit, amdgpu_vram_limit, int, 0600); |
@@ -238,6 +239,8 @@ module_param_named(param_buf_per_se, amdgpu_param_buf_per_se, int, 0444); | |||
238 | MODULE_PARM_DESC(job_hang_limit, "how much time allow a job hang and not drop it (default 0)"); | 239 | MODULE_PARM_DESC(job_hang_limit, "how much time allow a job hang and not drop it (default 0)"); |
239 | module_param_named(job_hang_limit, amdgpu_job_hang_limit, int ,0444); | 240 | module_param_named(job_hang_limit, amdgpu_job_hang_limit, int ,0444); |
240 | 241 | ||
242 | MODULE_PARM_DESC(lbpw, "Load Balancing Per Watt (LBPW) support (1 = enable, 0 = disable, -1 = auto)"); | ||
243 | module_param_named(lbpw, amdgpu_lbpw, int, 0444); | ||
241 | 244 | ||
242 | static const struct pci_device_id pciidlist[] = { | 245 | static const struct pci_device_id pciidlist[] = { |
243 | #ifdef CONFIG_DRM_AMDGPU_SI | 246 | #ifdef CONFIG_DRM_AMDGPU_SI |
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c index b5aa537254d0..ec891b3f4a82 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | |||
@@ -683,6 +683,18 @@ static void gfx_v9_0_init_lbpw(struct amdgpu_device *adev) | |||
683 | mutex_unlock(&adev->grbm_idx_mutex); | 683 | mutex_unlock(&adev->grbm_idx_mutex); |
684 | } | 684 | } |
685 | 685 | ||
686 | static void gfx_v9_0_enable_lbpw(struct amdgpu_device *adev, bool enable) | ||
687 | { | ||
688 | uint32_t data = 0; | ||
689 | |||
690 | data = RREG32_SOC15(GC, 0, mmRLC_LB_CNTL); | ||
691 | if (enable) | ||
692 | data |= RLC_LB_CNTL__LOAD_BALANCE_ENABLE_MASK; | ||
693 | else | ||
694 | data &= ~RLC_LB_CNTL__LOAD_BALANCE_ENABLE_MASK; | ||
695 | WREG32_SOC15(GC, 0, mmRLC_LB_CNTL, data); | ||
696 | } | ||
697 | |||
686 | static void rv_init_cp_jump_table(struct amdgpu_device *adev) | 698 | static void rv_init_cp_jump_table(struct amdgpu_device *adev) |
687 | { | 699 | { |
688 | const __le32 *fw_data; | 700 | const __le32 *fw_data; |
@@ -2229,6 +2241,13 @@ static int gfx_v9_0_rlc_resume(struct amdgpu_device *adev) | |||
2229 | return r; | 2241 | return r; |
2230 | } | 2242 | } |
2231 | 2243 | ||
2244 | if (adev->asic_type == CHIP_RAVEN) { | ||
2245 | if (amdgpu_lbpw != 0) | ||
2246 | gfx_v9_0_enable_lbpw(adev, true); | ||
2247 | else | ||
2248 | gfx_v9_0_enable_lbpw(adev, false); | ||
2249 | } | ||
2250 | |||
2232 | gfx_v9_0_rlc_start(adev); | 2251 | gfx_v9_0_rlc_start(adev); |
2233 | 2252 | ||
2234 | return 0; | 2253 | return 0; |