Skip to content

Commit 476ac50

Browse files
thaithongalexdeucher
authored andcommitted
drm/amdgpu/nv: update VCN 3 max HEVC encoding resolution
Update the maximum resolution reported for HEVC encoding on VCN 3 devices to reflect its 8K encoding capability. v2: Also update the max height for H.264 encoding to match spec. (Ruijing) Signed-off-by: Thong Thai <[email protected]> Reviewed-by: Ruijing Dong <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent ac9a786 commit 476ac50

File tree

1 file changed

+16
-6
lines changed
  • drivers/gpu/drm/amd/amdgpu

1 file changed

+16
-6
lines changed

drivers/gpu/drm/amd/amdgpu/nv.c

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,16 @@ static const struct amdgpu_video_codecs nv_video_codecs_decode =
9898
};
9999

100100
/* Sienna Cichlid */
101+
static const struct amdgpu_video_codec_info sc_video_codecs_encode_array[] = {
102+
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4_AVC, 4096, 2160, 0)},
103+
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_HEVC, 7680, 4352, 0)},
104+
};
105+
106+
static const struct amdgpu_video_codecs sc_video_codecs_encode = {
107+
.codec_count = ARRAY_SIZE(sc_video_codecs_encode_array),
108+
.codec_array = sc_video_codecs_encode_array,
109+
};
110+
101111
static const struct amdgpu_video_codec_info sc_video_codecs_decode_array_vcn0[] =
102112
{
103113
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG2, 4096, 4096, 3)},
@@ -136,8 +146,8 @@ static const struct amdgpu_video_codecs sc_video_codecs_decode_vcn1 =
136146
/* SRIOV Sienna Cichlid, not const since data is controlled by host */
137147
static struct amdgpu_video_codec_info sriov_sc_video_codecs_encode_array[] =
138148
{
139-
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4_AVC, 4096, 2304, 0)},
140-
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_HEVC, 4096, 2304, 0)},
149+
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4_AVC, 4096, 2160, 0)},
150+
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_HEVC, 7680, 4352, 0)},
141151
};
142152

143153
static struct amdgpu_video_codec_info sriov_sc_video_codecs_decode_array_vcn0[] =
@@ -237,12 +247,12 @@ static int nv_query_video_codecs(struct amdgpu_device *adev, bool encode,
237247
} else {
238248
if (adev->vcn.harvest_config & AMDGPU_VCN_HARVEST_VCN0) {
239249
if (encode)
240-
*codecs = &nv_video_codecs_encode;
250+
*codecs = &sc_video_codecs_encode;
241251
else
242252
*codecs = &sc_video_codecs_decode_vcn1;
243253
} else {
244254
if (encode)
245-
*codecs = &nv_video_codecs_encode;
255+
*codecs = &sc_video_codecs_encode;
246256
else
247257
*codecs = &sc_video_codecs_decode_vcn0;
248258
}
@@ -251,14 +261,14 @@ static int nv_query_video_codecs(struct amdgpu_device *adev, bool encode,
251261
case IP_VERSION(3, 0, 16):
252262
case IP_VERSION(3, 0, 2):
253263
if (encode)
254-
*codecs = &nv_video_codecs_encode;
264+
*codecs = &sc_video_codecs_encode;
255265
else
256266
*codecs = &sc_video_codecs_decode_vcn0;
257267
return 0;
258268
case IP_VERSION(3, 1, 1):
259269
case IP_VERSION(3, 1, 2):
260270
if (encode)
261-
*codecs = &nv_video_codecs_encode;
271+
*codecs = &sc_video_codecs_encode;
262272
else
263273
*codecs = &yc_video_codecs_decode;
264274
return 0;

0 commit comments

Comments
 (0)