amdgpu/nv.c - Optimize code for video codec support structure

Optimized the code for codec info structure initialization

Signed-off-by: Veerabadhran Gopalakrishnan <veerabadhran.gopalakrishnan@amd.com>
Reviewed-by: James Zhu <James.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Veerabadhran Gopalakrishnan
2021-07-13 23:21:43 +05:30
committed by Alex Deucher
parent 554398174d
commit 9075096b09
3 changed files with 56 additions and 350 deletions

View File

@@ -619,6 +619,13 @@ struct amdgpu_video_codec_info {
u32 max_level;
};
#define codec_info_build(type, width, height, level) \
.codec_type = type,\
.max_width = width,\
.max_height = height,\
.max_pixels_per_frame = height * width,\
.max_level = level,
struct amdgpu_video_codecs {
const u32 codec_count;
const struct amdgpu_video_codec_info *codec_array;