Skip to content

Commit

Permalink
drm/amdgpu/gfx9: rework lbpw enable code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alex Deucher committed Nov 9, 2018
1 parent c10cace commit 688be01
Showing 1 changed file with 12 additions and 17 deletions.
29 changes: 12 additions & 17 deletions drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 688be01

Please sign in to comment.