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

Commit 775b0c11 authored by Huang Rui's avatar Huang Rui Committed by Alex Deucher
Browse files

drm/amd/powerplay: enable/disable gfxoff through smu

parent 9c822141
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -222,10 +222,19 @@ static int pp_set_powergating_state(void *handle,
{
{
	struct amdgpu_device *adev = handle;
	struct amdgpu_device *adev = handle;
	struct pp_hwmgr *hwmgr = adev->powerplay.pp_handle;
	struct pp_hwmgr *hwmgr = adev->powerplay.pp_handle;
	int ret;


	if (!hwmgr || !hwmgr->pm_en)
	if (!hwmgr || !hwmgr->pm_en)
		return 0;
		return 0;


	if (hwmgr->hwmgr_func->gfx_off_control) {
		/* Enable/disable GFX off through SMU */
		ret = hwmgr->hwmgr_func->gfx_off_control(hwmgr,
							 state == AMD_PG_STATE_GATE);
		if (ret)
			pr_err("gfx off control failed!\n");
	}

	if (hwmgr->hwmgr_func->enable_per_cu_power_gating == NULL) {
	if (hwmgr->hwmgr_func->enable_per_cu_power_gating == NULL) {
		pr_info("%s was not implemented.\n", __func__);
		pr_info("%s was not implemented.\n", __func__);
		return 0;
		return 0;