RE: [PATCH] drm/amd/powerplay: OD setting fix on Vega10

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Reviewed-by: Evan Quan <evan.quan@xxxxxxx>

> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces@xxxxxxxxxxxxxxxxxxxxx> On Behalf Of
> Kenneth Feng
> Sent: 2019年1月21日 16:17
> To: amd-gfx@xxxxxxxxxxxxxxxxxxxxx
> Cc: Feng, Kenneth <Kenneth.Feng@xxxxxxx>
> Subject: [PATCH] drm/amd/powerplay: OD setting fix on Vega10
> 
> gfxclk for OD setting is limited to 1980M for non-acg ASICs of Vega10
> 
> Signed-off-by: Kenneth Feng <kenneth.feng@xxxxxxx>
> ---
>  .../amd/powerplay/hwmgr/vega10_processpptables.c   | 22
> +++++++++++++++++++++-
>  1 file changed, 21 insertions(+), 1 deletion(-)
> 
> diff --git
> a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_processpptables.c
> b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_processpptables.c
> index b8747a5..99d596d 100644
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_processpptables.c
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_processpptables.c
> @@ -32,6 +32,7 @@
>  #include "vega10_pptable.h"
> 
>  #define NUM_DSPCLK_LEVELS 8
> +#define VEGA10_ENGINECLOCK_HARDMAX 198000
> 
>  static void set_hw_cap(struct pp_hwmgr *hwmgr, bool enable,
>  		enum phm_platform_caps cap)
> @@ -258,7 +259,26 @@ static int init_over_drive_limits(
>  		struct pp_hwmgr *hwmgr,
>  		const ATOM_Vega10_POWERPLAYTABLE *powerplay_table)
> {
> -	hwmgr->platform_descriptor.overdriveLimit.engineClock =
> +	const ATOM_Vega10_GFXCLK_Dependency_Table
> *gfxclk_dep_table =
> +			(const ATOM_Vega10_GFXCLK_Dependency_Table *)
> +			(((unsigned long) powerplay_table) +
> +			le16_to_cpu(powerplay_table-
> >usGfxclkDependencyTableOffset));
> +	bool is_acg_enabled = false;
> +	ATOM_Vega10_GFXCLK_Dependency_Record_V2
> *patom_record_v2;
> +
> +	if (gfxclk_dep_table->ucRevId == 1) {
> +		patom_record_v2 =
> +			(ATOM_Vega10_GFXCLK_Dependency_Record_V2
> *)gfxclk_dep_table->entries;
> +		is_acg_enabled =
> +			(bool)patom_record_v2[gfxclk_dep_table-
> >ucNumEntries-1].ucACGEnable;
> +	}
> +
> +	if (powerplay_table->ulMaxODEngineClock >
> VEGA10_ENGINECLOCK_HARDMAX &&
> +		!is_acg_enabled)
> +		hwmgr->platform_descriptor.overdriveLimit.engineClock =
> +			VEGA10_ENGINECLOCK_HARDMAX;
> +	else
> +		hwmgr->platform_descriptor.overdriveLimit.engineClock =
>  			le32_to_cpu(powerplay_table-
> >ulMaxODEngineClock);
>  	hwmgr->platform_descriptor.overdriveLimit.memoryClock =
>  			le32_to_cpu(powerplay_table-
> >ulMaxODMemoryClock);
> --
> 2.7.4
> 
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/amd-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux