All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/amd/powerplay: support Vega10 fan table V3
@ 2019-01-23  3:43 Evan Quan
       [not found] ` <20190123034326.9364-1-evan.quan-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Evan Quan @ 2019-01-23  3:43 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Evan Quan

MGPU fan boost related parameter is added.

Change-Id: Iaa6c570373d81199a07028f275b083f459952254
Signed-off-by: Evan Quan <evan.quan@amd.com>
---
 .../drm/amd/powerplay/hwmgr/vega10_pptable.h  | 24 +++++++++
 .../powerplay/hwmgr/vega10_processpptables.c  | 50 ++++++++++++++++++-
 drivers/gpu/drm/amd/powerplay/inc/hwmgr.h     |  1 +
 3 files changed, 74 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_pptable.h b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_pptable.h
index b3e63003a789..c934e9612c1b 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_pptable.h
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_pptable.h
@@ -282,6 +282,30 @@ typedef struct _ATOM_Vega10_Fan_Table_V2 {
 	UCHAR   ucFanMaxRPM;
 } ATOM_Vega10_Fan_Table_V2;
 
+typedef struct _ATOM_Vega10_Fan_Table_V3 {
+	UCHAR   ucRevId;
+	USHORT  usFanOutputSensitivity;
+	USHORT  usFanAcousticLimitRpm;
+	USHORT  usThrottlingRPM;
+	USHORT  usTargetTemperature;
+	USHORT  usMinimumPWMLimit;
+	USHORT  usTargetGfxClk;
+	USHORT  usFanGainEdge;
+	USHORT  usFanGainHotspot;
+	USHORT  usFanGainLiquid;
+	USHORT  usFanGainVrVddc;
+	USHORT  usFanGainVrMvdd;
+	USHORT  usFanGainPlx;
+	USHORT  usFanGainHbm;
+	UCHAR   ucEnableZeroRPM;
+	USHORT  usFanStopTemperature;
+	USHORT  usFanStartTemperature;
+	UCHAR   ucFanParameters;
+	UCHAR   ucFanMinRPM;
+	UCHAR   ucFanMaxRPM;
+	USHORT  usMGpuThrottlingRPM;
+} ATOM_Vega10_Fan_Table_V3;
+
 typedef struct _ATOM_Vega10_Thermal_Controller {
 	UCHAR ucRevId;
 	UCHAR ucType;           /* one of ATOM_VEGA10_PP_THERMALCONTROLLER_*/
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_processpptables.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_processpptables.c
index 99d596dc0e89..b6767d74dc85 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_processpptables.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_processpptables.c
@@ -123,6 +123,7 @@ static int init_thermal_controller(
 	const Vega10_PPTable_Generic_SubTable_Header *header;
 	const ATOM_Vega10_Fan_Table *fan_table_v1;
 	const ATOM_Vega10_Fan_Table_V2 *fan_table_v2;
+	const ATOM_Vega10_Fan_Table_V3 *fan_table_v3;
 
 	thermal_controller = (ATOM_Vega10_Thermal_Controller *)
 			(((unsigned long)powerplay_table) +
@@ -207,7 +208,7 @@ static int init_thermal_controller(
 				le16_to_cpu(fan_table_v1->usFanStopTemperature);
 		hwmgr->thermal_controller.advanceFanControlParameters.usZeroRPMStartTemperature =
 				le16_to_cpu(fan_table_v1->usFanStartTemperature);
-	} else if (header->ucRevId > 10) {
+	} else if (header->ucRevId == 0xb) {
 		fan_table_v2 = (ATOM_Vega10_Fan_Table_V2 *)header;
 
 		hwmgr->thermal_controller.fanInfo.ucTachometerPulsesPerRevolution =
@@ -251,7 +252,54 @@ static int init_thermal_controller(
 				le16_to_cpu(fan_table_v2->usFanStopTemperature);
 		hwmgr->thermal_controller.advanceFanControlParameters.usZeroRPMStartTemperature =
 				le16_to_cpu(fan_table_v2->usFanStartTemperature);
+	} else if (header->ucRevId > 0xb) {
+		fan_table_v3 = (ATOM_Vega10_Fan_Table_V3 *)header;
+
+		hwmgr->thermal_controller.fanInfo.ucTachometerPulsesPerRevolution =
+				fan_table_v3->ucFanParameters & ATOM_VEGA10_PP_FANPARAMETERS_TACHOMETER_PULSES_PER_REVOLUTION_MASK;
+		hwmgr->thermal_controller.fanInfo.ulMinRPM = fan_table_v3->ucFanMinRPM * 100UL;
+		hwmgr->thermal_controller.fanInfo.ulMaxRPM = fan_table_v3->ucFanMaxRPM * 100UL;
+		phm_cap_set(hwmgr->platform_descriptor.platformCaps,
+				PHM_PlatformCaps_MicrocodeFanControl);
+		hwmgr->thermal_controller.advanceFanControlParameters.usFanOutputSensitivity =
+				le16_to_cpu(fan_table_v3->usFanOutputSensitivity);
+		hwmgr->thermal_controller.advanceFanControlParameters.usMaxFanRPM =
+				fan_table_v3->ucFanMaxRPM * 100UL;
+		hwmgr->thermal_controller.advanceFanControlParameters.usFanRPMMaxLimit =
+				le16_to_cpu(fan_table_v3->usThrottlingRPM);
+		hwmgr->thermal_controller.advanceFanControlParameters.ulMinFanSCLKAcousticLimit =
+				le16_to_cpu(fan_table_v3->usFanAcousticLimitRpm);
+		hwmgr->thermal_controller.advanceFanControlParameters.usTMax =
+				le16_to_cpu(fan_table_v3->usTargetTemperature);
+		hwmgr->thermal_controller.advanceFanControlParameters.usPWMMin =
+				le16_to_cpu(fan_table_v3->usMinimumPWMLimit);
+		hwmgr->thermal_controller.advanceFanControlParameters.ulTargetGfxClk =
+				le16_to_cpu(fan_table_v3->usTargetGfxClk);
+		hwmgr->thermal_controller.advanceFanControlParameters.usFanGainEdge =
+				le16_to_cpu(fan_table_v3->usFanGainEdge);
+		hwmgr->thermal_controller.advanceFanControlParameters.usFanGainHotspot =
+				le16_to_cpu(fan_table_v3->usFanGainHotspot);
+		hwmgr->thermal_controller.advanceFanControlParameters.usFanGainLiquid =
+				le16_to_cpu(fan_table_v3->usFanGainLiquid);
+		hwmgr->thermal_controller.advanceFanControlParameters.usFanGainVrVddc =
+				le16_to_cpu(fan_table_v3->usFanGainVrVddc);
+		hwmgr->thermal_controller.advanceFanControlParameters.usFanGainVrMvdd =
+				le16_to_cpu(fan_table_v3->usFanGainVrMvdd);
+		hwmgr->thermal_controller.advanceFanControlParameters.usFanGainPlx =
+				le16_to_cpu(fan_table_v3->usFanGainPlx);
+		hwmgr->thermal_controller.advanceFanControlParameters.usFanGainHbm =
+				le16_to_cpu(fan_table_v3->usFanGainHbm);
+
+		hwmgr->thermal_controller.advanceFanControlParameters.ucEnableZeroRPM =
+				fan_table_v3->ucEnableZeroRPM;
+		hwmgr->thermal_controller.advanceFanControlParameters.usZeroRPMStopTemperature =
+				le16_to_cpu(fan_table_v3->usFanStopTemperature);
+		hwmgr->thermal_controller.advanceFanControlParameters.usZeroRPMStartTemperature =
+				le16_to_cpu(fan_table_v3->usFanStartTemperature);
+		hwmgr->thermal_controller.advanceFanControlParameters.usMGpuThrottlingRPMLimit =
+				le16_to_cpu(fan_table_v3->usMGpuThrottlingRPM);
 	}
+
 	return 0;
 }
 
diff --git a/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h b/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h
index b1cd70dcd6e7..bac3d85e3b82 100644
--- a/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h
+++ b/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h
@@ -687,6 +687,7 @@ struct pp_advance_fan_control_parameters {
 	uint32_t  ulTargetGfxClk;
 	uint16_t  usZeroRPMStartTemperature;
 	uint16_t  usZeroRPMStopTemperature;
+	uint16_t  usMGpuThrottlingRPMLimit;
 };
 
 struct pp_thermal_controller_info {
-- 
2.20.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] drm/amd/powerplay: enable MGPU fan boost feature on Vega10
       [not found] ` <20190123034326.9364-1-evan.quan-5C7GfCeVMHo@public.gmane.org>
