]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/amdgpu: add type conversion for gc info
authorYifan Zhang <yifan1.zhang@amd.com>
Wed, 6 Sep 2023 09:34:16 +0000 (17:34 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 11 Sep 2023 21:17:30 +0000 (17:17 -0400)
gc info usage misses type conversion.

Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Yifan Zhang <yifan1.zhang@amd.com>
Reviewed-by: Li Ma <li.ma@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c

index d8c18b476f24e9ea274bc20abd236c4b58692b9e..961a642f5bde3bdbef4d34b155f669f678d393b2 100644 (file)
@@ -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 */