drm/amdgpu/kv,si: DPM: Use new print helpers
Subsystems (2)
PATCH v2 1/3 drm/amdgpu/kv,si: DPM: Use new print helpers
---
Untested.
drivers/gpu/drm/amd/amdgpu/kv_dpm.c | 58 ++++++++++---------- drivers/gpu/drm/amd/amdgpu/si_dpm.c | 82 ++++++++++++++--------------- 2 files changed, 70 insertions(+), 70 deletions(-)
drivers/gpu/drm/amd/amdgpu/kv_dpm.c +29 -29
@@ -1252,7 +1252,7 @@ static void kv_dpm_enable_bapm(void *handle, bool enable)if (pi->bapm_enable) { ret =amdgpu_kv_smc_bapm_enable (adev, enable);if (ret) -DRM_ERROR ("amdgpu_kv_smc_bapm_enable failed\n" ); +drm_err (adev,"amdgpu_kv_smc_bapm_enable failed\n" ); } }
@@ -1263,40 +1263,40 @@ static int kv_dpm_enable(struct amdgpu_device *adev) ret =kv_process_firmware_header (adev);if (ret) { -DRM_ERROR ("kv_process_firmware_header failed\n" ); +drm_err (adev,"kv_process_firmware_header failed\n" );return ret; }kv_init_fps_limits (adev);kv_init_graphics_levels (adev); ret =kv_program_bootup_state (adev);if (ret) { -DRM_ERROR ("kv_program_bootup_state failed\n" ); +dev_err (adev,"kv_program_bootup_state failed\n" );return ret; }kv_calculate_dfs_bypass_settings (adev); ret =kv_upload_dpm_settings (adev);if (ret) { -DRM_ERROR ("kv_upload_dpm_settings failed\n" ); +dev_err (adev,"kv_upload_dpm_settings failed\n" );return ret; } ret =kv_populate_uvd_table (adev);if (ret) { -DRM_ERROR ("kv_populate_uvd_table failed\n" ); +drm_err (adev,"kv_populate_uvd_table failed\n" );return ret; } ret =kv_populate_vce_table (adev);if (ret) { -DRM_ERROR ("kv_populate_vce_table failed\n" ); +drm_err (adev,"kv_populate_vce_table failed\n" );return ret; } ret =kv_populate_samu_table (adev);if (ret) { -DRM_ERROR ("kv_populate_samu_table failed\n" ); +drm_err (adev,"kv_populate_samu_table failed\n" );return ret; } ret =kv_populate_acp_table (adev);if (ret) { -DRM_ERROR ("kv_populate_acp_table failed\n" ); +drm_err (adev,"kv_populate_acp_table failed\n" );return ret; }kv_program_vc (adev);
@@ -1307,39 +1307,39 @@ static int kv_dpm_enable(struct amdgpu_device *adev)if (pi->enable_auto_thermal_throttling) { ret =kv_enable_auto_thermal_throttling (adev);if (ret) { -DRM_ERROR ("kv_enable_auto_thermal_throttling failed\n" ); +drm_err (adev,"kv_enable_auto_thermal_throttling failed\n" );return ret; } } ret =kv_enable_dpm_voltage_scaling (adev);if (ret) { -DRM_ERROR ("kv_enable_dpm_voltage_scaling failed\n" ); +drm_err (adev,"kv_enable_dpm_voltage_scaling failed\n" );return ret; } ret =kv_set_dpm_interval (adev);if (ret) { -DRM_ERROR ("kv_set_dpm_interval failed\n" ); +drm_err (adev,"kv_set_dpm_interval failed\n" );return ret; } ret =kv_set_dpm_boot_state (adev);if (ret) { -DRM_ERROR ("kv_set_dpm_boot_state failed\n" ); +drm_err (adev,"kv_set_dpm_boot_state failed\n" );return ret; } ret =kv_enable_ulv (adev, true);if (ret) { -DRM_ERROR ("kv_enable_ulv failed\n" ); +drm_err (adev,"kv_enable_ulv failed\n" );return ret; }kv_start_dpm (adev); ret =kv_enable_didt (adev, true);if (ret) { -DRM_ERROR ("kv_enable_didt failed\n" ); +drm_err (adev,"kv_enable_didt failed\n" );return ret; } ret =kv_enable_smc_cac (adev, true);if (ret) { -DRM_ERROR ("kv_enable_smc_cac failed\n" ); +drm_err (adev,"kv_enable_smc_cac failed\n" );return ret; }
@@ -1347,7 +1347,7 @@ static int kv_dpm_enable(struct amdgpu_device *adev) ret =amdgpu_kv_smc_bapm_enable (adev, false);if (ret) { -DRM_ERROR ("amdgpu_kv_smc_bapm_enable failed\n" ); +drm_err (adev,"amdgpu_kv_smc_bapm_enable failed\n" );return ret; }
@@ -1355,7 +1355,7 @@ static int kv_dpm_enable(struct amdgpu_device *adev) amdgpu_is_internal_thermal_sensor(adev->pm.int_thermal_type)) { ret =kv_set_thermal_temperature_range (adev,KV_TEMP_RANGE_MIN ,KV_TEMP_RANGE_MAX );if (ret) { -DRM_ERROR ("kv_set_thermal_temperature_range failed\n" ); +drm_err (adev,"kv_set_thermal_temperature_range failed\n" );return ret; } amdgpu_irq_get(adev, &adev->pm.dpm.thermal.irq,
@@ -1928,7 +1928,7 @@ static int kv_dpm_set_power_state(void *handle)if (pi->bapm_enable) { ret =amdgpu_kv_smc_bapm_enable (adev, adev->pm.ac_power);if (ret) { -DRM_ERROR ("amdgpu_kv_smc_bapm_enable failed\n" ); +drm_err (adev,"amdgpu_kv_smc_bapm_enable failed\n" );return ret; } }
@@ -1939,7 +1939,7 @@ static int kv_dpm_set_power_state(void *handle)kv_update_dfs_bypass_settings (adev, new_ps); ret =kv_calculate_ds_divider (adev);if (ret) { -DRM_ERROR ("kv_calculate_ds_divider failed\n" ); +drm_err (adev,"kv_calculate_ds_divider failed\n" );return ret; }kv_calculate_nbps_level_settings (adev);
@@ -1955,7 +1955,7 @@ static int kv_dpm_set_power_state(void *handle) ret =kv_update_vce_dpm (adev, new_ps, old_ps);if (ret) { -DRM_ERROR ("kv_update_vce_dpm failed\n" ); +drm_err (adev,"kv_update_vce_dpm failed\n" );return ret; }kv_update_sclk_t (adev);
@@ -1968,7 +1968,7 @@ static int kv_dpm_set_power_state(void *handle)kv_update_dfs_bypass_settings (adev, new_ps); ret =kv_calculate_ds_divider (adev);if (ret) { -DRM_ERROR ("kv_calculate_ds_divider failed\n" ); +drm_err (adev,"kv_calculate_ds_divider failed\n" );return ret; }kv_calculate_nbps_level_settings (adev);
@@ -1980,7 +1980,7 @@ static int kv_dpm_set_power_state(void *handle)kv_set_enabled_levels (adev); ret =kv_update_vce_dpm (adev, new_ps, old_ps);if (ret) { -DRM_ERROR ("kv_update_vce_dpm failed\n" ); +drm_err (adev,"kv_update_vce_dpm failed\n" );return ret; }kv_update_acp_boot_level (adev);
@@ -2529,7 +2529,7 @@ static int kv_set_thermal_temperature_range(struct amdgpu_device *adev,if (high_temp > max_temp) high_temp = max_temp;if (high_temp < low_temp) { -DRM_ERROR ("invalid thermal range: %d - %d\n" , low_temp, high_temp); +drm_err (adev,"invalid thermal range: %d - %d\n" , low_temp, high_temp);return -EINVAL ; }
@@ -2571,7 +2571,7 @@ static int kv_parse_sys_info_table(struct amdgpu_device *adev) data_offset);if (crev !=8 ) { -DRM_ERROR ("Unsupported IGP table: %d %d\n" , frev, crev); +drm_err (adev,"Unsupported IGP table: %d %d\n" , frev, crev);return -EINVAL ; } pi->sys_info.bootup_sclk =le32_to_cpu (igp_info->info_8.ulBootUpEngineClock);
@@ -2587,7 +2587,7 @@ static int kv_parse_sys_info_table(struct amdgpu_device *adev)else pi->sys_info.htc_hyst_lmt = igp_info->info_8.ucHtcHystLmt;if (pi->sys_info.htc_tmp_lmt <= pi->sys_info.htc_hyst_lmt) { -DRM_ERROR ("The htcTmpLmt should be larger than htcHystLmt.\n" ); +drm_err (adev,"The htcTmpLmt should be larger than htcHystLmt.\n" ); }if (le32_to_cpu (igp_info->info_8.ulSystemConfig) & (1 <<3 ))
@@ -3026,14 +3026,14 @@ static int kv_dpm_sw_init(void *handle)if (amdgpu_dpm ==1 )amdgpu_pm_print_power_states (adev);mutex_unlock (&adev->pm.mutex); -DRM_INFO ("amdgpu: dpm initialized\n" ); +drm_info (adev,"amdgpu: dpm initialized\n" );return 0 ; dpm_failed:kv_dpm_fini (adev);mutex_unlock (&adev->pm.mutex); -DRM_ERROR ("amdgpu: dpm initialization failed\n" ); +drm_err (adev,"amdgpu: dpm initialization failed\n" );return ret; }
@@ -3194,12 +3194,12 @@ static int kv_dpm_process_interrupt(struct amdgpu_device *adev,switch (entry->src_id) {case 230 :/* thermal low to high */ -DRM_DEBUG ("IH: thermal low to high\n" ); +drm_dbg (adev,"IH: thermal low to high\n" ); adev->pm.dpm.thermal.high_to_low = false; queue_thermal = true;break ;case 231 :/* thermal high to low */ -DRM_DEBUG ("IH: thermal high to low\n" ); +drm_dbg (adev,"IH: thermal high to low\n" ); adev->pm.dpm.thermal.high_to_low = true; queue_thermal = true;break ;
drivers/gpu/drm/amd/amdgpu/si_dpm.c +41 -41
281 lines not on this page · raw message
Signature · 6 lines
2.27.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH v2 2/3 drm/amdgpu: Inform user about effect of running without DPM
Currently, most users have no idea about the effects of failed DPM initialization. So add it to the log message.
--- drivers/gpu/drm/amd/amdgpu/kv_dpm.c | 2 +- drivers/gpu/drm/amd/amdgpu/si_dpm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/kv_dpm.c +1 -1
@@ -3033,7 +3033,7 @@ static int kv_dpm_sw_init(void *handle) dpm_failed:kv_dpm_fini (adev);mutex_unlock (&adev->pm.mutex); -drm_err (adev,"amdgpu: dpm initialization failed\n" ); +drm_err (adev,"amdgpu: dpm initialization failed. Clocks set up by firmware will be used. Most likely they are low, so performance might suffer.\n" );return ret; }
drivers/gpu/drm/amd/amdgpu/si_dpm.c +1 -1
@@ -7710,7 +7710,7 @@ static int si_dpm_sw_init(void *handle) dpm_failed:si_dpm_fini (adev);mutex_unlock (&adev->pm.mutex); -drm_err (adev,"amdgpu: dpm initialization failed\n" ); +drm_err (adev,"amdgpu: dpm initialization failed. Clocks set up by firmware will be used. Most likely they are low, so performance might suffer.\n" );return ret; }
Signature · 6 lines
2.27.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH v2 3/3 drm/amdgpu: Warn about disabled DPM
In reply to Paul MenzelCurrently, besides there is no explicit message, that DPM is disabled. The user would need to know, that the missing success line indicates that.
[drm] amdgpu: dpm initialized
So, add an explicit message, and make it log level warning, as disabling dpm is not the default, and device performance will most likely suffer.
Resolves: https://gitlab.freedesktop.org/drm/amd/-/issues/1173
---
v2: Use new print helpers, and inform user about effects.
drivers/gpu/drm/amd/amdgpu/kv_dpm.c | 4 +++- drivers/gpu/drm/amd/amdgpu/si_dpm.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/kv_dpm.c +3 -1
@@ -3014,8 +3014,10 @@ 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 (amdgpu_dpm ==0 ) { +drm_warn (adev,"amdgpu: dpm disabled per parameter. Your graphics device will run with lower clocks impacting graphics performance.\n" );return 0 ; + }INIT_WORK (&adev->pm.dpm.thermal.work, amdgpu_dpm_thermal_work_handler);mutex_lock (&adev->pm.mutex);
drivers/gpu/drm/amd/amdgpu/si_dpm.c +3 -1
@@ -7687,8 +7687,10 @@ 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 (amdgpu_dpm ==0 ) { +drm_warn (adev,"amdgpu: dpm disabled per parameter. Your graphics device will run with lower clocks impacting graphics performance.\n" );return 0 ; + } ret =si_dpm_init_microcode (adev);if (ret)
Signature · 6 lines
2.27.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Christian König
maintainerRe: [PATCH v2 3/3] drm/amdgpu: Warn about disabled DPM
Am 19.06.20 um 20:50 schrieb Paul Menzel:
Quoted 24 lines
Currently, besides there is no explicit message, that DPM is disabled. The user would need to know, that the missing success line indicates that.
[drm] amdgpu: dpm initialized
So, add an explicit message, and make it log level warning, as disabling dpm is not the default, and device performance will most likely suffer.
Signed-off-by Paul Menzel <[email protected]>---
v2: Use new print helpers, and inform user about effects.drivers/gpu/drm/amd/amdgpu/kv_dpm.c | 4 +++- drivers/gpu/drm/amd/amdgpu/si_dpm.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/kv_dpm.c +0
-0
drivers/gpu/drm/amd/amdgpu/kv_dpm.c static int kv_dpm_sw_init(void *handle) · line 3018
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/kv_dpm.c +2
-1@@ -3014,8 +3014,10 @@ 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 (amdgpu_dpm ==0 ) { +drm_warn (adev,"amdgpu: dpm disabled per parameter. Your graphics device will run with lower clocks impacting graphics performance.\n" );
I'm not very keen about this. When an user specifies that DPM shouldn't be used the driver doesn't need to inform the user about this once more.
In other words shooting in your own foot is supposed to hurt.
Christian.
Quoted 11 lines
drivers/gpu/drm/amd/amdgpu/kv_dpm.c +1
-0return 0 ; + }INIT_WORK (&adev->pm.dpm.thermal.work, amdgpu_dpm_thermal_work_handler);mutex_lock (&adev->pm.mutex);drivers/gpu/drm/amd/amdgpu/si_dpm.c +0
-0@@ -7687,8 +7687,10 @@ static int si_dpm_sw_init(void *handle) adev->pm.current_mclk = adev->clock.default_mclk;
drivers/gpu/drm/amd/amdgpu/si_dpm.c static int si_dpm_sw_init(void *handle) · line 7696
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/si_dpm.c +3
-1adev->pm.int_thermal_type =THERMAL_TYPE_NONE ; -if (amdgpu_dpm ==0 ) +if (amdgpu_dpm ==0 ) { +drm_warn (adev,"amdgpu: dpm disabled per parameter. Your graphics device will run with lower clocks impacting graphics performance.\n" );return 0 ; + } ret =si_dpm_init_microcode (adev);if (ret)
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH v2 3/3] drm/amdgpu: Warn about disabled DPM
Dear Christian,
Am 22.06.20 um 15:39 schrieb Christian König:
Quoted 11 lines
Am 19.06.20 um 20:50 schrieb Paul Menzel:
Quoted 10 lines
Currently, besides there is no explicit message, that DPM is disabled. The user would need to know, that the missing success line indicates that.
[drm] amdgpu: dpm initialized
So, add an explicit message, and make it log level warning, as disabling dpm is not the default, and device performance will most likely suffer.
That URL is not mine. ;-)
Quoted 23 lines
Quoted 14 lines
Signed-off-by Paul Menzel <[email protected]>---
v2: Use new print helpers, and inform user about effects.
drivers/gpu/drm/amd/amdgpu/kv_dpm.c| 4 +++-
drivers/gpu/drm/amd/amdgpu/si_dpm.c| 4 +++-2 files changed, 6 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/kv_dpm.c +0
-0drivers/gpu/drm/amd/amdgpu/kv_dpm.c static int kv_dpm_sw_init(void *handle) · line 3018
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/kv_dpm.c +2
-1@@ -3014,8 +3014,10 @@ 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 (amdgpu_dpm == 0) { + drm_warn(adev, "amdgpu: dpm disabled per parameter. Your graphics device will run with lower clocks impacting graphics performance.\n");I'm not very keen about this. When an user specifies that DPM shouldn't be used the driver doesn't need to inform the user about this once more.
Quoted 1 line
In other words shooting in your own foot is supposed to hurt.
Maybe. The other point of view is, how does having the clarity in the logs hurt? For example, if the user added the parameter intentionally, maybe they made a typo, and it’s actually not applied. Or there is a bug in the parameter handling. Having explicit log messages is good in my opinion.
Secondly, the parameter could have been left there unintentionally. Having the message in the logs, makes the user aware of tha.
Kind regards,
Paul
Quoted 11 lines
Quoted 11 lines
drivers/gpu/drm/amd/amdgpu/kv_dpm.c +1
-0return 0; + } INIT_WORK(&adev->pm.dpm.thermal.work, amdgpu_dpm_thermal_work_handler); mutex_lock(&adev->pm.mutex);drivers/gpu/drm/amd/amdgpu/si_dpm.c +0
-0@@ -7687,8 +7687,10 @@ static int si_dpm_sw_init(void *handle) adev->pm.current_mclk = adev->clock.default_mclk; adev->pm.int_thermal_type = THERMAL_TYPE_NONE;
Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/si_dpm.c static int si_dpm_sw_init(void *handle) · line 7696
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/si_dpm.c +3
-1- if (amdgpu_dpm == 0) + if (amdgpu_dpm == 0) { + drm_warn(adev, "amdgpu: dpm disabled per parameter. Your graphics device will run with lower clocks impacting graphics performance.\n"); return 0; + } ret = si_dpm_init_microcode(adev); if (ret)
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Christian König
maintainerRe: [PATCH v2 3/3] drm/amdgpu: Warn about disabled DPM
Am 22.06.20 um 19:25 schrieb Paul Menzel:
Quoted 42 lines
Dear Christian,
Am 22.06.20 um 15:39 schrieb Christian König:
Quoted 12 lines
Am 19.06.20 um 20:50 schrieb Paul Menzel:
Quoted 10 lines
Currently, besides there is no explicit message, that DPM is disabled. The user would need to know, that the missing success line indicates that.
[drm] amdgpu: dpm initialized
So, add an explicit message, and make it log level warning, as disabling dpm is not the default, and device performance will most likely suffer.
That URL is not mine. ;-)
Quoted 23 lines
Quoted 14 lines
Signed-off-by Paul Menzel <[email protected]>---
v2: Use new print helpers, and inform user about effects.
drivers/gpu/drm/amd/amdgpu/kv_dpm.c| 4 +++-
drivers/gpu/drm/amd/amdgpu/si_dpm.c| 4 +++-2 files changed, 6 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/kv_dpm.c +0
-0drivers/gpu/drm/amd/amdgpu/kv_dpm.c static int kv_dpm_sw_init(void *handle) · line 3018
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/kv_dpm.c +2
-1@@ -3014,8 +3014,10 @@ 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 (amdgpu_dpm == 0) { + drm_warn(adev, "amdgpu: dpm disabled per parameter. Your graphics device will run with lower clocks impacting graphics performance.\n");I'm not very keen about this. When an user specifies that DPM shouldn't be used the driver doesn't need to inform the user about this once more.
Quoted 3 lines
Quoted 1 line
In other words shooting in your own foot is supposed to hurt.
Maybe. The other point of view is, how does having the clarity in the logs hurt?
Well, you are spamming the logs with a warning about an intentional behavior.
Quoted 3 lines
For example, if the user added the parameter intentionally, maybe they made a typo, and it’s actually not applied. Or there is a bug in the parameter handling. Having explicit log messages is good in my opinion.
Secondly, the parameter could have been left there unintentionally. Having the message in the logs, makes the user aware of tha.
And exactly for this reason the kernel command line is printed as the second line of the logs.
Duplicating this in each driver is not only overkill, but also very error prone.
Sorry, but this is absolutely don't think that this is a good idea.
Regards,
Christian.
Quoted 27 lines
Kind regards,
Paul
Quoted 20 lines
Quoted 19 lines
drivers/gpu/drm/amd/amdgpu/kv_dpm.c +1
-0return 0; + } INIT_WORK(&adev->pm.dpm.thermal.work, amdgpu_dpm_thermal_work_handler); mutex_lock(&adev->pm.mutex);drivers/gpu/drm/amd/amdgpu/si_dpm.c +3
-1@@ -7687,8 +7687,10 @@ 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 (amdgpu_dpm == 0) { + drm_warn(adev, "amdgpu: dpm disabled per parameter. Your graphics device will run with lower clocks impacting graphics performance.\n"); return 0; + } ret = si_dpm_init_microcode(adev); if (ret)
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH v2 3/3] drm/amdgpu: Warn about disabled DPM
Dear Christian,
Am 22.06.20 um 19:41 schrieb Christian König:
Quoted 43 lines
Am 22.06.20 um 19:25 schrieb Paul Menzel:
Quoted 38 lines
Am 22.06.20 um 15:39 schrieb Christian König:
Quoted 11 lines
Am 19.06.20 um 20:50 schrieb Paul Menzel:
Quoted 10 lines
Currently, besides there is no explicit message, that DPM is disabled. The user would need to know, that the missing success line indicates that.
[drm] amdgpu: dpm initialized
So, add an explicit message, and make it log level warning, as disabling dpm is not the default, and device performance will most likely suffer.
That URL is not mine. ;-)
Quoted 23 lines
Quoted 14 lines
Signed-off-by Paul Menzel <[email protected]>---
v2: Use new print helpers, and inform user about effects.
drivers/gpu/drm/amd/amdgpu/kv_dpm.c| 4 +++-
drivers/gpu/drm/amd/amdgpu/si_dpm.c| 4 +++-2 files changed, 6 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/kv_dpm.c +0
-0drivers/gpu/drm/amd/amdgpu/kv_dpm.c static int kv_dpm_sw_init(void *handle) · line 3018
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/kv_dpm.c +2
-1@@ -3014,8 +3014,10 @@ 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 (amdgpu_dpm == 0) { + drm_warn(adev, "amdgpu: dpm disabled per parameter. Your graphics device will run with lower clocks impacting graphics performance.\n");I'm not very keen about this. When an user specifies that DPM shouldn't be used the driver doesn't need to inform the user about this once more.
Quoted 3 lines
Quoted 1 line
In other words shooting in your own foot is supposed to hurt.
Maybe. The other point of view is, how does having the clarity in the logs hurt?
Quoted 7 lines
Well, you are spamming the logs with a warning about an intentional behavior.
Quoted 3 lines
For example, if the user added the parameter intentionally, maybe they made a typo, and it’s actually not applied. Or there is a bug in the parameter handling. Having explicit log messages is good in my opinion.
Secondly, the parameter could have been left there unintentionally. Having the message in the logs, makes the user aware of that.
And exactly for this reason the kernel command line is printed as the second line of the logs.
No, I disagree. Having the parameters listed, and knowing the actual effects are two totally different things. It’s user interface design 101 to give clear feedback. I think, you are looking through the glasses of a developer, and not of a non-developer.
Quoted 1 line
Duplicating this in each driver is not only overkill, but also very error prone.
What drivers do you mean, and what is error prone?
Quoted 1 line
Sorry, but this is absolutely don't think that this is a good idea.
Despite other subsystems actually “spamming” the logs for parameters given on the command line, here is my motivation.
Unfortunately, there is a serious issue with first(?) generation Ryzen CPUs, and maybe even external AMD graphics cards [1]. In comment 29 it is suggested to use amdgpu.dpm=0 [1], and further it’s said, it’s disabling power management. Reading the comments further [2], the user gets the impression turning off power management will cause the device to be operated at the highest performance [3].
Trying this option, I was surprised of the degraded performance, and only in #[email protected] my question was answered, saying that it’s actually depending on the system firmware how clocks are set up, and it’s common to use the *lowest* clocks. So the warning message, would have helped me a lot.
So, especially with these option used by “normal” users, having clear feedback on specified option, especially those decreasing performance, is very important.
Kind regards,
Paul
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
drivers/gpu/drm/amd/amdgpu/kv_dpm.c +1
-0return 0; + } INIT_WORK(&adev->pm.dpm.thermal.work, amdgpu_dpm_thermal_work_handler); mutex_lock(&adev->pm.mutex);drivers/gpu/drm/amd/amdgpu/si_dpm.c +0
-0@@ -7687,8 +7687,10 @@ static int si_dpm_sw_init(void *handle) adev->pm.current_mclk = adev->clock.default_mclk; adev->pm.int_thermal_type = THERMAL_TYPE_NONE;
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/si_dpm.c static int si_dpm_sw_init(void *handle) · line 7696
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/si_dpm.c +3
-1- if (amdgpu_dpm == 0) + if (amdgpu_dpm == 0) { + drm_warn(adev, "amdgpu: dpm disabled per parameter. Your graphics device will run with lower clocks impacting graphics performance.\n"); return 0; + } ret = si_dpm_init_microcode(adev); if (ret)
[1]: https://bugzilla.kernel.org/show_bug.cgi?id=206903#c29
[2]: https://bugzilla.kernel.org/show_bug.cgi?id=206903#c33
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Christian König
maintainerRe: [PATCH v2 3/3] drm/amdgpu: Warn about disabled DPM
Am 22.06.20 um 23:41 schrieb Paul Menzel:
Quoted 8 lines
[SNIP]
Quoted 5 lines
Quoted 3 lines
For example, if the user added the parameter intentionally, maybe they made a typo, and it’s actually not applied. Or there is a bug in the parameter handling. Having explicit log messages is good in my opinion.
Secondly, the parameter could have been left there unintentionally. Having the message in the logs, makes the user aware of that.
And exactly for this reason the kernel command line is printed as the second line of the logs.
No, I disagree. Having the parameters listed, and knowing the actual effects are two totally different things. It’s user interface design 101 to give clear feedback. I think, you are looking through the glasses of a developer, and not of a non-developer.
Well my job is to see this as a maintainer and keep the driver simple and clean so that we can easily maintain and extend it, but at the same time it should obviously give the best experience to end users.
So I'm certainly weighting this, but currently I don't see a good argument to add something like this.
See essentially you are requesting that an intended behavior should give a warning. That is like telling the user to not do something he wants.
If an user doesn't knew what he is doing, that's obviously a big problem as well. But I would say in this case we should improve the documentation.
Adding a warning would be justified for options like experimental features which could damage the hardware by going beyond the device capabilities for example.
Quoted 3 lines
Quoted 1 line
Duplicating this in each driver is not only overkill, but also very error prone.
What drivers do you mean, and what is error prone?
Individual hardware drivers in general.
Quoted 8 lines
Quoted 2 lines
Sorry, but this is absolutely don't think that this is a good idea.
Despite other subsystems actually “spamming” the logs for parameters given on the command line, here is my motivation.
Unfortunately, there is a serious issue with first(?) generation Ryzen CPUs, and maybe even external AMD graphics cards [1]. In comment 29 it is suggested to use
amdgpu.dpm=0[1], and further it’s said, it’s disabling power management. Reading the comments further [2], the user gets the impression turning off power management will cause the device to be operated at the highest performance [3].Trying this option, I was surprised of the degraded performance, and only in #[email protected] my question was answered, saying that it’s actually depending on the system firmware how clocks are set up, and it’s common to use the *lowest* clocks. So the warning message, would have helped me a lot.
Yeah ok, but that hardware falls back to the lowest possible performance setting as safety precaution when turn of power management is common knowledge.
In other words you are writing on the cup of coffee "Beware content is hot".
Quoted 2 lines
So, especially with these option used by “normal” users, having clear feedback on specified option, especially those decreasing performance, is very important.
Well, what we could do is improve the documentation of the module option.
Regards,
Christian.
Quoted 5 lines
Kind regards,
Paul
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx