Commit 7101ab97 authored by Huang Rui's avatar Huang Rui Committed by Alex Deucher
Browse files

drm/amdgpu/pm: implement the SMU_MSG_EnableGfxImu function



GC v11_0_1 asic needs to issue the EnableGfxImu message after start IMU.

Signed-off-by: default avatarHuang Rui <ray.huang@amd.com>
Reviewed-by: default avatarTim Huang <Tim.Huang@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 8763e4c1
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -107,6 +107,20 @@ int amdgpu_dpm_set_powergating_by_smu(struct amdgpu_device *adev, uint32_t block
	return ret;
}

int amdgpu_dpm_set_gfx_power_up_by_imu(struct amdgpu_device *adev)
{
	struct smu_context *smu = adev->powerplay.pp_handle;
	int ret = -EOPNOTSUPP;

	mutex_lock(&adev->pm.mutex);
	ret = smu_set_gfx_power_up_by_imu(smu);
	mutex_unlock(&adev->pm.mutex);

	msleep(10);

	return ret;
}

int amdgpu_dpm_baco_enter(struct amdgpu_device *adev)
{
	const struct amd_pm_funcs *pp_funcs = adev->powerplay.pp_funcs;
+2 −0
Original line number Diff line number Diff line
@@ -386,6 +386,8 @@ int amdgpu_dpm_mode1_reset(struct amdgpu_device *adev);
int amdgpu_dpm_set_mp1_state(struct amdgpu_device *adev,
			     enum pp_mp1_state mp1_state);

int amdgpu_dpm_set_gfx_power_up_by_imu(struct amdgpu_device *adev);

int amdgpu_dpm_baco_exit(struct amdgpu_device *adev);

int amdgpu_dpm_baco_enter(struct amdgpu_device *adev);
+8 −1
Original line number Diff line number Diff line
@@ -134,6 +134,14 @@ int smu_get_dpm_freq_range(struct smu_context *smu,
	return ret;
}

int smu_set_gfx_power_up_by_imu(struct smu_context *smu)
{
	if (!smu->ppt_funcs && !smu->ppt_funcs->set_gfx_power_up_by_imu)
		return -EOPNOTSUPP;

	return smu->ppt_funcs->set_gfx_power_up_by_imu(smu);
}

static u32 smu_get_mclk(void *handle, bool low)
{
	struct smu_context *smu = handle;
@@ -2467,7 +2475,6 @@ static int smu_set_power_profile_mode(void *handle,
	return smu_bump_power_profile_mode(smu, param, param_size);
}


static int smu_get_fan_control_mode(void *handle, u32 *fan_mode)
{
	struct smu_context *smu = handle;
+7 −0
Original line number Diff line number Diff line
@@ -697,6 +697,11 @@ struct pptable_funcs {
	 */
	int (*dpm_set_jpeg_enable)(struct smu_context *smu, bool enable);

	/**
	 * @set_gfx_power_up_by_imu: Enable GFX engine with IMU
	 */
	int (*set_gfx_power_up_by_imu)(struct smu_context *smu);

	/**
	 * @read_sensor: Read data from a sensor.
	 * &sensor: Sensor to read data from.
@@ -1438,6 +1443,8 @@ int smu_get_dpm_freq_range(struct smu_context *smu, enum smu_clk_type clk_type,
int smu_set_soft_freq_range(struct smu_context *smu, enum smu_clk_type clk_type,
			    uint32_t min, uint32_t max);

int smu_set_gfx_power_up_by_imu(struct smu_context *smu);

int smu_set_ac_dc(struct smu_context *smu);

int smu_allow_xgmi_power_down(struct smu_context *smu, bool en);
+2 −0
Original line number Diff line number Diff line
@@ -292,6 +292,8 @@ int smu_v13_0_baco_enter(struct smu_context *smu);

int smu_v13_0_baco_exit(struct smu_context *smu);

int smu_v13_0_set_gfx_power_up_by_imu(struct smu_context *smu);

int smu_v13_0_od_edit_dpm_table(struct smu_context *smu,
				enum PP_OD_DPM_TABLE_COMMAND type,
				long input[],
Loading