diff options
author | Leo Liu <[email protected]> | 2018-03-14 15:09:07 -0400 |
---|---|---|
committer | Leo Liu <[email protected]> | 2018-04-12 11:15:13 -0400 |
commit | 905368669d7b3acaa358c1169e57bddc9fa39411 (patch) | |
tree | 68adb6337d8d69224e9109295e20bc613a03aba6 | |
parent | e2ce7c0a6289abbc3a52b315662be70b6e94d4ee (diff) |
radeon/vcn: add VP9 context buffer
Signed-off-by: Leo Liu <[email protected]>
Acked-by: Christian König <[email protected]>
-rw-r--r-- | src/gallium/drivers/radeon/radeon_vcn_dec.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeon/radeon_vcn_dec.c b/src/gallium/drivers/radeon/radeon_vcn_dec.c index 170cc3fa41e..b4cfba1713c 100644 --- a/src/gallium/drivers/radeon/radeon_vcn_dec.c +++ b/src/gallium/drivers/radeon/radeon_vcn_dec.c @@ -936,6 +936,32 @@ static struct pb_buffer *rvcn_dec_message_decode(struct radeon_decoder *dec, memcpy(codec, (void*)&vp9, sizeof(rvcn_dec_message_vp9_t)); index->message_id = RDECODE_MESSAGE_VP9; + + if (dec->ctx.res == NULL) { + unsigned ctx_size; + uint8_t *ptr; + + /* default probability + probability data */ + ctx_size = 2304 * 5; + + /* SRE collocated context data */ + ctx_size += 32 * 2 * 64 * 64; + + /* SMP collocated context data */ + ctx_size += 9 * 64 * 2 * 64 * 64; + + /* SDB left tile pixel */ + 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); + + /* ctx needs probs table */ + ptr = dec->ws->buffer_map(dec->ctx.res->buf, dec->cs, PIPE_TRANSFER_WRITE); + fill_probs_table(ptr); + dec->ws->buffer_unmap(dec->ctx.res->buf); + } break; } default: |