@ 2019-01-23  3:43   ` Evan Quan
       [not found]     ` <20190123034326.9364-2-evan.quan-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Evan Quan @ 2019-01-23  3:43 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Evan Quan

For those SKUs which support this feature only.

Change-Id: I74de00204d93f951e04073e5c4c4ce9c0d34f662
Signed-off-by: Evan Quan <evan.quan@amd.com>
---
 .../drm/amd/powerplay/hwmgr/vega10_hwmgr.c    |  1 +
 .../drm/amd/powerplay/hwmgr/vega10_thermal.c  | 37 +++++++++++++++++++
 .../drm/amd/powerplay/hwmgr/vega10_thermal.h  |  1 +
 3 files changed, 39 insertions(+)

diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
index f0ba4254361b..1a4c6467a36d 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
@@ -5168,6 +5168,7 @@ static const struct pp_hwmgr_func vega10_hwmgr_funcs = {
 	.set_asic_baco_state = vega10_baco_set_state,
 	.get_ppfeature_status = vega10_get_ppfeature_status,
 	.set_ppfeature_status = vega10_set_ppfeature_status,
+	.enable_mgpu_fan_boost = vega10_enable_mgpu_fan_boost,
 };
 
 int vega10_hwmgr_init(struct pp_hwmgr *hwmgr)
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c
index 3f807d6c95ce..ba8763daa380 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c
@@ -556,6 +556,43 @@ int vega10_thermal_setup_fan_table(struct pp_hwmgr *hwmgr)
 	return ret;
 }
 
