[AMD Official Use Only - General]

Reviewed-by: Li Ma <li...@amd.com>

-----Original Message-----
From: amd-gfx <amd-gfx-boun...@lists.freedesktop.org> On Behalf Of Alex Deucher
Sent: Thursday, September 7, 2023 12:47 PM
To: Zhang, Yifan <yifan1.zh...@amd.com>
Cc: Deucher, Alexander <alexander.deuc...@amd.com>; Koenig, Christian 
<christian.koe...@amd.com>; amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/amdgpu: add type conversion for gc info

Caution: This message originated from an External Source. Use proper caution 
when opening attachments, clicking links, or responding.


Acked-by: Alex Deucher <alexander.deuc...@amd.com>

On Thu, Sep 7, 2023 at 12:20 AM Yifan Zhang <yifan1.zh...@amd.com> wrote:
>
> gc info usage misses type conversion.
>
> Signed-off-by: Yifan Zhang <yifan1.zh...@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
> index 5d179edcc8a8..9ab33b0bbbad 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
> @@ -1439,12 +1439,12 @@ static int amdgpu_discovery_get_gfx_info(struct 
> amdgpu_device *adev)
>                 adev->gfx.config.num_sc_per_sh = 
> le32_to_cpu(gc_info->v1.gc_num_sc_per_se) /
>                         le32_to_cpu(gc_info->v1.gc_num_sa_per_se);
>                 adev->gfx.config.num_packer_per_sc = 
> le32_to_cpu(gc_info->v1.gc_num_packer_per_sc);
> -               if (gc_info->v1.header.version_minor >= 1) {
> +               if (le16_to_cpu(gc_info->v1.header.version_minor) >= 1) {
>                         adev->gfx.config.gc_num_tcp_per_sa = 
> le32_to_cpu(gc_info->v1_1.gc_num_tcp_per_sa);
>                         adev->gfx.config.gc_num_sdp_interface = 
> le32_to_cpu(gc_info->v1_1.gc_num_sdp_interface);
>                         adev->gfx.config.gc_num_tcps = 
> le32_to_cpu(gc_info->v1_1.gc_num_tcps);
>                 }
> -               if (gc_info->v1.header.version_minor >= 2) {
> +               if (le16_to_cpu(gc_info->v1.header.version_minor) >= 2) {
>                         adev->gfx.config.gc_num_tcp_per_wpg = 
> le32_to_cpu(gc_info->v1_2.gc_num_tcp_per_wpg);
>                         adev->gfx.config.gc_tcp_l1_size = 
> le32_to_cpu(gc_info->v1_2.gc_tcp_l1_size);
>                         adev->gfx.config.gc_num_sqc_per_wgp = 
> le32_to_cpu(gc_info->v1_2.gc_num_sqc_per_wgp);
> @@ -1473,7 +1473,7 @@ static int amdgpu_discovery_get_gfx_info(struct 
> amdgpu_device *adev)
>                 adev->gfx.config.num_sc_per_sh = 
> le32_to_cpu(gc_info->v2.gc_num_sc_per_se) /
>                         le32_to_cpu(gc_info->v2.gc_num_sh_per_se);
>                 adev->gfx.config.num_packer_per_sc = 
> le32_to_cpu(gc_info->v2.gc_num_packer_per_sc);
> -               if (gc_info->v2.header.version_minor == 1) {
> +               if (le16_to_cpu(gc_info->v2.header.version_minor == 1)) {
>                         adev->gfx.config.gc_num_tcp_per_sa = 
> le32_to_cpu(gc_info->v2_1.gc_num_tcp_per_sh);
>                         adev->gfx.config.gc_tcp_size_per_cu = 
> le32_to_cpu(gc_info->v2_1.gc_tcp_size_per_cu);
>                         adev->gfx.config.gc_num_sdp_interface = 
> le32_to_cpu(gc_info->v2_1.gc_num_sdp_interface); /* per XCD */
> --
> 2.37.3
>

Reply via email to