Commit b13aa109 authored by Rex Zhu's avatar Rex Zhu Committed by Alex Deucher
Browse files

drm/amdgpu: Use dpm_enabled as dpm state flag



driver will set dpm_enabled to true only when
module parameter amdgpu_dpm not equal to 0 and
smu hw initialize successfully.

Reviewed-by: default avatarEvan Quan <evan.quan@amd.com>
Reviewed-by: default avatarHuang Rui <ray.huang@amd.com>
Signed-off-by: default avatarRex Zhu <Rex.Zhu@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 64f6db77
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -428,7 +428,7 @@ static ssize_t amdgpu_debugfs_sensor_read(struct file *f, char __user *buf,
	if (size & 3 || *pos & 0x3)
		return -EINVAL;

	if (amdgpu_dpm == 0)
	if (!adev->pm.dpm_enabled)
		return -EINVAL;

	/* convert offset to sensor number */
+1 −1
Original line number Diff line number Diff line
@@ -704,7 +704,7 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file
		struct pp_gpu_power query = {0};
		int query_size = sizeof(query);

		if (amdgpu_dpm == 0)
		if (!adev->pm.dpm_enabled)
			return -ENOENT;

		switch (info->sensor_info.type) {
+1 −1
Original line number Diff line number Diff line
@@ -6255,7 +6255,7 @@ static int ci_dpm_late_init(void *handle)
	int ret;
	struct amdgpu_device *adev = (struct amdgpu_device *)handle;

	if (!amdgpu_dpm)
	if (!adev->pm.dpm_enabled)
		return 0;

	/* init the sysfs and debugfs files late */
+1 −1
Original line number Diff line number Diff line
@@ -2974,7 +2974,7 @@ static int kv_dpm_late_init(void *handle)
	/* powerdown unused blocks for now */
	struct amdgpu_device *adev = (struct amdgpu_device *)handle;

	if (!amdgpu_dpm)
	if (!adev->pm.dpm_enabled)
		return 0;

	kv_dpm_powergate_acp(adev, true);
+1 −1
Original line number Diff line number Diff line
@@ -7580,7 +7580,7 @@ static int si_dpm_late_init(void *handle)
	int ret;
	struct amdgpu_device *adev = (struct amdgpu_device *)handle;

	if (!amdgpu_dpm)
	if (!adev->pm.dpm_enabled)
		return 0;

	ret = si_set_temperature_range(adev);
Loading