aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRex Zhu <Rex.Zhu@amd.com>2018-04-18 22:39:17 -0400
committerAlex Deucher <alexander.deucher@amd.com>2018-05-15 14:43:48 -0400
commita3c991f922f99160cb695f9d28e04cd8e818d6f9 (patch)
tree6ddc244696b5ebf81f12aa864742d3e3fbc29a6b
parentd389d607e60809726fe818113c80f5fc3aac4675 (diff)
drm/amd/pp: Print out voltage/clock range in sysfs
when user cat pp_od_clk_voltage add display info about the sclk/mclk/vddc range that user can overdrive output as: OD_SCLK: 0: 300MHz 900mV 1: 400MHz 912mV 2: 500MHz 925mV 3: 600MHz 937mV 4: 700MHz 950mV 5: 800MHz 975mV 6: 900MHz 987mV 7: 1000MHz 1000mV OD_MCLK: 0: 300MHz 900mV 1: 1500MHz 912mV OD_RANGE: SCLK: 300MHz 1200MHz MCLK: 300MHz 1500MHz VDDC: 700mV 1200mV also 1. remove unnecessary whitespace before a quoted newline 2. change unit of frequency Mhz to MHz Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Rex Zhu <Rex.Zhu@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c1
-rw-r--r--drivers/gpu/drm/amd/include/kgd_pp_interface.h1
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c26
3 files changed, 22 insertions, 6 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
index ce8be467608d..27d8dd77860d 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
@@ -555,6 +555,7 @@ static ssize_t amdgpu_get_pp_od_clk_voltage(struct device *dev,
555 if (adev->powerplay.pp_funcs->print_clock_levels) { 555 if (adev->powerplay.pp_funcs->print_clock_levels) {
556 size = amdgpu_dpm_print_clock_levels(adev, OD_SCLK, buf); 556 size = amdgpu_dpm_print_clock_levels(adev, OD_SCLK, buf);
557 size += amdgpu_dpm_print_clock_levels(adev, OD_MCLK, buf+size); 557 size += amdgpu_dpm_print_clock_levels(adev, OD_MCLK, buf+size);
558 size += amdgpu_dpm_print_clock_levels(adev, OD_RANGE, buf+size);
558 return size; 559 return size;
559 } else { 560 } else {
560 return snprintf(buf, PAGE_SIZE, "\n"); 561 return snprintf(buf, PAGE_SIZE, "\n");
diff --git a/drivers/gpu/drm/amd/include/kgd_pp_interface.h b/drivers/gpu/drm/amd/include/kgd_pp_interface.h
index 01969b135ab4..06f08f34a110 100644
--- a/drivers/gpu/drm/amd/include/kgd_pp_interface.h
+++ b/drivers/gpu/drm/amd/include/kgd_pp_interface.h
@@ -94,6 +94,7 @@ enum pp_clock_type {
94 PP_PCIE, 94 PP_PCIE,
95 OD_SCLK, 95 OD_SCLK,
96 OD_MCLK, 96 OD_MCLK,
97 OD_RANGE,
97}; 98};
98 99
99enum amd_pp_sensors { 100enum amd_pp_sensors {
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
index e1196372a6ba..232ea6fc30f4 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
@@ -4335,22 +4335,36 @@ static int smu7_print_clock_levels(struct pp_hwmgr *hwmgr,
4335 break; 4335 break;
4336 case OD_SCLK: 4336 case OD_SCLK:
4337 if (hwmgr->od_enabled) { 4337 if (hwmgr->od_enabled) {
4338 size = sprintf(buf, "%s: \n", "OD_SCLK"); 4338 size = sprintf(buf, "%s:\n", "OD_SCLK");
4339 for (i = 0; i < odn_sclk_table->num_of_pl; i++) 4339 for (i = 0; i < odn_sclk_table->num_of_pl; i++)
4340 size += sprintf(buf + size, "%d: %10uMhz %10u mV\n", 4340 size += sprintf(buf + size, "%d: %10uMHz %10umV\n",
4341 i, odn_sclk_table->entries[i].clock / 100, 4341 i, odn_sclk_table->entries[i].clock/100,
4342 odn_sclk_table->entries[i].vddc); 4342 odn_sclk_table->entries[i].vddc);
4343 } 4343 }
4344 break; 4344 break;
4345 case OD_MCLK: 4345 case OD_MCLK:
4346 if (hwmgr->od_enabled) { 4346 if (hwmgr->od_enabled) {
4347 size = sprintf(buf, "%s: \n", "OD_MCLK"); 4347 size = sprintf(buf, "%s:\n", "OD_MCLK");
4348 for (i = 0; i < odn_mclk_table->num_of_pl; i++) 4348 for (i = 0; i < odn_mclk_table->num_of_pl; i++)
4349 size += sprintf(buf + size, "%d: %10uMhz %10u mV\n", 4349 size += sprintf(buf + size, "%d: %10uMHz %10umV\n",
4350 i, odn_mclk_table->entries[i].clock / 100, 4350 i, odn_mclk_table->entries[i].clock/100,
4351 odn_mclk_table->entries[i].vddc); 4351 odn_mclk_table->entries[i].vddc);
4352 } 4352 }
4353 break; 4353 break;
4354 case OD_RANGE:
4355 if (hwmgr->od_enabled) {
4356 size = sprintf(buf, "%s:\n", "OD_RANGE");
4357 size += sprintf(buf + size, "SCLK: %7uMHz %10uMHz\n",
4358 data->golden_dpm_table.sclk_table.dpm_levels[0].value/100,
4359 hwmgr->platform_descriptor.overdriveLimit.engineClock/100);
4360 size += sprintf(buf + size, "MCLK: %7uMHz %10uMHz\n",
4361 data->golden_dpm_table.mclk_table.dpm_levels[0].value/100,
4362 hwmgr->platform_descriptor.overdriveLimit.memoryClock/100);
4363 size += sprintf(buf + size, "VDDC: %7umV %11umV\n",
4364 data->odn_dpm_table.min_vddc,
4365 data->odn_dpm_table.max_vddc);
4366 }
4367 break;
4354 default: 4368 default:
4355 break; 4369 break;
4356 } 4370 }