From f1277dabbc34bf33aa40315d0c3d719dc4276217 Mon Sep 17 00:00:00 2001 From: Leo Liu Date: Thu, 15 Mar 2018 11:55:27 -0400 Subject: [PATCH] radeon/vcn: add VP9 profile2 support MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Leo Liu Acked-by: Christian König --- src/gallium/drivers/radeon/radeon_vcn_dec.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/gallium/drivers/radeon/radeon_vcn_dec.c b/src/gallium/drivers/radeon/radeon_vcn_dec.c index b4cfba1713c..046b371384a 100644 --- a/src/gallium/drivers/radeon/radeon_vcn_dec.c +++ b/src/gallium/drivers/radeon/radeon_vcn_dec.c @@ -549,6 +549,17 @@ static rvcn_dec_message_vp9_t get_vp9_msg(struct radeon_decoder *dec, result.frame_refs[2] = result.ref_frame_map[pic->picture_parameter.pic_fields.alt_ref_frame]; result.ref_frame_sign_bias[2] = pic->picture_parameter.pic_fields.alt_ref_frame_sign_bias; + if (pic->base.profile == PIPE_VIDEO_PROFILE_VP9_PROFILE2) { + if (target->buffer_format == PIPE_FORMAT_P016) { + result.p010_mode = 1; + result.msb_mode = 1; + } else { + result.p010_mode = 0; + result.luma_10to8 = 1; + result.chroma_10to8 = 1; + } + } + return result; } @@ -953,6 +964,9 @@ static struct pb_buffer *rvcn_dec_message_decode(struct radeon_decoder *dec, /* SDB left tile pixel */ ctx_size += 8 * 2 * 4096; + if (dec->base.profile == PIPE_VIDEO_PROFILE_VP9_PROFILE2) + ctx_size += 8 * 2 * 4096; + if (!si_vid_create_buffer(dec->screen, &dec->ctx, ctx_size, PIPE_USAGE_DEFAULT)) RVID_ERR("Can't allocated context buffer.\n"); si_vid_clear_buffer(dec->base.context, &dec->ctx); @@ -1260,6 +1274,8 @@ static unsigned calc_dpb_size(struct radeon_decoder *dec) max_references = MAX2(max_references, 9); dpb_size = (4096 * 3000 * 3 / 2) * max_references; + if (dec->base.profile == PIPE_VIDEO_PROFILE_VP9_PROFILE2) + dpb_size *= (3 / 2); break; default: -- 2.30.2