+int vega10_enable_mgpu_fan_boost(struct pp_hwmgr *hwmgr)
+{
+	struct vega10_hwmgr *data = hwmgr->backend;
+	PPTable_t *table = &(data->smc_state_table.pp_table);
+	int ret;
+
+	if (!data->smu_features[GNLD_FAN_CONTROL].supported)
+		return 0;
+
+	if (!hwmgr->thermal_controller.advanceFanControlParameters.
+			usMGpuThrottlingRPMLimit)
+		return 0;
+
+	table->FanThrottlingRpm = hwmgr->thermal_controller.
+			advanceFanControlParameters.usMGpuThrottlingRPMLimit;
+
+	ret = smum_smc_table_manager(hwmgr,
+				(uint8_t *)(&(data->smc_state_table.pp_table)),
+				PPTABLE, false);
+	if (ret) {
+		pr_info("Failed to update fan control table in pptable!");
+		return ret;
+	}
+
+	ret = vega10_disable_fan_control_feature(hwmgr);
+	if (ret) {
+		pr_info("Attempt to disable SMC fan control feature failed!");
+		return ret;
+	}
+
+	ret = vega10_enable_fan_control_feature(hwmgr);
+	if (ret)
+		pr_info("Attempt to enable SMC fan control feature failed!");
+
+	return ret;
+}
+
 /**
 * Start the fan control on the SMC.
 * @param    hwmgr  the address of the powerplay hardware manager.
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.h b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.h
index 21e7c4dfa2ca..4a0ede7c1f07 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.h
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.h
@@ -73,6 +73,7 @@ extern int vega10_thermal_disable_alert(struct pp_hwmgr *hwmgr);
 extern int vega10_fan_ctrl_start_smc_fan_control(struct pp_hwmgr *hwmgr);
 extern int vega10_start_thermal_controller(struct pp_hwmgr *hwmgr,
 				struct PP_TemperatureRange *range);
+extern int vega10_enable_mgpu_fan_boost(struct pp_hwmgr *hwmgr);
 
 
 #endif
-- 
2.20.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] drm/amd/powerplay: enable MGPU fan boost feature on Vega10
       [not found]     ` <20190123034326.9364-2-evan.quan-5C7GfCeVMHo@public.gmane.org>
@ 2019-01-23  4:53       ` Alex Deucher
       [not found]         ` <CADnq5_PBq2pQ=6wjuEMp6wGZT7QfybmHujL1VfWOt-NNjAfUTA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Alex Deucher @ 2019-01-23  4:53 UTC (permalink / raw)
  To: Evan Quan; +Cc: amd-gfx list

On Tue, Jan 22, 2019 at 10:43 PM Evan Quan <evan.quan@amd.com> wrote:
>
> For those SKUs which support this feature only.
>
> Change-Id: I74de00204d93f951e04073e5c4c4ce9c0d34f662
> Signed-off-by: Evan Quan <evan.quan@amd.com>

Is there a minimum smu version number required to support this?  Is it
safe to setup the structures and enable it if the using older smu fw?
With that clarified, the series is:
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

Alex

> ---
>  .../drm/amd/powerplay/hwmgr/vega10_hwmgr.c    |  1 +
>  .../drm/amd/powerplay/hwmgr/vega10_thermal.c  | 37 +++++++++++++++++++
>  .../drm/amd/powerplay/hwmgr/vega10_thermal.h  |  1 +
>  3 files changed, 39 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
> index f0ba4254361b..1a4c6467a36d 100644
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
> @@ -5168,6 +5168,7 @@ static const struct pp_hwmgr_func vega10_hwmgr_funcs = {
>         .set_asic_baco_state = vega10_baco_set_state,
>         .get_ppfeature_status = vega10_get_ppfeature_status,
>         .set_ppfeature_status = vega10_set_ppfeature_status,
> +       .enable_mgpu_fan_boost = vega10_enable_mgpu_fan_boost,
>  };
>
>  int vega10_hwmgr_init(struct pp_hwmgr *hwmgr)
> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c
> index 3f807d6c95ce..ba8763daa380 100644
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c
> @@ -556,6 +556,43 @@ int vega10_thermal_setup_fan_table(struct pp_hwmgr *hwmgr)
>         return ret;
>  }
>
> +int vega10_enable_mgpu_fan_boost(struct pp_hwmgr *hwmgr)
> +{
> +       struct vega10_hwmgr *data = hwmgr->backend;
> +       PPTable_t *table = &(data->smc_state_table.pp_table);
> +       int ret;
> +
> +       if (!data->smu_features[GNLD_FAN_CONTROL].supported)
> +               return 0;
> +
> +       if (!hwmgr->thermal_controller.advanceFanControlParameters.
> +                       usMGpuThrottlingRPMLimit)
> +               return 0;
> +
> +       table->FanThrottlingRpm = hwmgr->thermal_controller.
> +                       advanceFanControlParameters.usMGpuThrottlingRPMLimit;
> +
> +       ret = smum_smc_table_manager(hwmgr,
> +                               (uint8_t *)(&(data->smc_state_table.pp_table)),
> +                               PPTABLE, false);
> +       if (ret) {
> +               pr_info("Failed to update fan control table in pptable!");
> +               return ret;
> +       }
> +
> +       ret = vega10_disable_fan_control_feature(hwmgr);
> +       if (ret) {
> +               pr_info("Attempt to disable SMC fan control feature failed!");
> +               return ret;
> +       }
> +
> +       ret = vega10_enable_fan_control_feature(hwmgr);
> +       if (ret)
> +               pr_info("Attempt to enable SMC fan control feature failed!");
> +
> +       return ret;
> +}
> +
>  /**
>  * Start the fan control on the SMC.
>  * @param    hwmgr  the address of the powerplay hardware manager.
> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.h b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.h
> index 21e7c4dfa2ca..4a0ede7c1f07 100644
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.h
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.h
> @@ -73,6 +73,7 @@ extern int vega10_thermal_disable_alert(struct pp_hwmgr *hwmgr);
>  extern int vega10_fan_ctrl_start_smc_fan_control(struct pp_hwmgr *hwmgr);
>  extern int vega10_start_thermal_controller(struct pp_hwmgr *hwmgr,
>                                 struct PP_TemperatureRange *range);
> +extern int vega10_enable_mgpu_fan_boost(struct pp_hwmgr *hwmgr);
>
>
>  #endif
> --
> 2.20.1
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH 2/2] drm/amd/powerplay: enable MGPU fan boost feature on Vega10
       [not found]         ` <CADnq5_PBq2pQ=6wjuEMp6wGZT7QfybmHujL1VfWOt-NNjAfUTA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2019-01-23 11:14           ` Quan, Evan
  0 siblings, 0 replies; 4+ messages in thread
From: Quan, Evan @ 2019-01-23 11:14 UTC (permalink / raw)
  To: Alex Deucher; +Cc: amd-gfx list

This feature is only seen on the latest vbios. No requirement for SMU fw.

Regards,
Evan
> -----Original Message-----
> From: Alex Deucher <alexdeucher@gmail.com>
> Sent: 2019年1月23日 12:54
> To: Quan, Evan <Evan.Quan@amd.com>
> Cc: amd-gfx list <amd-gfx@lists.freedesktop.org>
> Subject: Re: [PATCH 2/2] drm/amd/powerplay: enable MGPU fan boost
> feature on Vega10
> 
> On Tue, Jan 22, 2019 at 10:43 PM Evan Quan <evan.quan@amd.com> wrote:
> >
> > For those SKUs which support this feature only.
> >
> > Change-Id: I74de00204d93f951e04073e5c4c4ce9c0d34f662
> > Signed-off-by: Evan Quan <evan.quan@amd.com>
> 
> Is there a minimum smu version number required to support this?  Is it safe
> to setup the structures and enable it if the using older smu fw?
> With that clarified, the series is:
> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
> 
> Alex
> 
> > ---
> >  .../drm/amd/powerplay/hwmgr/vega10_hwmgr.c    |  1 +
> >  .../drm/amd/powerplay/hwmgr/vega10_thermal.c  | 37
> >
> +++++++++++++++++++  .../drm/amd/powerplay/hwmgr/vega10_thermal.
> h  |
> > 1 +
> >  3 files changed, 39 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
> > b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
> > index f0ba4254361b..1a4c6467a36d 100644
> > --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
> > +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
> > @@ -5168,6 +5168,7 @@ static const struct pp_hwmgr_func
> vega10_hwmgr_funcs = {
> >         .set_asic_baco_state = vega10_baco_set_state,
> >         .get_ppfeature_status = vega10_get_ppfeature_status,
> >         .set_ppfeature_status = vega10_set_ppfeature_status,
> > +       .enable_mgpu_fan_boost = vega10_enable_mgpu_fan_boost,
> >  };
> >
> >  int vega10_hwmgr_init(struct pp_hwmgr *hwmgr) diff --git
> > a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c
> > b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c
> > index 3f807d6c95ce..ba8763daa380 100644
> > --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c
> > +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c
> > @@ -556,6 +556,43 @@ int vega10_thermal_setup_fan_table(struct
> pp_hwmgr *hwmgr)
> >         return ret;
> >  }
> >
> > +int vega10_enable_mgpu_fan_boost(struct pp_hwmgr *hwmgr) {
> > +       struct vega10_hwmgr *data = hwmgr->backend;
> > +       PPTable_t *table = &(data->smc_state_table.pp_table);
> > +       int ret;
> > +
> > +       if (!data->smu_features[GNLD_FAN_CONTROL].supported)
> > +               return 0;
> > +
> > +       if (!hwmgr->thermal_controller.advanceFanControlParameters.
> > +                       usMGpuThrottlingRPMLimit)
> > +               return 0;
> > +
> > +       table->FanThrottlingRpm = hwmgr->thermal_controller.
> > +
> > + advanceFanControlParameters.usMGpuThrottlingRPMLimit;
> > +
> > +       ret = smum_smc_table_manager(hwmgr,
> > +                               (uint8_t *)(&(data->smc_state_table.pp_table)),
> > +                               PPTABLE, false);
> > +       if (ret) {
> > +               pr_info("Failed to update fan control table in pptable!");
> > +               return ret;
> > +       }
> > +
> > +       ret = vega10_disable_fan_control_feature(hwmgr);
> > +       if (ret) {
> > +               pr_info("Attempt to disable SMC fan control feature failed!");
> > +               return ret;
> > +       }
> > +
> > +       ret = vega10_enable_fan_control_feature(hwmgr);
> > +       if (ret)
> > +               pr_info("Attempt to enable SMC fan control feature
> > + failed!");
> > +
> > +       return ret;
> > +}
> > +
> >  /**
> >  * Start the fan control on the SMC.
> >  * @param    hwmgr  the address of the powerplay hardware manager.
> > diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.h
> > b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.h
> > index 21e7c4dfa2ca..4a0ede7c1f07 100644
> > --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.h
> > +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.h
> > @@ -73,6 +73,7 @@ extern int vega10_thermal_disable_alert(struct
> > pp_hwmgr *hwmgr);  extern int
> > vega10_fan_ctrl_start_smc_fan_control(struct pp_hwmgr *hwmgr);
> extern int vega10_start_thermal_controller(struct pp_hwmgr *hwmgr,
> >                                 struct PP_TemperatureRange *range);
> > +extern int vega10_enable_mgpu_fan_boost(struct pp_hwmgr *hwmgr);
> >
> >
> >  #endif
> > --
> > 2.20.1
> >
> > _______________________________________________
> > amd-gfx mailing list
> > amd-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-01-23 11:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-23  3:43 [PATCH 1/2] drm/amd/powerplay: support Vega10 fan table V3 Evan Quan
     [not found] ` <20190123034326.9364-1-evan.quan-5C7GfCeVMHo@public.gmane.org>
2019-01-23  3:43   ` [PATCH 2/2] drm/amd/powerplay: enable MGPU fan boost feature on Vega10 Evan Quan
     [not found]     ` <20190123034326.9364-2-evan.quan-5C7GfCeVMHo@public.gmane.org>
2019-01-23  4:53       ` Alex Deucher
     [not found]         ` <CADnq5_PBq2pQ=6wjuEMp6wGZT7QfybmHujL1VfWOt-NNjAfUTA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-01-23 11:14           ` Quan, Evan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.