[PATCH 09/13] drm/amd/powerplay: correct vega12 max num of dpm level

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

 



On Tue, Jun 19, 2018 at 3:39 AM, Evan Quan <evan.quan at amd.com> wrote:
> Use MAX_NUM_CLOCKS instead of VG12_PSUEDO* macros for
> the max number of dpm levels.
>
> Change-Id: Ida49f51777663a8d68d05ddcd41f4df0d8e61481
> Signed-off-by: Evan Quan <evan.quan at amd.com>

Acked-by: Alex Deucher <alexander.deucher at amd.com>

> ---
>  drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c | 17 +++++++++--------
>  1 file changed, 9 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c
> index 4732179..a227ace 100644
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c
> @@ -1642,8 +1642,8 @@ static int vega12_get_sclks(struct pp_hwmgr *hwmgr,
>                 return -1;
>
>         dpm_table = &(data->dpm_table.gfx_table);
> -       ucount = (dpm_table->count > VG12_PSUEDO_NUM_GFXCLK_DPM_LEVELS) ?
> -               VG12_PSUEDO_NUM_GFXCLK_DPM_LEVELS : dpm_table->count;
> +       ucount = (dpm_table->count > MAX_NUM_CLOCKS) ?
> +               MAX_NUM_CLOCKS : dpm_table->count;
>
>         for (i = 0; i < ucount; i++) {
>                 clocks->data[i].clocks_in_khz =
> @@ -1674,11 +1674,12 @@ static int vega12_get_memclocks(struct pp_hwmgr *hwmgr,
>                 return -1;
>
>         dpm_table = &(data->dpm_table.mem_table);
> -       ucount = (dpm_table->count > VG12_PSUEDO_NUM_UCLK_DPM_LEVELS) ?
> -               VG12_PSUEDO_NUM_UCLK_DPM_LEVELS : dpm_table->count;
> +       ucount = (dpm_table->count > MAX_NUM_CLOCKS) ?
> +               MAX_NUM_CLOCKS : dpm_table->count;
>
>         for (i = 0; i < ucount; i++) {
>                 clocks->data[i].clocks_in_khz =
> +                       data->mclk_latency_table.entries[i].frequency =
>                         dpm_table->dpm_levels[i].value * 100;
>
>                 clocks->data[i].latency_in_us =
> @@ -1704,8 +1705,8 @@ static int vega12_get_dcefclocks(struct pp_hwmgr *hwmgr,
>
>
>         dpm_table = &(data->dpm_table.dcef_table);
> -       ucount = (dpm_table->count > VG12_PSUEDO_NUM_DCEFCLK_DPM_LEVELS) ?
> -               VG12_PSUEDO_NUM_DCEFCLK_DPM_LEVELS : dpm_table->count;
> +       ucount = (dpm_table->count > MAX_NUM_CLOCKS) ?
> +               MAX_NUM_CLOCKS : dpm_table->count;
>
>         for (i = 0; i < ucount; i++) {
>                 clocks->data[i].clocks_in_khz =
> @@ -1732,8 +1733,8 @@ static int vega12_get_socclocks(struct pp_hwmgr *hwmgr,
>
>
>         dpm_table = &(data->dpm_table.soc_table);
> -       ucount = (dpm_table->count > VG12_PSUEDO_NUM_SOCCLK_DPM_LEVELS) ?
> -               VG12_PSUEDO_NUM_SOCCLK_DPM_LEVELS : dpm_table->count;
> +       ucount = (dpm_table->count > MAX_NUM_CLOCKS) ?
> +               MAX_NUM_CLOCKS : dpm_table->count;
>
>         for (i = 0; i < ucount; i++) {
>                 clocks->data[i].clocks_in_khz =
> --
> 2.7.4
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx at lists.freedesktop.org
> 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