<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<p style="font-family:Arial;font-size:10pt;color:#008000;margin:15pt;" align="Left">
[Public]<br>
</p>
<br>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Fixed locally.<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Lazar, Lijo <Lijo.Lazar@amd.com><br>
<b>Sent:</b> Wednesday, September 22, 2021 4:16 AM<br>
<b>To:</b> Deucher, Alexander <Alexander.Deucher@amd.com>; amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Subject:</b> Re: [PATCH 46/66] drm/amdgpu/pm/amdgpu_smu: convert more IP version checking</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText"><br>
<br>
On 9/21/2021 11:37 PM, Alex Deucher wrote:<br>
> Use IP versions rather than asic_type to differentiate<br>
> IP version specific features.<br>
> <br>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com><br>
> ---<br>
>   drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 41 ++++++++++-------------<br>
>   1 file changed, 18 insertions(+), 23 deletions(-)<br>
> <br>
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c<br>
> index 5f372d353d9d..150cac4ea75c 100644<br>
> --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c<br>
> +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c<br>
> @@ -455,8 +455,7 @@ static int smu_get_power_num_states(void *handle,<br>
>   <br>
>   bool is_support_sw_smu(struct amdgpu_device *adev)<br>
>   {<br>
> -     if ((adev->asic_type >= CHIP_ARCTURUS) ||<br>
> -         (adev->ip_versions[MP1_HWIP] >= IP_VERSION(11, 0, 0)))<br>
> +     if (adev->ip_versions[MP1_HWIP] >= IP_VERSION(11, 0, 0))<br>
>                return true;<br>
>   <br>
>        return false;<br>
> @@ -600,23 +599,19 @@ static int smu_set_funcs(struct amdgpu_device *adev)<br>
>        case IP_VERSION(11, 0, 8):<br>
>                cyan_skillfish_set_ppt_funcs(smu);<br>
>                break;<br>
> -     default:<br>
> -             switch (adev->asic_type) {<br>
> -             case CHIP_ARCTURUS:<br>
> -                     adev->pm.pp_feature &= ~PP_GFXOFF_MASK;<br>
> -                     arcturus_set_ppt_funcs(smu);<br>
> -                     /* OD is not supported on Arcturus */<br>
> -                     smu->od_enabled =false;<br>
> -                     break;<br>
> -             case CHIP_ALDEBARAN:<br>
> -                     aldebaran_set_ppt_funcs(smu);<br>
> -                     /* Enable pp_od_clk_voltage node */<br>
> -                     smu->od_enabled = true;<br>
> -                     break;<br>
> -             default:<br>
> -                     return -EINVAL;<br>
> -             }<br>
> +     case IP_VERSION(11, 0, 2):<br>
> +             adev->pm.pp_feature &= ~PP_GFXOFF_MASK;<br>
> +             arcturus_set_ppt_funcs(smu);<br>
> +             /* OD is not supported on Arcturus */<br>
> +             smu->od_enabled =false;<br>
> +             break;<br>
> +     case IP_VERSION(13, 0, 2):<br>
> +             aldebaran_set_ppt_funcs(smu);<br>
> +             /* Enable pp_od_clk_voltage node */<br>
> +             smu->od_enabled = true;<br>
>                break;<br>
> +     default:<br>
> +             return -EINVAL;<br>
>        }<br>
>   <br>
>        return 0;<br>
> @@ -2288,11 +2283,11 @@ int smu_get_power_limit(void *handle,<br>
>        } else {<br>
>                switch (limit_level) {<br>
>                case SMU_PPT_LIMIT_CURRENT:<br>
> -                     if ((smu->adev->asic_type == CHIP_ALDEBARAN) ||<br>
> -                          (adev->ip_versions[MP1_HWIP] == IP_VERSION(11, 0, 7)) ||<br>
> -                          (adev->ip_versions[MP1_HWIP] == IP_VERSION(11, 0, 11)) ||<br>
> -                          (adev->ip_versions[MP1_HWIP] == IP_VERSION(11, 0, 12)) ||<br>
> -                          (adev->ip_versions[MP1_HWIP] == IP_VERSION(11, 0, 13)))<br>
> +                     if ((adev->ip_versions[MP1_HWIP] == IP_VERSION(13, 0, 2)) ||<br>
> +                         (adev->ip_versions[MP1_HWIP] == IP_VERSION(11, 0, 7)) ||<br>
> +                         (adev->ip_versions[MP1_HWIP] == IP_VERSION(11, 0, 11)) ||<br>
> +                         (adev->ip_versions[MP1_HWIP] == IP_VERSION(11, 0, 12)) ||<br>
> +                         (adev->ip_versions[MP1_HWIP] == IP_VERSION(11, 0, 13)))<br>
<br>
Maybe seen/commented before, anyway switch...case<br>
<br>
Thanks,<br>
Lijo<br>
<br>
>                                ret = smu_get_asic_power_limits(smu,<br>
>                                                                &smu->current_power_limit,<br>
>                                                                NULL,<br>
> <br>
</div>
</span></font></div>
</div>
</body>
</html>