Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amdgpu: Add VCN_5_0_2 codecs capabilities support

Support VCN_5_0_2 codec query

Signed-off-by: Sonny Jiang <sonjiang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Sonny Jiang and committed by
Alex Deucher
2eb660e6 8433398c

+34
+34
drivers/gpu/drm/amd/amdgpu/soc_v1_0.c
··· 46 46 #define NORMALIZE_MID_REG_OFFSET(offset) \ 47 47 (offset & 0x3FFFF) 48 48 49 + static const struct amdgpu_video_codecs vcn_5_0_2_video_codecs_encode_vcn0 = { 50 + .codec_count = 0, 51 + .codec_array = NULL, 52 + }; 53 + 54 + static const struct amdgpu_video_codec_info vcn_5_0_2_video_codecs_decode_array_vcn0[] = { 55 + {codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4_AVC, 4096, 4096, 52)}, 56 + {codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_HEVC, 8192, 4352, 186)}, 57 + {codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_JPEG, 16384, 16384, 0)}, 58 + {codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_VP9, 8192, 4352, 0)}, 59 + {codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_AV1, 8192, 4352, 0)}, 60 + }; 61 + 62 + static const struct amdgpu_video_codecs vcn_5_0_2_video_codecs_decode_vcn0 = { 63 + .codec_count = ARRAY_SIZE(vcn_5_0_2_video_codecs_decode_array_vcn0), 64 + .codec_array = vcn_5_0_2_video_codecs_decode_array_vcn0, 65 + }; 66 + 67 + static int soc_v1_0_query_video_codecs(struct amdgpu_device *adev, bool encode, 68 + const struct amdgpu_video_codecs **codecs) 69 + { 70 + switch (amdgpu_ip_version(adev, UVD_HWIP, 0)) { 71 + case IP_VERSION(5, 0, 2): 72 + if (encode) 73 + *codecs = &vcn_5_0_2_video_codecs_encode_vcn0; 74 + else 75 + *codecs = &vcn_5_0_2_video_codecs_decode_vcn0; 76 + return 0; 77 + default: 78 + return -EINVAL; 79 + } 80 + } 81 + 49 82 /* Initialized doorbells for amdgpu including multimedia 50 83 * KFD can use all the rest in 2M doorbell bar */ 51 84 static void soc_v1_0_doorbell_index_init(struct amdgpu_device *adev) ··· 295 262 .encode_ext_smn_addressing = &soc_v1_0_encode_ext_smn_addressing, 296 263 .reset = soc_v1_0_asic_reset, 297 264 .reset_method = &soc_v1_0_asic_reset_method, 265 + .query_video_codecs = &soc_v1_0_query_video_codecs, 298 266 }; 299 267 300 268 static int soc_v1_0_common_early_init(struct amdgpu_ip_block *ip_block)