drm/amdgpu: Use dpm_enabled as the dpm state flag
Subsystems (2)
PATCH 1/1 drm/amdgpu: Use dpm_enabled as the dpm state flag
driver will set dpm_enabled to true only when
module paramter amdgpu_dpm not set to 0 and
smu initialize successfully.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 2 +- drivers/gpu/drm/amd/amdgpu/ci_dpm.c | 2 +- drivers/gpu/drm/amd/amdgpu/kv_dpm.c | 2 +- drivers/gpu/drm/amd/amdgpu/si_dpm.c | 2 +- drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c | 4 ++-- drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c | 3 ++- 7 files changed, 9 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +1 -1
@@ -465,7 +465,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 */
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +1 -1
@@ -704,7 +704,7 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_filestruct 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) {
drivers/gpu/drm/amd/amdgpu/ci_dpm.c +1 -1
@@ -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 */
drivers/gpu/drm/amd/amdgpu/kv_dpm.c +1 -1
@@ -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);
drivers/gpu/drm/amd/amdgpu/si_dpm.c +1 -1
@@ -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);
drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c +2 -2
@@ -688,7 +688,7 @@ static int uvd_v4_2_set_powergating_state(void *handle,if (state ==AMD_PG_STATE_GATE ) {uvd_v4_2_stop (adev); -if (adev->pg_flags &AMD_PG_SUPPORT_UVD && amdgpu_dpm ==0 ) { +if (adev->pg_flags &AMD_PG_SUPPORT_UVD && !adev->pm.dpm_enabled) {if (!(RREG32_SMC (ixCURRENT_PG_STATUS) &CURRENT_PG_STATUS__UVD_PG_STATUS_MASK )) { WREG32(mmUVD_PGFSM_CONFIG, (UVD_PGFSM_CONFIG__UVD_PGFSM_FSM_ADDR_MASK |
@@ -699,7 +699,7 @@ static int uvd_v4_2_set_powergating_state(void *handle, }return 0 ; }else { -if (adev->pg_flags &AMD_PG_SUPPORT_UVD && amdgpu_dpm ==0 ) { +if (adev->pg_flags &AMD_PG_SUPPORT_UVD && !adev->pm.dpm_enabled) {if (RREG32_SMC (ixCURRENT_PG_STATUS) &CURRENT_PG_STATUS__UVD_PG_STATUS_MASK ) { WREG32(mmUVD_PGFSM_CONFIG, (UVD_PGFSM_CONFIG__UVD_PGFSM_FSM_ADDR_MASK |
drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c +2 -1
@@ -211,7 +211,6 @@ int hwmgr_hw_init(struct pp_hwmgr *hwmgr) !hwmgr->pptable_func->pptable_init || !hwmgr->hwmgr_func->backend_init) { hwmgr->pm_en = false; - ((struct amdgpu_device *)hwmgr->adev)->pm.dpm_enabled = false;pr_info ("dpm not supported \n" );return 0 ; }
@@ -240,6 +239,8 @@ int hwmgr_hw_init(struct pp_hwmgr *hwmgr)if (ret) goto err2; + ((struct amdgpu_device *)hwmgr->adev)->pm.dpm_enabled = true; +return 0 ; err2:if (hwmgr->hwmgr_func->backend_fini)
Signature · 6 lines
1.9.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1522052612-26964-1-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org
Quan, Evan
Reviewed-by Evan QuanQuoted 154 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Rex Zhu
Sent: Monday, March 26, 2018 4:24 PM
To: [email protected]
Cc: Zhu, Rex <[email protected]>
Subject: [PATCH] drm/amdgpu: Usedpm_enabledas the dpm state flagdriver will set
dpm_enabledto true only when module paramteramdgpu_dpmnot set to 0 and smu initialize successfully.Change-Id Ic835dc93e0cfdfc2be7d10109d0c63b3cc4c2dffSigned-off-by Rex Zhu <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 2 +- drivers/gpu/drm/amd/amdgpu/ci_dpm.c | 2 +- drivers/gpu/drm/amd/amdgpu/kv_dpm.c | 2 +- drivers/gpu/drm/amd/amdgpu/si_dpm.c | 2 +- drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c | 4 ++-- drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c | 3 ++- 7 files changed, 9 insertions(+), 8 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +1
-1@@ -465,7 +465,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 ;drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +0
-0/* convert offset to sensor number */ drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +0
-0@@ -704,7 +704,7 @@ static int amdgpu_info_ioctl(struct drm_device *dev,void *data, struct
drm_filedrivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +1
-1struct 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) {drivers/gpu/drm/amd/amdgpu/ci_dpm.c +1
-1@@ -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 */ diff --git
a/drivers/gpu/drm/amd/amdgpu/kv_dpm.cb/drivers/gpu/drm/amd/amdgpu/kv_dpm.c
index 26ba984..bc1720e 100644drivers/gpu/drm/amd/amdgpu/kv_dpm.c +1
-1@@ -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);drivers/gpu/drm/amd/amdgpu/si_dpm.c +1
-1@@ -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);drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c +1
-1@@ -688,7 +688,7 @@ static int uvd_v4_2_set_powergating_state(void *handle, if (state == AMD_PG_STATE_GATE) {uvd_v4_2_stop (adev); -if (adev->pg_flags &AMD_PG_SUPPORT_UVD && amdgpu_dpm == 0) { +if (adev->pg_flags &AMD_PG_SUPPORT_UVD && !adev- >pm.dpm_enabled) {if (!(RREG32_SMC(ixCURRENT_PG_STATUS) &
CURRENT_PG_STATUS__UVD_PG_STATUS_MASK)) {WREG32(mmUVD_PGFSM_CONFIG,
(UVD_PGFSM_CONFIG__UVD_PGFSM_FSM_ADDR_MASK|drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c +1
-1@@ -699,7 +699,7 @@ static int uvd_v4_2_set_powergating_state(void *handle, }return 0 ; }else { -if (adev->pg_flags &AMD_PG_SUPPORT_UVD && amdgpu_dpm == 0) { +if (adev->pg_flags &AMD_PG_SUPPORT_UVD && !adev- >pm.dpm_enabled) {if (
RREG32_SMC(ixCURRENT_PG_STATUS)&CURRENT_PG_STATUS__UVD_PG_STATUS_MASK) {WREG32(mmUVD_PGFSM_CONFIG,
(UVD_PGFSM_CONFIG__UVD_PGFSM_FSM_ADDR_MASK|drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c +0
-1@@ -211,7 +211,6 @@ int hwmgr_hw_init(struct pp_hwmgr *hwmgr) !hwmgr->pptable_func->pptable_init || !hwmgr->hwmgr_func->backend_init) { hwmgr->pm_en = false; - ((struct amdgpu_device *)hwmgr->adev)- >pm.dpm_enabled = false;pr_info ("dpm not supported \n" );return 0 ;drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c +2
-1}@@ -240,6 +239,8 @@ int hwmgr_hw_init(struct pp_hwmgr *hwmgr)if (ret) goto err2; + ((struct amdgpu_device *)hwmgr->adev)->pm.dpm_enabled = true; +return 0 ; err2:if (hwmgr->hwmgr_func->backend_fini) --1.9.1
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Huang Rui
Reviewed-byQuoted 4 lines · Rex Zhu
driver will set
dpm_enabledto true only when
module paramteramdgpu_dpmnot set to 0 and
smu initialize successfully.
Quoted 127 lines
Change-Id Ic835dc93e0cfdfc2be7d10109d0c63b3cc4c2dffSigned-off-by Rex Zhu <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 2 +- drivers/gpu/drm/amd/amdgpu/ci_dpm.c | 2 +- drivers/gpu/drm/amd/amdgpu/kv_dpm.c | 2 +- drivers/gpu/drm/amd/amdgpu/si_dpm.c | 2 +- drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c | 4 ++-- drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c | 3 ++- 7 files changed, 9 insertions(+), 8 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +1
-1@@ -465,7 +465,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 */ drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +1
-1@@ -704,7 +704,7 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_filestruct 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) {drivers/gpu/drm/amd/amdgpu/ci_dpm.c +1
-1@@ -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 */ drivers/gpu/drm/amd/amdgpu/kv_dpm.c +1
-1@@ -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);drivers/gpu/drm/amd/amdgpu/si_dpm.c +1
-1@@ -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);drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c +2
-2@@ -688,7 +688,7 @@ static int uvd_v4_2_set_powergating_state(void *handle,if (state ==AMD_PG_STATE_GATE ) {uvd_v4_2_stop (adev); -if (adev->pg_flags &AMD_PG_SUPPORT_UVD && amdgpu_dpm ==0 ) { +if (adev->pg_flags &AMD_PG_SUPPORT_UVD && !adev->pm.dpm_enabled) {if (!(RREG32_SMC (ixCURRENT_PG_STATUS) &CURRENT_PG_STATUS__UVD_PG_STATUS_MASK )) { WREG32(mmUVD_PGFSM_CONFIG, (UVD_PGFSM_CONFIG__UVD_PGFSM_FSM_ADDR_MASK |@@ -699,7 +699,7 @@ static int uvd_v4_2_set_powergating_state(void *handle, }return 0 ; }else { -if (adev->pg_flags &AMD_PG_SUPPORT_UVD && amdgpu_dpm ==0 ) { +if (adev->pg_flags &AMD_PG_SUPPORT_UVD && !adev->pm.dpm_enabled) {if (RREG32_SMC (ixCURRENT_PG_STATUS) &CURRENT_PG_STATUS__UVD_PG_STATUS_MASK ) { WREG32(mmUVD_PGFSM_CONFIG, (UVD_PGFSM_CONFIG__UVD_PGFSM_FSM_ADDR_MASK |drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c +2
-1@@ -211,7 +211,6 @@ int hwmgr_hw_init(struct pp_hwmgr *hwmgr) !hwmgr->pptable_func->pptable_init || !hwmgr->hwmgr_func->backend_init) { hwmgr->pm_en = false; - ((struct amdgpu_device *)hwmgr->adev)->pm.dpm_enabled = false;pr_info ("dpm not supported \n" );return 0 ; }@@ -240,6 +239,8 @@ int hwmgr_hw_init(struct pp_hwmgr *hwmgr)if (ret) goto err2; + ((struct amdgpu_device *)hwmgr->adev)->pm.dpm_enabled = true; +return 0 ; err2:if (hwmgr->hwmgr_func->backend_fini)Signature · 6 lines
1.9.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx