drm/amdgpu: Parse module param amdgpu_dpm in check_arguments
Subsystems (2)
PATCH 1/1 drm/amdgpu: Parse module param amdgpu_dpm in check_arguments
Change-Id If9c30a51942ca6544d1f6fa411622ea8900befc0
Signed-off-by Rex Zhu <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 2 +- drivers/gpu/drm/amd/amdgpu/ci_dpm.c | 6 +++--- drivers/gpu/drm/amd/amdgpu/kv_dpm.c | 6 +++--- drivers/gpu/drm/amd/amdgpu/si_dpm.c | 6 +++--- drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c | 4 ++-- drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 2 +- 8 files changed, 16 insertions(+), 14 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_device.c +2 -0
@@ -862,6 +862,8 @@ static void amdgpu_device_check_arguments(struct amdgpu_device *adev) } adev->firmware.load_type =amdgpu_ucode_get_load_type (adev, amdgpu_fw_load_type); + + adev->pm.dpm_enabled = amdgpu_dpm ? true : false; }/**
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 +3 -3
@@ -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 */
@@ -6299,7 +6299,7 @@ static int ci_dpm_sw_init(void *handle)if (ret)return ret; -if (amdgpu_dpm ==0 ) +if (!adev->pm.dpm_enabled)return 0 ;INIT_WORK (&adev->pm.dpm.thermal.work, amdgpu_dpm_thermal_work_handler);
@@ -6344,7 +6344,7 @@ static int ci_dpm_hw_init(void *handle)struct amdgpu_device *adev = (struct amdgpu_device *)handle; -if (!amdgpu_dpm) { +if (!adev->pm.dpm_enabled) { ret =ci_upload_firmware (adev);if (ret) {DRM_ERROR ("ci_upload_firmware failed\n" );
drivers/gpu/drm/amd/amdgpu/kv_dpm.c +3 -3
@@ -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);
@@ -3008,7 +3008,7 @@ static int kv_dpm_sw_init(void *handle) adev->pm.current_mclk = adev->clock.default_mclk; adev->pm.int_thermal_type =THERMAL_TYPE_NONE ; -if (amdgpu_dpm ==0 ) +if (!adev->pm.dpm_enabled)return 0 ;INIT_WORK (&adev->pm.dpm.thermal.work, amdgpu_dpm_thermal_work_handler);
@@ -3049,7 +3049,7 @@ static int kv_dpm_hw_init(void *handle)int ret;struct amdgpu_device *adev = (struct amdgpu_device *)handle; -if (!amdgpu_dpm) +if (!adev->pm.dpm_enabled)return 0 ;mutex_lock (&adev->pm.mutex);
drivers/gpu/drm/amd/amdgpu/si_dpm.c +3 -3
@@ -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);
@@ -7704,7 +7704,7 @@ static int si_dpm_sw_init(void *handle) adev->pm.current_mclk = adev->clock.default_mclk; adev->pm.int_thermal_type =THERMAL_TYPE_NONE ; -if (amdgpu_dpm ==0 ) +if (!adev->pm.dpm_enabled)return 0 ; ret =si_dpm_init_microcode (adev);
@@ -7750,7 +7750,7 @@ static int si_dpm_hw_init(void *handle)struct amdgpu_device *adev = (struct amdgpu_device *)handle; -if (!amdgpu_dpm) +if (!adev->pm.dpm_enabled)return 0 ;mutex_lock (&adev->pm.mutex);
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/amd_powerplay.c +1 -1
@@ -48,7 +48,7 @@ static int amd_powerplay_create(struct amdgpu_device *adev) hwmgr->adev = adev; hwmgr->not_vf = !amdgpu_sriov_vf (adev); - hwmgr->pm_en = (amdgpu_dpm && hwmgr->not_vf) ? true : false; + hwmgr->pm_en = (adev->pm.dpm_enabled && hwmgr->not_vf) ? true : false; hwmgr->device =amdgpu_cgs_create_device (adev);mutex_init (&hwmgr->smu_lock); hwmgr->chip_family = adev->family;
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): 1522049262-15092-1-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org
Huang Rui
Acked-byQuoted 2 lines · Rex Zhu
Change-Id If9c30a51942ca6544d1f6fa411622ea8900befc0Signed-off-by Rex Zhu <[email protected]>
Acked-by Huang Rui <[email protected]>
Quoted 185 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 2 +- drivers/gpu/drm/amd/amdgpu/ci_dpm.c | 6 +++--- drivers/gpu/drm/amd/amdgpu/kv_dpm.c | 6 +++--- drivers/gpu/drm/amd/amdgpu/si_dpm.c | 6 +++--- drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c | 4 ++-- drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 2 +- 8 files changed, 16 insertions(+), 14 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_device.c +2
-0@@ -862,6 +862,8 @@ static void amdgpu_device_check_arguments(struct amdgpu_device *adev) } adev->firmware.load_type =amdgpu_ucode_get_load_type (adev, amdgpu_fw_load_type); + + adev->pm.dpm_enabled = amdgpu_dpm ? true : false; }/** 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 +3
-3@@ -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 */ @@ -6299,7 +6299,7 @@ static int ci_dpm_sw_init(void *handle)if (ret)return ret; -if (amdgpu_dpm ==0 ) +if (!adev->pm.dpm_enabled)return 0 ;INIT_WORK (&adev->pm.dpm.thermal.work, amdgpu_dpm_thermal_work_handler);@@ -6344,7 +6344,7 @@ static int ci_dpm_hw_init(void *handle)struct amdgpu_device *adev = (struct amdgpu_device *)handle; -if (!amdgpu_dpm) { +if (!adev->pm.dpm_enabled) { ret =ci_upload_firmware (adev);if (ret) {DRM_ERROR ("ci_upload_firmware failed\n" );drivers/gpu/drm/amd/amdgpu/kv_dpm.c +3
-3@@ -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);@@ -3008,7 +3008,7 @@ static int kv_dpm_sw_init(void *handle) adev->pm.current_mclk = adev->clock.default_mclk; adev->pm.int_thermal_type =THERMAL_TYPE_NONE ; -if (amdgpu_dpm ==0 ) +if (!adev->pm.dpm_enabled)return 0 ;INIT_WORK (&adev->pm.dpm.thermal.work, amdgpu_dpm_thermal_work_handler);@@ -3049,7 +3049,7 @@ static int kv_dpm_hw_init(void *handle)int ret;struct amdgpu_device *adev = (struct amdgpu_device *)handle; -if (!amdgpu_dpm) +if (!adev->pm.dpm_enabled)return 0 ;mutex_lock (&adev->pm.mutex);drivers/gpu/drm/amd/amdgpu/si_dpm.c +3
-3@@ -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);@@ -7704,7 +7704,7 @@ static int si_dpm_sw_init(void *handle) adev->pm.current_mclk = adev->clock.default_mclk; adev->pm.int_thermal_type =THERMAL_TYPE_NONE ; -if (amdgpu_dpm ==0 ) +if (!adev->pm.dpm_enabled)return 0 ; ret =si_dpm_init_microcode (adev);@@ -7750,7 +7750,7 @@ static int si_dpm_hw_init(void *handle)struct amdgpu_device *adev = (struct amdgpu_device *)handle; -if (!amdgpu_dpm) +if (!adev->pm.dpm_enabled)return 0 ;mutex_lock (&adev->pm.mutex);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/amd_powerplay.c +1
-1@@ -48,7 +48,7 @@ static int amd_powerplay_create(struct amdgpu_device *adev) hwmgr->adev = adev; hwmgr->not_vf = !amdgpu_sriov_vf (adev); - hwmgr->pm_en = (amdgpu_dpm && hwmgr->not_vf) ? true : false; + hwmgr->pm_en = (adev->pm.dpm_enabled && hwmgr->not_vf) ? true : false; hwmgr->device =amdgpu_cgs_create_device (adev);mutex_init (&hwmgr->smu_lock); hwmgr->chip_family = adev->family;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