diff options
author | Jammy Zhou <Jammy.Zhou@amd.com> | 2015-08-03 22:43:50 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2015-08-05 14:26:49 -0400 |
commit | 351643d7dd8a48b1053aac5fe3a1aebac614c301 (patch) | |
tree | 3bce186b1d8456a278ac03b07289bc796594bce8 | |
parent | 0fd64291031d3587753b8adc53123b277855c777 (diff) |
drm/amdgpu: add feature version for RLC and MEC v2
Expose feature version to user space for RLC/MEC/MEC2 ucode as well
v2: fix coding style
Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu.h | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 11 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 6 |
4 files changed, 21 insertions, 5 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index 31b00f91cfcd..8db642b5abb2 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h | |||
@@ -1130,6 +1130,9 @@ struct amdgpu_gfx { | |||
1130 | uint32_t me_feature_version; | 1130 | uint32_t me_feature_version; |
1131 | uint32_t ce_feature_version; | 1131 | uint32_t ce_feature_version; |
1132 | uint32_t pfp_feature_version; | 1132 | uint32_t pfp_feature_version; |
1133 | uint32_t rlc_feature_version; | ||
1134 | uint32_t mec_feature_version; | ||
1135 | uint32_t mec2_feature_version; | ||
1133 | struct amdgpu_ring gfx_ring[AMDGPU_MAX_GFX_RINGS]; | 1136 | struct amdgpu_ring gfx_ring[AMDGPU_MAX_GFX_RINGS]; |
1134 | unsigned num_gfx_rings; | 1137 | unsigned num_gfx_rings; |
1135 | struct amdgpu_ring compute_ring[AMDGPU_MAX_COMPUTE_RINGS]; | 1138 | struct amdgpu_ring compute_ring[AMDGPU_MAX_COMPUTE_RINGS]; |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c index 9736892bcdf9..79eba82defed 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | |||
@@ -317,16 +317,17 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file | |||
317 | break; | 317 | break; |
318 | case AMDGPU_INFO_FW_GFX_RLC: | 318 | case AMDGPU_INFO_FW_GFX_RLC: |
319 | fw_info.ver = adev->gfx.rlc_fw_version; | 319 | fw_info.ver = adev->gfx.rlc_fw_version; |
320 | fw_info.feature = 0; | 320 | fw_info.feature = adev->gfx.rlc_feature_version; |
321 | break; | 321 | break; |
322 | case AMDGPU_INFO_FW_GFX_MEC: | 322 | case AMDGPU_INFO_FW_GFX_MEC: |
323 | if (info->query_fw.index == 0) | 323 | if (info->query_fw.index == 0) { |
324 | fw_info.ver = adev->gfx.mec_fw_version; | 324 | fw_info.ver = adev->gfx.mec_fw_version; |
325 | else if (info->query_fw.index == 1) | 325 | fw_info.feature = adev->gfx.mec_feature_version; |
326 | } else if (info->query_fw.index == 1) { | ||
326 | fw_info.ver = adev->gfx.mec2_fw_version; | 327 | fw_info.ver = adev->gfx.mec2_fw_version; |
327 | else | 328 | fw_info.feature = adev->gfx.mec2_feature_version; |
329 | } else | ||
328 | return -EINVAL; | 330 | return -EINVAL; |
329 | fw_info.feature = 0; | ||
330 | break; | 331 | break; |
331 | case AMDGPU_INFO_FW_SMC: | 332 | case AMDGPU_INFO_FW_SMC: |
332 | fw_info.ver = adev->pm.fw_version; | 333 | fw_info.ver = adev->pm.fw_version; |
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c index 5c03420ca5dc..0d8bf2cb1956 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c | |||
@@ -3080,6 +3080,8 @@ static int gfx_v7_0_cp_compute_load_microcode(struct amdgpu_device *adev) | |||
3080 | mec_hdr = (const struct gfx_firmware_header_v1_0 *)adev->gfx.mec_fw->data; | 3080 | mec_hdr = (const struct gfx_firmware_header_v1_0 *)adev->gfx.mec_fw->data; |
3081 | amdgpu_ucode_print_gfx_hdr(&mec_hdr->header); | 3081 | amdgpu_ucode_print_gfx_hdr(&mec_hdr->header); |
3082 | adev->gfx.mec_fw_version = le32_to_cpu(mec_hdr->header.ucode_version); | 3082 | adev->gfx.mec_fw_version = le32_to_cpu(mec_hdr->header.ucode_version); |
3083 | adev->gfx.mec_feature_version = le32_to_cpu( | ||
3084 | mec_hdr->ucode_feature_version); | ||
3083 | 3085 | ||
3084 | gfx_v7_0_cp_compute_enable(adev, false); | 3086 | gfx_v7_0_cp_compute_enable(adev, false); |
3085 | 3087 | ||
@@ -3102,6 +3104,8 @@ static int gfx_v7_0_cp_compute_load_microcode(struct amdgpu_device *adev) | |||
3102 | mec2_hdr = (const struct gfx_firmware_header_v1_0 *)adev->gfx.mec2_fw->data; | 3104 | mec2_hdr = (const struct gfx_firmware_header_v1_0 *)adev->gfx.mec2_fw->data; |
3103 | amdgpu_ucode_print_gfx_hdr(&mec2_hdr->header); | 3105 | amdgpu_ucode_print_gfx_hdr(&mec2_hdr->header); |
3104 | adev->gfx.mec2_fw_version = le32_to_cpu(mec2_hdr->header.ucode_version); | 3106 | adev->gfx.mec2_fw_version = le32_to_cpu(mec2_hdr->header.ucode_version); |
3107 | adev->gfx.mec2_feature_version = le32_to_cpu( | ||
3108 | mec2_hdr->ucode_feature_version); | ||
3105 | 3109 | ||
3106 | /* MEC2 */ | 3110 | /* MEC2 */ |
3107 | fw_data = (const __le32 *) | 3111 | fw_data = (const __le32 *) |
@@ -4066,6 +4070,8 @@ static int gfx_v7_0_rlc_resume(struct amdgpu_device *adev) | |||
4066 | hdr = (const struct rlc_firmware_header_v1_0 *)adev->gfx.rlc_fw->data; | 4070 | hdr = (const struct rlc_firmware_header_v1_0 *)adev->gfx.rlc_fw->data; |
4067 | amdgpu_ucode_print_rlc_hdr(&hdr->header); | 4071 | amdgpu_ucode_print_rlc_hdr(&hdr->header); |
4068 | adev->gfx.rlc_fw_version = le32_to_cpu(hdr->header.ucode_version); | 4072 | adev->gfx.rlc_fw_version = le32_to_cpu(hdr->header.ucode_version); |
4073 | adev->gfx.rlc_feature_version = le32_to_cpu( | ||
4074 | hdr->ucode_feature_version); | ||
4069 | 4075 | ||
4070 | gfx_v7_0_rlc_stop(adev); | 4076 | gfx_v7_0_rlc_stop(adev); |
4071 | 4077 | ||
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c index f7538ddf3a9f..0ac38ee298d1 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | |||
@@ -2273,6 +2273,8 @@ static int gfx_v8_0_rlc_load_microcode(struct amdgpu_device *adev) | |||
2273 | hdr = (const struct rlc_firmware_header_v2_0 *)adev->gfx.rlc_fw->data; | 2273 | hdr = (const struct rlc_firmware_header_v2_0 *)adev->gfx.rlc_fw->data; |
2274 | amdgpu_ucode_print_rlc_hdr(&hdr->header); | 2274 | amdgpu_ucode_print_rlc_hdr(&hdr->header); |
2275 | adev->gfx.rlc_fw_version = le32_to_cpu(hdr->header.ucode_version); | 2275 | adev->gfx.rlc_fw_version = le32_to_cpu(hdr->header.ucode_version); |
2276 | adev->gfx.rlc_feature_version = le32_to_cpu( | ||
2277 | hdr->ucode_feature_version); | ||
2276 | 2278 | ||
2277 | fw_data = (const __le32 *)(adev->gfx.rlc_fw->data + | 2279 | fw_data = (const __le32 *)(adev->gfx.rlc_fw->data + |
2278 | le32_to_cpu(hdr->header.ucode_array_offset_bytes)); | 2280 | le32_to_cpu(hdr->header.ucode_array_offset_bytes)); |
@@ -2620,6 +2622,8 @@ static int gfx_v8_0_cp_compute_load_microcode(struct amdgpu_device *adev) | |||
2620 | mec_hdr = (const struct gfx_firmware_header_v1_0 *)adev->gfx.mec_fw->data; | 2622 | mec_hdr = (const struct gfx_firmware_header_v1_0 *)adev->gfx.mec_fw->data; |
2621 | amdgpu_ucode_print_gfx_hdr(&mec_hdr->header); | 2623 | amdgpu_ucode_print_gfx_hdr(&mec_hdr->header); |
2622 | adev->gfx.mec_fw_version = le32_to_cpu(mec_hdr->header.ucode_version); | 2624 | adev->gfx.mec_fw_version = le32_to_cpu(mec_hdr->header.ucode_version); |
2625 | adev->gfx.mec_feature_version = le32_to_cpu( | ||
2626 | mec_hdr->ucode_feature_version); | ||
2623 | 2627 | ||
2624 | fw_data = (const __le32 *) | 2628 | fw_data = (const __le32 *) |
2625 | (adev->gfx.mec_fw->data + | 2629 | (adev->gfx.mec_fw->data + |
@@ -2639,6 +2643,8 @@ static int gfx_v8_0_cp_compute_load_microcode(struct amdgpu_device *adev) | |||
2639 | mec2_hdr = (const struct gfx_firmware_header_v1_0 *)adev->gfx.mec2_fw->data; | 2643 | mec2_hdr = (const struct gfx_firmware_header_v1_0 *)adev->gfx.mec2_fw->data; |
2640 | amdgpu_ucode_print_gfx_hdr(&mec2_hdr->header); | 2644 | amdgpu_ucode_print_gfx_hdr(&mec2_hdr->header); |
2641 | adev->gfx.mec2_fw_version = le32_to_cpu(mec2_hdr->header.ucode_version); | 2645 | adev->gfx.mec2_fw_version = le32_to_cpu(mec2_hdr->header.ucode_version); |
2646 | adev->gfx.mec2_feature_version = le32_to_cpu( | ||
2647 | mec2_hdr->ucode_feature_version); | ||
2642 | 2648 | ||
2643 | fw_data = (const __le32 *) | 2649 | fw_data = (const __le32 *) |
2644 | (adev->gfx.mec2_fw->data + | 2650 | (adev->gfx.mec2_fw->data + |