aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2018-11-08 16:34:48 -0500
committerAlex Deucher <alexander.deucher@amd.com>2018-11-09 16:29:54 -0500
commit688be01a0ab7eeefb1cccf3ad1c59803276b5a12 (patch)
tree78c81a5d6f983b18d3357a2069b4302103c61e91 /drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
parentdrm/ttm: remove set but not used variable 'driver' (diff)
downloadlinux-dev-688be01a0ab7eeefb1cccf3ad1c59803276b5a12.tar.xz
linux-dev-688be01a0ab7eeefb1cccf3ad1c59803276b5a12.zip
drm/amdgpu/gfx9: rework lbpw enable code
To avoid changing the global lbpw module parameter directly. Reviewed-by: Evan Quan <evan.quan@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c29
1 files changed, 12 insertions, 17 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
index d6783ba2c9d0..c27caa144c57 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
@@ -2400,26 +2400,21 @@ static int gfx_v9_0_rlc_resume(struct amdgpu_device *adev)
return r;
}
- if (amdgpu_lbpw == -1) {
- switch (adev->asic_type) {
- case CHIP_RAVEN:
- amdgpu_lbpw = 1;
- break;
- case CHIP_VEGA20:
- amdgpu_lbpw = 0;
- break;
- default:
- amdgpu_lbpw = 0;
- break;
- }
- }
-
- if (adev->asic_type == CHIP_RAVEN ||
- adev->asic_type == CHIP_VEGA20) {
- if (amdgpu_lbpw != 0)
+ switch (adev->asic_type) {
+ case CHIP_RAVEN:
+ if (amdgpu_lbpw == 0)
+ gfx_v9_0_enable_lbpw(adev, false);
+ else
+ gfx_v9_0_enable_lbpw(adev, true);
+ break;
+ case CHIP_VEGA20:
+ if (amdgpu_lbpw > 0)
gfx_v9_0_enable_lbpw(adev, true);
else
gfx_v9_0_enable_lbpw(adev, false);
+ break;
+ default:
+ break;
}
adev->gfx.rlc.funcs->start(adev);