mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-01 03:48:06 +02:00
radeon/vcn: allocate non-tmz context buffer for VCN2+
By design, context buffer should be allocated as TMZ buffer for secure playback for VCN 1 only. For VCN 2&2+, context buffer should be moved out of TMZ. Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com> Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11388>
This commit is contained in:
parent
796358e2f5
commit
e1af22d9dd
2 changed files with 7 additions and 4 deletions
|
|
@ -1550,12 +1550,12 @@ static struct pb_buffer *rvcn_dec_message_decode(struct radeon_decoder *dec,
|
|||
if (dec->stream_type == RDECODE_CODEC_H264_PERF) {
|
||||
unsigned ctx_size = calc_ctx_size_h264_perf(dec);
|
||||
bool r;
|
||||
if (encrypted) {
|
||||
if (encrypted && dec->tmz_ctx) {
|
||||
r = si_vid_create_tmz_buffer(dec->screen, &dec->ctx, ctx_size, PIPE_USAGE_DEFAULT);
|
||||
} else {
|
||||
r = si_vid_create_buffer(dec->screen, &dec->ctx, ctx_size, PIPE_USAGE_DEFAULT);
|
||||
}
|
||||
assert(encrypted == (bool)(dec->ctx.res->flags & RADEON_FLAG_ENCRYPTED));
|
||||
assert((encrypted && dec->tmz_ctx) == (bool)(dec->ctx.res->flags & RADEON_FLAG_ENCRYPTED));
|
||||
|
||||
if (!r) {
|
||||
RVID_ERR("Can't allocated context buffer.\n");
|
||||
|
|
@ -1586,7 +1586,7 @@ static struct pb_buffer *rvcn_dec_message_decode(struct radeon_decoder *dec,
|
|||
if (dec->base.profile == PIPE_VIDEO_PROFILE_VP9_PROFILE2)
|
||||
ctx_size += 8 * 2 * 4096;
|
||||
|
||||
if (encrypted) {
|
||||
if (encrypted && dec->tmz_ctx) {
|
||||
r = si_vid_create_tmz_buffer(dec->screen, &dec->ctx, ctx_size, PIPE_USAGE_DEFAULT);
|
||||
} else {
|
||||
r = si_vid_create_buffer(dec->screen, &dec->ctx, ctx_size, PIPE_USAGE_DEFAULT);
|
||||
|
|
@ -1611,7 +1611,7 @@ static struct pb_buffer *rvcn_dec_message_decode(struct radeon_decoder *dec,
|
|||
else
|
||||
ctx_size = calc_ctx_size_h265_main(dec);
|
||||
|
||||
if (encrypted) {
|
||||
if (encrypted && dec->tmz_ctx) {
|
||||
r = si_vid_create_tmz_buffer(dec->screen, &dec->ctx, ctx_size, PIPE_USAGE_DEFAULT);
|
||||
} else {
|
||||
r = si_vid_create_buffer(dec->screen, &dec->ctx, ctx_size, PIPE_USAGE_DEFAULT);
|
||||
|
|
@ -2499,6 +2499,8 @@ struct pipe_video_codec *radeon_create_decoder(struct pipe_context *context,
|
|||
list_inithead(&dec->dpb_unref_list);
|
||||
}
|
||||
|
||||
dec->tmz_ctx = sctx->family < CHIP_RENOIR;
|
||||
|
||||
return &dec->base;
|
||||
|
||||
error:
|
||||
|
|
|
|||
|
|
@ -1104,6 +1104,7 @@ struct radeon_decoder {
|
|||
void *render_pic_list[32];
|
||||
bool show_frame;
|
||||
unsigned ref_idx;
|
||||
bool tmz_ctx;
|
||||
struct {
|
||||
unsigned data0;
|
||||
unsigned data1;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue