Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 688be01a authored by Alex Deucher's avatar Alex Deucher
Browse files

drm/amdgpu/gfx9: rework lbpw enable code



To avoid changing the global lbpw module parameter directly.

Reviewed-by: default avatarEvan Quan <evan.quan@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent c10caced
Loading
Loading
Loading
Loading
+12 −17
Original line number Diff line number Diff line
@@ -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;
		if (amdgpu_lbpw == 0)
			gfx_v9_0_enable_lbpw(adev, false);
		else
			gfx_v9_0_enable_lbpw(adev, true);
		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)
		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);