Skip to contentSkip to conversation

drm/amd/powerplay: correct PP_TemperatureRange member type since negative values are part of the valid range

PATCH In review Evan Quan 2 participants 19 messages Jan 3, 2018 – Jan 4, 2018 11 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

Evan Quan

author
#0 lore raw

PATCH 1/7 drm/amd/powerplay: correct PP_TemperatureRange member type since negative values are part of the valid range

Change-Id I68bb53691fb2edca66c09391ab5e60357496283c
---
 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_thermal.c   | 4 ++--
 drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c | 4 ++--
 drivers/gpu/drm/amd/powerplay/inc/power_state.h      | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_thermal.c +2 -2
index d7aa643..f6573ed 100644
@@ -310,9 +310,9 @@ int smu7_thermal_get_temperature(struct pp_hwmgr *hwmgr)
 static int smu7_thermal_set_temperature_range(struct pp_hwmgr *hwmgr,
 		uint32_t low_temp, uint32_t high_temp)
 {
-	uint32_t low = SMU7_THERMAL_MINIMUM_ALERT_TEMP *
+	int low = SMU7_THERMAL_MINIMUM_ALERT_TEMP *
 			PP_TEMPERATURE_UNITS_PER_CENTIGRADES;
-	uint32_t high = SMU7_THERMAL_MAXIMUM_ALERT_TEMP *
+	int high = SMU7_THERMAL_MAXIMUM_ALERT_TEMP *
 			PP_TEMPERATURE_UNITS_PER_CENTIGRADES;
 
 	if (low < low_temp)
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c +2 -2
index dc3761b..7491163 100644
@@ -386,9 +386,9 @@ int vega10_thermal_get_temperature(struct pp_hwmgr *hwmgr)
 static int vega10_thermal_set_temperature_range(struct pp_hwmgr *hwmgr,
 		struct PP_TemperatureRange *range)
 {
-	uint32_t low = VEGA10_THERMAL_MINIMUM_ALERT_TEMP *
+	int low = VEGA10_THERMAL_MINIMUM_ALERT_TEMP *
 			PP_TEMPERATURE_UNITS_PER_CENTIGRADES;
-	uint32_t high = VEGA10_THERMAL_MAXIMUM_ALERT_TEMP *
+	int high = VEGA10_THERMAL_MAXIMUM_ALERT_TEMP *
 			PP_TEMPERATURE_UNITS_PER_CENTIGRADES;
 	uint32_t val, reg;
 
drivers/gpu/drm/amd/powerplay/inc/power_state.h +2 -2
index 827860f..a99b5cbb 100644
@@ -122,8 +122,8 @@ struct PP_StateSoftwareAlgorithmBlock {
  * Type to hold a temperature range.
  */
 struct PP_TemperatureRange {
-	uint32_t min;
-	uint32_t max;
+	int min;
+	int max;
 };
 
 struct PP_StateValidationBlock {
Signature · 6 lines
2.7.4

_______________________________________________
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): 1514949339-13928-1-git-send-email-evan.quan-5C7GfCeVMHo@public.gmane.org

author
#2 lore raw

PATCH 2/7 drm/amd/powerplay: new cgs interface setting dpm thermal range

Change-Id Ib4156edff8e3daaead720956142d8540df3254d8
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c  | 13 +++++++++++++
 drivers/gpu/drm/amd/include/cgs_common.h |  7 +++++++
 2 files changed, 20 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c +13 -0
index 4466f35..bccb0f7 100644
@@ -1187,6 +1187,18 @@ static int amdgpu_cgs_call_acpi_method(struct cgs_device *cgs_device,
 	return amdgpu_cgs_acpi_eval_object(cgs_device, &info);
 }
 
+static int amdgpu_cgs_set_temperature_range(struct cgs_device *cgs_device,
+					int min_temperature,
+					int max_temperature)
+{
+	CGS_FUNC_ADEV;
+
+	adev->pm.dpm.thermal.min_temp = min_temperature;
+	adev->pm.dpm.thermal.max_temp = max_temperature;
+
+	return 0;
+}
+
 static const struct cgs_ops amdgpu_cgs_ops = {
 	.alloc_gpu_mem = amdgpu_cgs_alloc_gpu_mem,
 	.free_gpu_mem = amdgpu_cgs_free_gpu_mem,
@@ -1214,6 +1226,7 @@ static const struct cgs_ops amdgpu_cgs_ops = {
 	.enter_safe_mode = amdgpu_cgs_enter_safe_mode,
 	.lock_grbm_idx = amdgpu_cgs_lock_grbm_idx,
 	.register_pp_handle = amdgpu_cgs_register_pp_handle,
+	.set_temperature_range = amdgpu_cgs_set_temperature_range,
 };
 
 static const struct cgs_os_ops amdgpu_cgs_os_ops = {
drivers/gpu/drm/amd/include/cgs_common.h +7 -0
index 675988d..f5c7397 100644
@@ -427,6 +427,9 @@ struct amd_pp_init;
 typedef void* (*cgs_register_pp_handle)(struct cgs_device *cgs_device,
 			int (*call_back_func)(struct amd_pp_init *, void **));
 
+typedef int (*cgs_set_temperature_range)(struct cgs_device *cgs_device,
+					int min_temperature,
+					int max_temperature);
 struct cgs_ops {
 	/* memory management calls (similar to KFD interface) */
 	cgs_alloc_gpu_mem_t alloc_gpu_mem;
@@ -464,6 +467,7 @@ struct cgs_ops {
 	cgs_enter_safe_mode enter_safe_mode;
 	cgs_lock_grbm_idx lock_grbm_idx;
 	cgs_register_pp_handle register_pp_handle;
+	cgs_set_temperature_range set_temperature_range;
 };
 
 struct cgs_os_ops; /* To be define in OS-specific CGS header */
@@ -545,4 +549,7 @@ struct cgs_device
 #define cgs_register_pp_handle(cgs_device, call_back_func) \
 		CGS_CALL(register_pp_handle, cgs_device, call_back_func)
 
+#define cgs_set_temperature_range(dev, min_temp, max_temp)	\
+	CGS_CALL(set_temperature_range, dev, min_temp, max_temp)
+
 #endif /* _CGS_COMMON_H */
Signature · 6 lines
2.7.4

_______________________________________________
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): 1514949339-13928-2-git-send-email-evan.quan-5C7GfCeVMHo@public.gmane.org

Reviewed-by
#4 lore raw

Re: [PATCH 2/7] drm/amd/powerplay: new cgs interface setting dpm thermal range

Quoted 2 lines · Evan Quan
Change-Id Ib4156edff8e3daaead720956142d8540df3254d8

Please include a commit message. Something like:
This will be used by powerplay to update the dpm temp range structure used to interface with hwmon.
With that added:

Quoted 69 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c  | 13 +++++++++++++
 drivers/gpu/drm/amd/include/cgs_common.h |  7 +++++++
 2 files changed, 20 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c +13 -0
index 4466f35..bccb0f7 100644
@@ -1187,6 +1187,18 @@ static int amdgpu_cgs_call_acpi_method(struct cgs_device *cgs_device,
        return amdgpu_cgs_acpi_eval_object(cgs_device, &info);
 }
 
+static int amdgpu_cgs_set_temperature_range(struct cgs_device *cgs_device,
+                                       int min_temperature,
+                                       int max_temperature)
+{
+       CGS_FUNC_ADEV;
+
+       adev->pm.dpm.thermal.min_temp = min_temperature;
+       adev->pm.dpm.thermal.max_temp = max_temperature;
+
+       return 0;
+}
+
 static const struct cgs_ops amdgpu_cgs_ops = {
        .alloc_gpu_mem = amdgpu_cgs_alloc_gpu_mem,
        .free_gpu_mem = amdgpu_cgs_free_gpu_mem,
@@ -1214,6 +1226,7 @@ static const struct cgs_ops amdgpu_cgs_ops = {
        .enter_safe_mode = amdgpu_cgs_enter_safe_mode,
        .lock_grbm_idx = amdgpu_cgs_lock_grbm_idx,
        .register_pp_handle = amdgpu_cgs_register_pp_handle,
+       .set_temperature_range = amdgpu_cgs_set_temperature_range,
 };
 
 static const struct cgs_os_ops amdgpu_cgs_os_ops = {
drivers/gpu/drm/amd/include/cgs_common.h +7 -1
index 675988d..f5c7397 100644
@@ -427,6 +427,9 @@ struct amd_pp_init;
 typedef void* (*cgs_register_pp_handle)(struct cgs_device *cgs_device,
                        int (*call_back_func)(struct amd_pp_init *, void **));
 
+typedef int (*cgs_set_temperature_range)(struct cgs_device *cgs_device,
+                                       int min_temperature,
+                                       int max_temperature);
 struct cgs_ops {
        /* memory management calls (similar to KFD interface) */
        cgs_alloc_gpu_mem_t alloc_gpu_mem;
@@ -464,6 +467,7 @@ struct cgs_ops {
        cgs_enter_safe_mode enter_safe_mode;
        cgs_lock_grbm_idx lock_grbm_idx;
        cgs_register_pp_handle register_pp_handle;
+       cgs_set_temperature_range set_temperature_range;
 };
 
 struct cgs_os_ops; /* To be define in OS-specific CGS header */
@@ -545,4 +549,7 @@ struct cgs_device
 #define cgs_register_pp_handle(cgs_device, call_back_func) \
                CGS_CALL(register_pp_handle, cgs_device, call_back_func)
 
+#define cgs_set_temperature_range(dev, min_temp, max_temp)     \
+       CGS_CALL(set_temperature_range, dev, min_temp, max_temp)
+
 #endif /* _CGS_COMMON_H */
--

2.7.4

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

author
#5 lore raw

PATCH 3/7 drm/amd/powerplay: new hw manager interface for retrieving device specific thermal range

In reply to a message not in the archive
Change-Id Icae6e15c7494d12bf8a194b9f1a352e0dcdef4ed
---
 drivers/gpu/drm/amd/powerplay/inc/hwmgr.h | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/powerplay/inc/hwmgr.h +2 -0
index bd2889f..384a4cb 100644
@@ -339,6 +339,8 @@ struct pp_hwmgr_func {
 					uint32_t mc_addr_low,
 					uint32_t mc_addr_hi,
 					uint32_t size);
+	int (*get_thermal_temperature_range)(struct pp_hwmgr *hwmgr,
+					struct PP_TemperatureRange *range);
 };
 
 struct pp_table_func {
Signature · 6 lines
2.7.4

_______________________________________________
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): 1514949339-13928-3-git-send-email-evan.quan-5C7GfCeVMHo@public.gmane.org

Reviewed-by
#7 lore raw

Re: [PATCH 3/7] drm/amd/powerplay: new hw manager interface for retrieving device specific thermal range

Quoted 2 lines · Evan Quan
Change-Id Icae6e15c7494d12bf8a194b9f1a352e0dcdef4ed

Please include a commit message. Something like:
Add a new callback for asic specific backends to specify the temperature ranges. With that added:

Quoted 20 lines
---
 drivers/gpu/drm/amd/powerplay/inc/hwmgr.h | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/powerplay/inc/hwmgr.h +2 -1
index bd2889f..384a4cb 100644
@@ -339,6 +339,8 @@ struct pp_hwmgr_func {
                                        uint32_t mc_addr_low,
                                        uint32_t mc_addr_hi,
                                        uint32_t size);
+       int (*get_thermal_temperature_range)(struct pp_hwmgr *hwmgr,
+                                       struct PP_TemperatureRange *range);
 };
 
 struct pp_table_func {
--

2.7.4

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

author
#8 lore raw

PATCH 4/7 drm/amd/powerplay: export thermal range through temp sysfs

In reply to a message not in the archive
Change-Id I903ebb4d75ec0628e9720b6fee915c907e594613
---
 drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c +9 -2
index 297ec0d..84e1cb0 100644
@@ -227,14 +227,21 @@ int phm_register_thermal_interrupt(struct pp_hwmgr *hwmgr, const void *info)
 */
 int phm_start_thermal_controller(struct pp_hwmgr *hwmgr)
 {
+	int ret = 0;
 	struct PP_TemperatureRange range = {{TEMP_RANGE_MIN, TEMP_RANGE_MAX}};
 
+	if (hwmgr->hwmgr_func->get_thermal_temperature_range)
+		hwmgr->hwmgr_func->get_thermal_temperature_range(
+				hwmgr, &range);
+
 	if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps,
 			PHM_PlatformCaps_ThermalController)
 			&& hwmgr->hwmgr_func->start_thermal_controller != NULL)
-		return hwmgr->hwmgr_func->start_thermal_controller(hwmgr, &range);
+		ret = hwmgr->hwmgr_func->start_thermal_controller(hwmgr, &range);
 
-	return 0;
+	cgs_set_temperature_range(hwmgr->device, range.min, range.max);
+
+	return ret;
 }
 
 
Signature · 6 lines
2.7.4

_______________________________________________
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): 1514949339-13928-4-git-send-email-evan.quan-5C7GfCeVMHo@public.gmane.org

Reviewed-by
#10 lore raw

Re: [PATCH 4/7] drm/amd/powerplay: export thermal range through temp sysfs

Quoted 2 lines · Evan Quan
Change-Id I903ebb4d75ec0628e9720b6fee915c907e594613

Please include a commit message. Something like:
Populate the hwmon temp range as part of thermal controller setup. With that added:

Quoted 35 lines
---
 drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c +9 -3
index 297ec0d..84e1cb0 100644
@@ -227,14 +227,21 @@ int phm_register_thermal_interrupt(struct pp_hwmgr *hwmgr, const void *info)
 */
 int phm_start_thermal_controller(struct pp_hwmgr *hwmgr)
 {
+       int ret = 0;
        struct PP_TemperatureRange range = {{TEMP_RANGE_MIN, TEMP_RANGE_MAX}};
 
+       if (hwmgr->hwmgr_func->get_thermal_temperature_range)
+               hwmgr->hwmgr_func->get_thermal_temperature_range(
+                               hwmgr, &range);
+
        if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps,
                        PHM_PlatformCaps_ThermalController)
                        && hwmgr->hwmgr_func->start_thermal_controller != NULL)
-               return hwmgr->hwmgr_func->start_thermal_controller(hwmgr, &range);
+               ret = hwmgr->hwmgr_func->start_thermal_controller(hwmgr, &range);
 
-       return 0;
+       cgs_set_temperature_range(hwmgr->device, range.min, range.max);
+
+       return ret;
 }
 
 
--

2.7.4

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

author
#11 lore raw

PATCH 5/7 drm/amd/powerplay: export vega10 specific thermal ranges

In reply to a message not in the archive
Change-Id If240a45dd2538e93185802b1fce54fd83de89de0
---
 drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +21 -0
index 2d55dab..ed16468 100644
@@ -4988,6 +4988,26 @@ static int vega10_notify_cac_buffer_info(struct pp_hwmgr *hwmgr,
 	return 0;
 }
 
+static struct PP_TemperatureRange SMU7ThermalWithDelayPolicy[] =
+{
+	{-273150,  99000},
+	{ 120000, 120000},
+};
+
+static int vega10_get_thermal_temperature_range(struct pp_hwmgr *hwmgr,
+		struct PP_TemperatureRange *thermal_data)
+{
+	struct phm_ppt_v2_information *table_info =
+			(struct phm_ppt_v2_information *)hwmgr->pptable;
+
+	memcpy(thermal_data, &SMU7ThermalWithDelayPolicy[0], sizeof(struct PP_TemperatureRange));
+
+	thermal_data->max = table_info->tdp_table->usSoftwareShutdownTemp *
+		PP_TEMPERATURE_UNITS_PER_CENTIGRADES;
+
+	return 0;
+}
+
 static int vega10_register_thermal_interrupt(struct pp_hwmgr *hwmgr,
 		const void *info)
 {
@@ -5074,6 +5094,7 @@ static const struct pp_hwmgr_func vega10_hwmgr_funcs = {
 	.set_mclk_od = vega10_set_mclk_od,
 	.avfs_control = vega10_avfs_enable,
 	.notify_cac_buffer_info = vega10_notify_cac_buffer_info,
+	.get_thermal_temperature_range = vega10_get_thermal_temperature_range,
 	.register_internal_thermal_interrupt = vega10_register_thermal_interrupt,
 	.start_thermal_controller = vega10_start_thermal_controller,
 };
Signature · 6 lines
2.7.4

_______________________________________________
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): 1514949339-13928-5-git-send-email-evan.quan-5C7GfCeVMHo@public.gmane.org

#13 lore raw

Re: [PATCH 5/7] drm/amd/powerplay: export vega10 specific thermal ranges

Quoted 11 lines · Evan Quan
Change-Id If240a45dd2538e93185802b1fce54fd83de89de0
---
 drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +0 -0
index 2d55dab..ed16468 100644

drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c static int vega10_notify_cac_buffer_info(struct pp_hwmgr *hwmgr, · line 4991

Quoted 4 lines
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +1 -0
@@ -4988,6 +4988,26 @@ static int vega10_notify_cac_buffer_info(struct pp_hwmgr *hwmgr,
        return 0;
 }
 
+static struct PP_TemperatureRange SMU7ThermalWithDelayPolicy[] =

Copy paste typo? s/SMU7/vega10/?

Alex

Quoted 33 lines
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +20 -1
+{
+       {-273150,  99000},
+       { 120000, 120000},
+};
+
+static int vega10_get_thermal_temperature_range(struct pp_hwmgr *hwmgr,
+               struct PP_TemperatureRange *thermal_data)
+{
+       struct phm_ppt_v2_information *table_info =
+                       (struct phm_ppt_v2_information *)hwmgr->pptable;
+
+       memcpy(thermal_data, &SMU7ThermalWithDelayPolicy[0], sizeof(struct PP_TemperatureRange));
+
+       thermal_data->max = table_info->tdp_table->usSoftwareShutdownTemp *
+               PP_TEMPERATURE_UNITS_PER_CENTIGRADES;
+
+       return 0;
+}
+
 static int vega10_register_thermal_interrupt(struct pp_hwmgr *hwmgr,
                const void *info)
 {
@@ -5074,6 +5094,7 @@ static const struct pp_hwmgr_func vega10_hwmgr_funcs = {
        .set_mclk_od = vega10_set_mclk_od,
        .avfs_control = vega10_avfs_enable,
        .notify_cac_buffer_info = vega10_notify_cac_buffer_info,
+       .get_thermal_temperature_range = vega10_get_thermal_temperature_range,
        .register_internal_thermal_interrupt = vega10_register_thermal_interrupt,
        .start_thermal_controller = vega10_start_thermal_controller,
 };
--

2.7.4

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

A message that is not in the archive (sent off-list or not yet received): CADnq5_OkxLJ7-pZ8cZ9-TejdzNcpXiMhae87jVPcLpnuAHtvOw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

Reviewed-by
#15 lore raw

Re: [PATCH 5/7] drm/amd/powerplay: export vega10 specific thermal ranges

Quoted 15 lines · Alex Deucher
Quoted 14 lines · Evan Quan
Change-Id If240a45dd2538e93185802b1fce54fd83de89de0
---
 drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +0 -0
index 2d55dab..ed16468 100644
@@ -4988,6 +4988,26 @@ static int vega10_notify_cac_buffer_info(struct pp_hwmgr *hwmgr,
        return 0;
 }
 
Quoted 3 lines

drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c static int vega10_notify_cac_buffer_info(struct pp_hwmgr *hwmgr, · line 4991

Quoted 1 line
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +1 -0
+static struct PP_TemperatureRange SMU7ThermalWithDelayPolicy[] =

Copy paste typo? s/SMU7/vega10/?

With that fixed:

Quoted 36 lines

Alex

Quoted 33 lines
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +20 -1
+{
+       {-273150,  99000},
+       { 120000, 120000},
+};
+
+static int vega10_get_thermal_temperature_range(struct pp_hwmgr *hwmgr,
+               struct PP_TemperatureRange *thermal_data)
+{
+       struct phm_ppt_v2_information *table_info =
+                       (struct phm_ppt_v2_information *)hwmgr->pptable;
+
+       memcpy(thermal_data, &SMU7ThermalWithDelayPolicy[0], sizeof(struct PP_TemperatureRange));
+
+       thermal_data->max = table_info->tdp_table->usSoftwareShutdownTemp *
+               PP_TEMPERATURE_UNITS_PER_CENTIGRADES;
+
+       return 0;
+}
+
 static int vega10_register_thermal_interrupt(struct pp_hwmgr *hwmgr,
                const void *info)
 {
@@ -5074,6 +5094,7 @@ static const struct pp_hwmgr_func vega10_hwmgr_funcs = {
        .set_mclk_od = vega10_set_mclk_od,
        .avfs_control = vega10_avfs_enable,
        .notify_cac_buffer_info = vega10_notify_cac_buffer_info,
+       .get_thermal_temperature_range = vega10_get_thermal_temperature_range,
        .register_internal_thermal_interrupt = vega10_register_thermal_interrupt,
        .start_thermal_controller = vega10_start_thermal_controller,
 };
--

2.7.4

Quoted 4 lines
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

A message that is not in the archive (sent off-list or not yet received): CADnq5_Mu2c=afbrNmt898Eo3d21CFnhaKckQFbEKBRx9Hbynsg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

author
#17 lore raw

RE: [PATCH 5/7] drm/amd/powerplay: export vega10 specific thermal ranges

Not typo. It shares the SMU7 structure.

Regards,
Evan

Quoted 71 lines

-----Original Message-----
From: Alex Deucher [mailto:[email protected]]
Sent: Thursday, January 04, 2018 4:18 AM
To: Quan, Evan <[email protected]>
Cc: amd-gfx list <[email protected]>; Deucher, Alexander <[email protected]>
Subject: Re: [PATCH 5/7] drm/amd/powerplay: export vega10 specific thermal ranges

Quoted 5 lines · Alex Deucher
Quoted 4 lines · Evan Quan
Change-Id If240a45dd2538e93185802b1fce54fd83de89de0
---
 drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c | 21

+++++++++++++++++++++

Quoted 3 lines

Review

Quoted 3 lines
 1 file changed, 21 insertions(+)
(quoted diff) +0 -0

b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c

Quoted 4 lines

drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c static int vega10_notify_cac_buffer_info(struct pp_hwmgr

Quoted 4 lines

index 2d55dab..ed16468 100644

drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +0 -0
@@ -4988,6 +4988,26 @@ static int vega10_notify_cac_buffer_info(struct pp_hwmgr

*hwmgr,

Quoted 6 lines

drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c static int vega10_notify_cac_buffer_info(struct pp_hwmgr *hwmgr, · line 4991

Quoted 4 lines
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +1 -0
        return 0;
 }
 
+static struct PP_TemperatureRange SMU7ThermalWithDelayPolicy[] =

Copy paste typo? s/SMU7/vega10/?

With that fixed:

Quoted 15 lines

Alex

drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c static int vega10_notify_cac_buffer_info(struct pp_hwmgr *hwmgr,

Quoted 12 lines
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +12 -0
+{
+       {-273150,  99000},
+       { 120000, 120000},
+};
+
+static int vega10_get_thermal_temperature_range(struct pp_hwmgr *hwmgr,
+               struct PP_TemperatureRange *thermal_data)
+{
+       struct phm_ppt_v2_information *table_info =
+                       (struct phm_ppt_v2_information *)hwmgr->pptable;
+
+       memcpy(thermal_data, &SMU7ThermalWithDelayPolicy[0], sizeof(struct

PP_TemperatureRange));

Quoted 21 lines
Quoted 21 lines
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +8 -1
+
+       thermal_data->max = table_info->tdp_table->usSoftwareShutdownTemp *
+               PP_TEMPERATURE_UNITS_PER_CENTIGRADES;
+
+       return 0;
+}
+
 static int vega10_register_thermal_interrupt(struct pp_hwmgr *hwmgr,
                const void *info)
 {
@@ -5074,6 +5094,7 @@ static const struct pp_hwmgr_func vega10_hwmgr_funcs = {
        .set_mclk_od = vega10_set_mclk_od,
        .avfs_control = vega10_avfs_enable,
        .notify_cac_buffer_info = vega10_notify_cac_buffer_info,
+       .get_thermal_temperature_range = vega10_get_thermal_temperature_range,
        .register_internal_thermal_interrupt = vega10_register_thermal_interrupt,
        .start_thermal_controller = vega10_start_thermal_controller,
 };
--

2.7.4

Quoted 4 lines
Quoted 4 lines
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

A message that is not in the archive (sent off-list or not yet received): DM5PR1201MB2489E2FB01E5848B3593BABAE41F0-grEf7a3NxMAAZHT/xKzwlGrFom/aUZj6nBOFsp37pqbUKgpGm//BTAC/[email protected]

#19 lore raw

Re: [PATCH 5/7] drm/amd/powerplay: export vega10 specific thermal ranges

Quoted 1 line · Evan

Not typo. It shares the SMU7 structure.

If all of these parts use the same values, can we just add it to some common place? Also, all of these can be const I think.

Alex

Quoted 74 lines

Regards,
Evan

Quoted 71 lines

-----Original Message-----
From: Alex Deucher [mailto:[email protected]]
Sent: Thursday, January 04, 2018 4:18 AM
To: Quan, Evan <[email protected]>
Cc: amd-gfx list <[email protected]>; Deucher, Alexander <[email protected]>
Subject: Re: [PATCH 5/7] drm/amd/powerplay: export vega10 specific thermal ranges

Quoted 5 lines · Alex Deucher
Quoted 4 lines · Evan Quan
Change-Id If240a45dd2538e93185802b1fce54fd83de89de0
---
 drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c | 21

+++++++++++++++++++++

Quoted 3 lines

Review

Quoted 3 lines
 1 file changed, 21 insertions(+)
(quoted diff) +0 -0

b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c

Quoted 4 lines

drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c static int vega10_notify_cac_buffer_info(struct pp_hwmgr

Quoted 4 lines

index 2d55dab..ed16468 100644

drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +0 -0
@@ -4988,6 +4988,26 @@ static int vega10_notify_cac_buffer_info(struct pp_hwmgr

*hwmgr,

Quoted 6 lines

drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c static int vega10_notify_cac_buffer_info(struct pp_hwmgr · line 4991

Quoted 4 lines
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +1 -0
        return 0;
 }
 
+static struct PP_TemperatureRange SMU7ThermalWithDelayPolicy[] =

Copy paste typo? s/SMU7/vega10/?

With that fixed:

Quoted 15 lines

Alex

drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c static int vega10_notify_cac_buffer_info(struct pp_hwmgr · line 5003

Quoted 12 lines
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +12 -0
+{
+       {-273150,  99000},
+       { 120000, 120000},
+};
+
+static int vega10_get_thermal_temperature_range(struct pp_hwmgr *hwmgr,
+               struct PP_TemperatureRange *thermal_data)
+{
+       struct phm_ppt_v2_information *table_info =
+                       (struct phm_ppt_v2_information *)hwmgr->pptable;
+
+       memcpy(thermal_data, &SMU7ThermalWithDelayPolicy[0], sizeof(struct

PP_TemperatureRange));

Quoted 21 lines
Quoted 21 lines
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +8 -1
+
+       thermal_data->max = table_info->tdp_table->usSoftwareShutdownTemp *
+               PP_TEMPERATURE_UNITS_PER_CENTIGRADES;
+
+       return 0;
+}
+
 static int vega10_register_thermal_interrupt(struct pp_hwmgr *hwmgr,
                const void *info)
 {
@@ -5074,6 +5094,7 @@ static const struct pp_hwmgr_func vega10_hwmgr_funcs = {
        .set_mclk_od = vega10_set_mclk_od,
        .avfs_control = vega10_avfs_enable,
        .notify_cac_buffer_info = vega10_notify_cac_buffer_info,
+       .get_thermal_temperature_range = vega10_get_thermal_temperature_range,
        .register_internal_thermal_interrupt = vega10_register_thermal_interrupt,
        .start_thermal_controller = vega10_start_thermal_controller,
 };
--

2.7.4

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
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

A message that is not in the archive (sent off-list or not yet received): CADnq5_NkOFsN6_PiQXwitXXhLFTXYeNo66es3wZ192bpOu_qfA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

author
#21 lore raw

RE: [PATCH 5/7] drm/amd/powerplay: export vega10 specific thermal ranges

Created a new header file to place the shared structures. Please check the coming V2 patches.

Regards,
Evan

Quoted 70 lines

-----Original Message-----
From: Alex Deucher [mailto:[email protected]]
Sent: Thursday, January 04, 2018 10:53 AM
To: Quan, Evan <[email protected]>
Cc: amd-gfx list <[email protected]>; Deucher, Alexander <[email protected]>
Subject: Re: [PATCH 5/7] drm/amd/powerplay: export vega10 specific thermal ranges

Quoted 1 line · Evan

Not typo. It shares the SMU7 structure.

If all of these parts use the same values, can we just add it to some common place? Also, all of these can be const I think.

Alex

Quoted 18 lines

Regards,
Evan

Quoted 15 lines

-----Original Message-----
From: Alex Deucher [mailto:[email protected]]
Sent: Thursday, January 04, 2018 4:18 AM
To: Quan, Evan <[email protected]>
Cc: amd-gfx list <[email protected]>; Deucher, Alexander <[email protected]>
Subject: Re: [PATCH 5/7] drm/amd/powerplay: export vega10 specific thermal ranges

Quoted 5 lines · Alex Deucher
Quoted 4 lines · Evan Quan
Change-Id If240a45dd2538e93185802b1fce54fd83de89de0
---
 drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c | 21

+++++++++++++++++++++

Quoted 8 lines
Quoted 8 lines
Quoted 3 lines

Review

Quoted 3 lines
 1 file changed, 21 insertions(+)
(quoted diff) +0 -0

b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c

Quoted 4 lines

drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c static int vega10_notify_cac_buffer_info(struct

Quoted 4 lines

index 2d55dab..ed16468 100644

drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +0 -0
@@ -4988,6 +4988,26 @@ static int vega10_notify_cac_buffer_info(struct

pp_hwmgr

Quoted 27 lines
Quoted 27 lines

*hwmgr,

Quoted 6 lines

drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c static int vega10_notify_cac_buffer_info(struct · line 4991

Quoted 4 lines
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +1 -0
        return 0;
 }
 
+static struct PP_TemperatureRange SMU7ThermalWithDelayPolicy[] =

Copy paste typo? s/SMU7/vega10/?

With that fixed:

Quoted 15 lines

Alex

drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c static int vega10_notify_cac_buffer_info(struct · line 5003

Quoted 12 lines
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +12 -0
+{
+       {-273150,  99000},
+       { 120000, 120000},
+};
+
+static int vega10_get_thermal_temperature_range(struct pp_hwmgr *hwmgr,
+               struct PP_TemperatureRange *thermal_data)
+{
+       struct phm_ppt_v2_information *table_info =
+                       (struct phm_ppt_v2_information *)hwmgr->pptable;
+
+       memcpy(thermal_data, &SMU7ThermalWithDelayPolicy[0], sizeof(struct

PP_TemperatureRange));

Quoted 26 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines

drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c static const struct pp_hwmgr_func vega10_hwmgr_funcs

Quoted 11 lines
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +7 -0
+
+       thermal_data->max = table_info->tdp_table->usSoftwareShutdownTemp *
+               PP_TEMPERATURE_UNITS_PER_CENTIGRADES;
+
+       return 0;
+}
+
 static int vega10_register_thermal_interrupt(struct pp_hwmgr *hwmgr,
                const void *info)
 {
@@ -5074,6 +5094,7 @@ static const struct pp_hwmgr_func vega10_hwmgr_funcs

= {

Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +1 -1
        .set_mclk_od = vega10_set_mclk_od,
        .avfs_control = vega10_avfs_enable,
        .notify_cac_buffer_info = vega10_notify_cac_buffer_info,
+       .get_thermal_temperature_range = vega10_get_thermal_temperature_range,
        .register_internal_thermal_interrupt = vega10_register_thermal_interrupt,
        .start_thermal_controller = vega10_start_thermal_controller,
 };
--

2.7.4

_______________________________________________
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

author
#22 lore raw

PATCH 6/7 drm/amd/powerplay: export the thermal ranges of VI asics

In reply to a message not in the archive
Change-Id I569179443c73c793153d5c499dd2f203f89e3ca2
---
 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 26 ++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +26 -0
index 8d7fd06..dd304d6 100644
@@ -4655,6 +4655,31 @@ static int smu7_notify_cac_buffer_info(struct pp_hwmgr *hwmgr,
 	return 0;
 }
 
+static struct PP_TemperatureRange SMU7ThermalPolicy[] =
+{
+	{-273150,  99000},
+	{ 120000, 120000},
+};
+
+static int smu7_get_thermal_temperature_range(struct pp_hwmgr *hwmgr,
+		struct PP_TemperatureRange *thermal_data)
+{
+	struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend);
+	struct phm_ppt_v1_information *table_info =
+			(struct phm_ppt_v1_information *)hwmgr->pptable;
+
+	memcpy(thermal_data, &SMU7ThermalPolicy[0], sizeof(struct PP_TemperatureRange));
+
+	if (hwmgr->pp_table_version == PP_TABLE_V1)
+		thermal_data->max = table_info->cac_dtp_table->usSoftwareShutdownTemp *
+			PP_TEMPERATURE_UNITS_PER_CENTIGRADES;
+	else if (hwmgr->pp_table_version == PP_TABLE_V0)
+		thermal_data->max = data->thermal_temp_setting.temperature_shutdown *
+			PP_TEMPERATURE_UNITS_PER_CENTIGRADES;
+
+	return 0;
+}
+
 static const struct pp_hwmgr_func smu7_hwmgr_funcs = {
 	.backend_init = &smu7_hwmgr_backend_init,
 	.backend_fini = &smu7_hwmgr_backend_fini,
@@ -4707,6 +4732,7 @@ static const struct pp_hwmgr_func smu7_hwmgr_funcs = {
 	.disable_smc_firmware_ctf = smu7_thermal_disable_alert,
 	.start_thermal_controller = smu7_start_thermal_controller,
 	.notify_cac_buffer_info = smu7_notify_cac_buffer_info,
+	.get_thermal_temperature_range = smu7_get_thermal_temperature_range,
 };
 
 uint8_t smu7_get_sleep_divider_id_from_clock(uint32_t clock,
Signature · 6 lines
2.7.4

_______________________________________________
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): 1514949339-13928-6-git-send-email-evan.quan-5C7GfCeVMHo@public.gmane.org

Reviewed-by
#24 lore raw

Re: [PATCH 6/7] drm/amd/powerplay: export the thermal ranges of VI asics

Quoted 2 lines · Evan Quan
Change-Id I569179443c73c793153d5c499dd2f203f89e3ca2
Quoted 51 lines
---
 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 26 ++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +26 -1
index 8d7fd06..dd304d6 100644
@@ -4655,6 +4655,31 @@ static int smu7_notify_cac_buffer_info(struct pp_hwmgr *hwmgr,
        return 0;
 }
 
+static struct PP_TemperatureRange SMU7ThermalPolicy[] =
+{
+       {-273150,  99000},
+       { 120000, 120000},
+};
+
+static int smu7_get_thermal_temperature_range(struct pp_hwmgr *hwmgr,
+               struct PP_TemperatureRange *thermal_data)
+{
+       struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend);
+       struct phm_ppt_v1_information *table_info =
+                       (struct phm_ppt_v1_information *)hwmgr->pptable;
+
+       memcpy(thermal_data, &SMU7ThermalPolicy[0], sizeof(struct PP_TemperatureRange));
+
+       if (hwmgr->pp_table_version == PP_TABLE_V1)
+               thermal_data->max = table_info->cac_dtp_table->usSoftwareShutdownTemp *
+                       PP_TEMPERATURE_UNITS_PER_CENTIGRADES;
+       else if (hwmgr->pp_table_version == PP_TABLE_V0)
+               thermal_data->max = data->thermal_temp_setting.temperature_shutdown *
+                       PP_TEMPERATURE_UNITS_PER_CENTIGRADES;
+
+       return 0;
+}
+
 static const struct pp_hwmgr_func smu7_hwmgr_funcs = {
        .backend_init = &smu7_hwmgr_backend_init,
        .backend_fini = &smu7_hwmgr_backend_fini,
@@ -4707,6 +4732,7 @@ static const struct pp_hwmgr_func smu7_hwmgr_funcs = {
        .disable_smc_firmware_ctf = smu7_thermal_disable_alert,
        .start_thermal_controller = smu7_start_thermal_controller,
        .notify_cac_buffer_info = smu7_notify_cac_buffer_info,
+       .get_thermal_temperature_range = smu7_get_thermal_temperature_range,
 };
 
 uint8_t smu7_get_sleep_divider_id_from_clock(uint32_t clock,
--

2.7.4

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

author
#25 lore raw

PATCH 7/7 drm/amd/powerplay: export the thermal ranges of Carrizo

In reply to a message not in the archive
Change-Id I861e3e6d4ec553171cbf369eca4ac9d834478290
---
 drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c +20 -0
index b314d09..7e87f09 100644
@@ -1858,6 +1858,25 @@ static int cz_notify_cac_buffer_info(struct pp_hwmgr *hwmgr,
 	return 0;
 }
 
+static struct PP_TemperatureRange SMU7ThermalPolicy[] =
+{
+	{-273150,  99000},
+	{ 120000, 120000},
+};
+
+static int cz_get_thermal_temperature_range(struct pp_hwmgr *hwmgr,
+		struct PP_TemperatureRange *thermal_data)
+{
+	struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+
+	memcpy(thermal_data, &SMU7ThermalPolicy[0], sizeof(struct PP_TemperatureRange));
+
+	thermal_data->max = (cz_hwmgr->thermal_auto_throttling_treshold +
+			cz_hwmgr->sys_info.htc_hyst_lmt) *
+			PP_TEMPERATURE_UNITS_PER_CENTIGRADES;
+
+	return 0;
+}
 
 static const struct pp_hwmgr_func cz_hwmgr_funcs = {
 	.backend_init = cz_hwmgr_backend_init,
@@ -1890,6 +1909,7 @@ static const struct pp_hwmgr_func cz_hwmgr_funcs = {
 	.power_state_set = cz_set_power_state_tasks,
 	.dynamic_state_management_disable = cz_disable_dpm_tasks,
 	.notify_cac_buffer_info = cz_notify_cac_buffer_info,
+	.get_thermal_temperature_range = cz_get_thermal_temperature_range,
 };
 
 int cz_init_function_pointers(struct pp_hwmgr *hwmgr)
Signature · 6 lines
2.7.4

_______________________________________________
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): 1514949339-13928-7-git-send-email-evan.quan-5C7GfCeVMHo@public.gmane.org

Reviewed-by
#27 lore raw

Re: [PATCH 7/7] drm/amd/powerplay: export the thermal ranges of Carrizo

Quoted 2 lines · Evan Quan
Change-Id I861e3e6d4ec553171cbf369eca4ac9d834478290
Quoted 45 lines
---
 drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c +20 -1
index b314d09..7e87f09 100644
@@ -1858,6 +1858,25 @@ static int cz_notify_cac_buffer_info(struct pp_hwmgr *hwmgr,
        return 0;
 }
 
+static struct PP_TemperatureRange SMU7ThermalPolicy[] =
+{
+       {-273150,  99000},
+       { 120000, 120000},
+};
+
+static int cz_get_thermal_temperature_range(struct pp_hwmgr *hwmgr,
+               struct PP_TemperatureRange *thermal_data)
+{
+       struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+
+       memcpy(thermal_data, &SMU7ThermalPolicy[0], sizeof(struct PP_TemperatureRange));
+
+       thermal_data->max = (cz_hwmgr->thermal_auto_throttling_treshold +
+                       cz_hwmgr->sys_info.htc_hyst_lmt) *
+                       PP_TEMPERATURE_UNITS_PER_CENTIGRADES;
+
+       return 0;
+}
 
 static const struct pp_hwmgr_func cz_hwmgr_funcs = {
        .backend_init = cz_hwmgr_backend_init,
@@ -1890,6 +1909,7 @@ static const struct pp_hwmgr_func cz_hwmgr_funcs = {
        .power_state_set = cz_set_power_state_tasks,
        .dynamic_state_management_disable = cz_disable_dpm_tasks,
        .notify_cac_buffer_info = cz_notify_cac_buffer_info,
+       .get_thermal_temperature_range = cz_get_thermal_temperature_range,
 };
 
 int cz_init_function_pointers(struct pp_hwmgr *hwmgr)
--

2.7.4

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

Reviewed-by
#28 lore raw

Re: [PATCH 7/7] drm/amd/powerplay: export the thermal ranges of Carrizo

In reply to a message not in the archive
Quoted 11 lines · Evan Quan
Change-Id I861e3e6d4ec553171cbf369eca4ac9d834478290
---
 drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c +0 -0
index b314d09..7e87f09 100644

drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c static int cz_notify_cac_buffer_info(struct pp_hwmgr *hwmgr, · line 1861

Quoted 4 lines
drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c +1 -0
@@ -1858,6 +1858,25 @@ static int cz_notify_cac_buffer_info(struct pp_hwmgr *hwmgr,
        return 0;
 }
 
+static struct PP_TemperatureRange SMU7ThermalPolicy[] =

copy past typo again. With that fixed:

Quoted 32 lines
drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c +19 -1
+{
+       {-273150,  99000},
+       { 120000, 120000},
+};
+
+static int cz_get_thermal_temperature_range(struct pp_hwmgr *hwmgr,
+               struct PP_TemperatureRange *thermal_data)
+{
+       struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
+
+       memcpy(thermal_data, &SMU7ThermalPolicy[0], sizeof(struct PP_TemperatureRange));
+
+       thermal_data->max = (cz_hwmgr->thermal_auto_throttling_treshold +
+                       cz_hwmgr->sys_info.htc_hyst_lmt) *
+                       PP_TEMPERATURE_UNITS_PER_CENTIGRADES;
+
+       return 0;
+}
 
 static const struct pp_hwmgr_func cz_hwmgr_funcs = {
        .backend_init = cz_hwmgr_backend_init,
@@ -1890,6 +1909,7 @@ static const struct pp_hwmgr_func cz_hwmgr_funcs = {
        .power_state_set = cz_set_power_state_tasks,
        .dynamic_state_management_disable = cz_disable_dpm_tasks,
        .notify_cac_buffer_info = cz_notify_cac_buffer_info,
+       .get_thermal_temperature_range = cz_get_thermal_temperature_range,
 };
 
 int cz_init_function_pointers(struct pp_hwmgr *hwmgr)
--

2.7.4

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

Reviewed-by
#29 lore raw
In reply to a message not in the archive
Quoted 2 lines · Evan Quan
Change-Id I68bb53691fb2edca66c09391ab5e60357496283c
Quoted 56 lines
---
 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_thermal.c   | 4 ++--
 drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c | 4 ++--
 drivers/gpu/drm/amd/powerplay/inc/power_state.h      | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_thermal.c +2 -2
index d7aa643..f6573ed 100644
@@ -310,9 +310,9 @@ int smu7_thermal_get_temperature(struct pp_hwmgr *hwmgr)
 static int smu7_thermal_set_temperature_range(struct pp_hwmgr *hwmgr,
                uint32_t low_temp, uint32_t high_temp)
 {
-       uint32_t low = SMU7_THERMAL_MINIMUM_ALERT_TEMP *
+       int low = SMU7_THERMAL_MINIMUM_ALERT_TEMP *
                        PP_TEMPERATURE_UNITS_PER_CENTIGRADES;
-       uint32_t high = SMU7_THERMAL_MAXIMUM_ALERT_TEMP *
+       int high = SMU7_THERMAL_MAXIMUM_ALERT_TEMP *
                        PP_TEMPERATURE_UNITS_PER_CENTIGRADES;
 
        if (low < low_temp)
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c +2 -2
index dc3761b..7491163 100644
@@ -386,9 +386,9 @@ int vega10_thermal_get_temperature(struct pp_hwmgr *hwmgr)
 static int vega10_thermal_set_temperature_range(struct pp_hwmgr *hwmgr,
                struct PP_TemperatureRange *range)
 {
-       uint32_t low = VEGA10_THERMAL_MINIMUM_ALERT_TEMP *
+       int low = VEGA10_THERMAL_MINIMUM_ALERT_TEMP *
                        PP_TEMPERATURE_UNITS_PER_CENTIGRADES;
-       uint32_t high = VEGA10_THERMAL_MAXIMUM_ALERT_TEMP *
+       int high = VEGA10_THERMAL_MAXIMUM_ALERT_TEMP *
                        PP_TEMPERATURE_UNITS_PER_CENTIGRADES;
        uint32_t val, reg;
 
drivers/gpu/drm/amd/powerplay/inc/power_state.h +2 -3
index 827860f..a99b5cbb 100644
@@ -122,8 +122,8 @@ struct PP_StateSoftwareAlgorithmBlock {
  * Type to hold a temperature range.
  */
 struct PP_TemperatureRange {
-       uint32_t min;
-       uint32_t max;
+       int min;
+       int max;
 };
 
 struct PP_StateValidationBlock {
--

2.7.4

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