diff options
author | James Zhu <James.Zhu@amd.com> | 2018-06-06 14:38:14 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-06-15 11:28:11 -0400 |
commit | dd06eecb73d2e5f5c4039bcd9d83d4f7e0156d6f (patch) | |
tree | 0c1c56bccad96e860cd7a0bf03cb4429bc9ac2bc /drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | |
parent | e1fa921f022d2401f3e3328ebf0c2ded84d4924a (diff) |
drm/amdgpu/vg20:support new UVD FW version naming convention
Vega20 UVD Firmware has a new version naming convention:
[31, 30] for encode interface major
[29, 24] for encode interface minor
[15, 8] for decode interface minor
[7, 0] for hardware family id
Signed-off-by: James Zhu <James.Zhu@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c index bcf68f80bbf0..630e273c16ce 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | |||
@@ -208,10 +208,21 @@ int amdgpu_uvd_sw_init(struct amdgpu_device *adev) | |||
208 | 208 | ||
209 | hdr = (const struct common_firmware_header *)adev->uvd.fw->data; | 209 | hdr = (const struct common_firmware_header *)adev->uvd.fw->data; |
210 | family_id = le32_to_cpu(hdr->ucode_version) & 0xff; | 210 | family_id = le32_to_cpu(hdr->ucode_version) & 0xff; |
211 | version_major = (le32_to_cpu(hdr->ucode_version) >> 24) & 0xff; | 211 | |
212 | version_minor = (le32_to_cpu(hdr->ucode_version) >> 8) & 0xff; | 212 | if (adev->asic_type < CHIP_VEGA20) { |
213 | DRM_INFO("Found UVD firmware Version: %hu.%hu Family ID: %hu\n", | 213 | version_major = (le32_to_cpu(hdr->ucode_version) >> 24) & 0xff; |
214 | version_major, version_minor, family_id); | 214 | version_minor = (le32_to_cpu(hdr->ucode_version) >> 8) & 0xff; |
215 | DRM_INFO("Found UVD firmware Version: %hu.%hu Family ID: %hu\n", | ||
216 | version_major, version_minor, family_id); | ||
217 | } else { | ||
218 | unsigned int enc_major, enc_minor, dec_minor; | ||
219 | |||
220 | dec_minor = (le32_to_cpu(hdr->ucode_version) >> 8) & 0xff; | ||
221 | enc_minor = (le32_to_cpu(hdr->ucode_version) >> 24) & 0x3f; | ||
222 | enc_major = (le32_to_cpu(hdr->ucode_version) >> 30) & 0x3; | ||
223 | DRM_INFO("Found UVD firmware ENC: %hu.%hu DEC: .%hu Family ID: %hu\n", | ||
224 | enc_major, enc_minor, dec_minor, family_id); | ||
225 | } | ||
215 | 226 | ||
216 | /* | 227 | /* |
217 | * Limit the number of UVD handles depending on microcode major | 228 | * Limit the number of UVD handles depending on microcode major |
@@ -219,7 +230,7 @@ int amdgpu_uvd_sw_init(struct amdgpu_device *adev) | |||
219 | * instances support is 1.80. So all subsequent versions should | 230 | * instances support is 1.80. So all subsequent versions should |
220 | * also have the same support. | 231 | * also have the same support. |
221 | */ | 232 | */ |
222 | if ((version_major > 0x01) || | 233 | if (adev->asic_type >= CHIP_VEGA20 || (version_major > 0x01) || |
223 | ((version_major == 0x01) && (version_minor >= 0x50))) | 234 | ((version_major == 0x01) && (version_minor >= 0x50))) |
224 | adev->uvd.max_handles = AMDGPU_MAX_UVD_HANDLES; | 235 | adev->uvd.max_handles = AMDGPU_MAX_UVD_HANDLES; |
225 | 236 | ||