drm/amdgpu: add feature version for SDMA ucode
authorJammy Zhou <Jammy.Zhou@amd.com>
Tue, 4 Aug 2015 02:50:47 +0000 (10:50 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 5 Aug 2015 18:26:50 +0000 (14:26 -0400)
Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu.h
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
drivers/gpu/drm/amd/amdgpu/cik_sdma.c
drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c

index 8db642b5abb2edb3d6b0e420bc25376f410d6817..f7b49d5ce4b81d471fa3c84280560b9d0e774c78 100644 (file)
@@ -1642,6 +1642,7 @@ struct amdgpu_sdma {
        /* SDMA firmware */
        const struct firmware   *fw;
        uint32_t                fw_version;
+       uint32_t                feature_version;
 
        struct amdgpu_ring      ring;
 };
index 79eba82defed6b26a82791487884570e34674c60..3bfe67de834904628e0e4e11677c706c4848fde7 100644 (file)
@@ -337,7 +337,7 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file
                        if (info->query_fw.index >= 2)
                                return -EINVAL;
                        fw_info.ver = adev->sdma[info->query_fw.index].fw_version;
-                       fw_info.feature = 0;
+                       fw_info.feature = adev->sdma[info->query_fw.index].feature_version;
                        break;
                default:
                        return -EINVAL;
index ab83cc1ca4cc04865b0bf918c410a4351496fb22..15df46c93f0a3d9e0810b9018ba761bfaa2cc418 100644 (file)
@@ -500,6 +500,7 @@ static int cik_sdma_load_microcode(struct amdgpu_device *adev)
                amdgpu_ucode_print_sdma_hdr(&hdr->header);
                fw_size = le32_to_cpu(hdr->header.ucode_size_bytes) / 4;
                adev->sdma[i].fw_version = le32_to_cpu(hdr->header.ucode_version);
+               adev->sdma[i].feature_version = le32_to_cpu(hdr->ucode_feature_version);
                fw_data = (const __le32 *)
                        (adev->sdma[i].fw->data + le32_to_cpu(hdr->header.ucode_array_offset_bytes));
                WREG32(mmSDMA0_UCODE_ADDR + sdma_offsets[i], 0);
index d7895885fe0cf3b3e7cd5d1ae52f291053420b17..01bd5c903f9b80bc6b741b8efd09e35e985a18dc 100644 (file)
@@ -542,6 +542,7 @@ static int sdma_v2_4_load_microcode(struct amdgpu_device *adev)
                        amdgpu_ucode_print_sdma_hdr(&hdr->header);
                        fw_size = le32_to_cpu(hdr->header.ucode_size_bytes) / 4;
                        adev->sdma[i].fw_version = le32_to_cpu(hdr->header.ucode_version);
+                       adev->sdma[i].feature_version = le32_to_cpu(hdr->ucode_feature_version);
 
                        fw_data = (const __le32 *)
                                (adev->sdma[i].fw->data +
index 7bb37b93993fb5312eb2d46189bf09bf789c3989..cf9bc2e126fc9fdc42399fe7b06bd843ab2cc1db 100644 (file)
@@ -631,6 +631,7 @@ static int sdma_v3_0_load_microcode(struct amdgpu_device *adev)
                amdgpu_ucode_print_sdma_hdr(&hdr->header);
                fw_size = le32_to_cpu(hdr->header.ucode_size_bytes) / 4;
                adev->sdma[i].fw_version = le32_to_cpu(hdr->header.ucode_version);
+               adev->sdma[i].feature_version = le32_to_cpu(hdr->ucode_feature_version);
 
                fw_data = (const __le32 *)
                        (adev->sdma[i].fw->data +