[PATCH] drm/amdgpu/powerplay: use local renoir array sizes for clock fetching

Liang, Prike Prike.Liang at amd.com
Thu Oct 17 23:59:32 UTC 2019


Reviewed-by: Prike Liang <Prike.Liang at amd.com>

> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> On Behalf Of Alex
> Deucher
> Sent: Friday, October 18, 2019 12:00 AM
> To: amd-gfx at lists.freedesktop.org
> Cc: Deucher, Alexander <Alexander.Deucher at amd.com>
> Subject: [PATCH] drm/amdgpu/powerplay: use local renoir array sizes for
> clock fetching
> 
> To avoid walking past the end of the arrays since the PP_SMU defines don't
> match the renoir defines.
> 
> Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
> ---
>  drivers/gpu/drm/amd/powerplay/renoir_ppt.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/powerplay/renoir_ppt.c
> b/drivers/gpu/drm/amd/powerplay/renoir_ppt.c
> index fa314c275a82..f0c8d1ad2a80 100644
> --- a/drivers/gpu/drm/amd/powerplay/renoir_ppt.c
> +++ b/drivers/gpu/drm/amd/powerplay/renoir_ppt.c
> @@ -427,22 +427,22 @@ static int renoir_get_dpm_clock_table(struct
> smu_context *smu, struct dpm_clocks
>  	if (!clock_table || !table)
>  		return -EINVAL;
> 
> -	for (i = 0; i < PP_SMU_NUM_DCFCLK_DPM_LEVELS; i++) {
> +	for (i = 0; i < NUM_DCFCLK_DPM_LEVELS; i++) {
>  		clock_table->DcfClocks[i].Freq = table->DcfClocks[i].Freq;
>  		clock_table->DcfClocks[i].Vol = table->DcfClocks[i].Vol;
>  	}
> 
> -	for (i = 0; i < PP_SMU_NUM_SOCCLK_DPM_LEVELS; i++) {
> +	for (i = 0; i < NUM_SOCCLK_DPM_LEVELS; i++) {
>  		clock_table->SocClocks[i].Freq = table->SocClocks[i].Freq;
>  		clock_table->SocClocks[i].Vol = table->SocClocks[i].Vol;
>  	}
> 
> -	for (i = 0; i < PP_SMU_NUM_FCLK_DPM_LEVELS; i++) {
> +	for (i = 0; i < NUM_FCLK_DPM_LEVELS; i++) {
>  		clock_table->FClocks[i].Freq = table->FClocks[i].Freq;
>  		clock_table->FClocks[i].Vol = table->FClocks[i].Vol;
>  	}
> 
> -	for (i = 0; i<  PP_SMU_NUM_MEMCLK_DPM_LEVELS; i++) {
> +	for (i = 0; i<  NUM_MEMCLK_DPM_LEVELS; i++) {
>  		clock_table->MemClocks[i].Freq = table->MemClocks[i].Freq;
>  		clock_table->MemClocks[i].Vol = table->MemClocks[i].Vol;
>  	}
> --
> 2.23.0
> 
> _______________________________________________
> amd-gfx mailing list
> amd-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx


More information about the amd-gfx mailing list