Lines Matching refs:dec

99 static int flush(struct ruvd_decoder *dec, unsigned flags)  in flush()  argument
101 return dec->ws->cs_flush(dec->cs, flags, NULL); in flush()
105 static void set_reg(struct ruvd_decoder *dec, unsigned reg, uint32_t val) in set_reg() argument
107 radeon_emit(dec->cs, RUVD_PKT0(reg >> 2, 0)); in set_reg()
108 radeon_emit(dec->cs, val); in set_reg()
112 static void send_cmd(struct ruvd_decoder *dec, unsigned cmd, in send_cmd() argument
118 reloc_idx = dec->ws->cs_add_buffer(dec->cs, buf, usage | RADEON_USAGE_SYNCHRONIZED, in send_cmd()
121 if (!dec->use_legacy) { in send_cmd()
123 addr = dec->ws->buffer_get_virtual_address(buf); in send_cmd()
125 set_reg(dec, dec->reg.data0, addr); in send_cmd()
126 set_reg(dec, dec->reg.data1, addr >> 32); in send_cmd()
128 off += dec->ws->buffer_get_reloc_offset(buf); in send_cmd()
129 set_reg(dec, RUVD_GPCOM_VCPU_DATA0, off); in send_cmd()
130 set_reg(dec, RUVD_GPCOM_VCPU_DATA1, reloc_idx * 4); in send_cmd()
132 set_reg(dec, dec->reg.cmd, cmd << 1); in send_cmd()
136 static bool have_it(struct ruvd_decoder *dec) in have_it() argument
138 return dec->stream_type == RUVD_CODEC_H264_PERF || in have_it()
139 dec->stream_type == RUVD_CODEC_H265; in have_it()
143 static void map_msg_fb_it_buf(struct ruvd_decoder *dec) in map_msg_fb_it_buf() argument
149 buf = &dec->msg_fb_it_buffers[dec->cur_buffer]; in map_msg_fb_it_buf()
152 ptr = dec->ws->buffer_map(buf->res->buf, dec->cs, PIPE_TRANSFER_WRITE); in map_msg_fb_it_buf()
155 dec->msg = (struct ruvd_msg *)ptr; in map_msg_fb_it_buf()
156 memset(dec->msg, 0, sizeof(*dec->msg)); in map_msg_fb_it_buf()
158 dec->fb = (uint32_t *)(ptr + FB_BUFFER_OFFSET); in map_msg_fb_it_buf()
159 if (have_it(dec)) in map_msg_fb_it_buf()
160 dec->it = (uint8_t *)(ptr + FB_BUFFER_OFFSET + dec->fb_size); in map_msg_fb_it_buf()
164 static void send_msg_buf(struct ruvd_decoder *dec) in send_msg_buf() argument
169 if (!dec->msg || !dec->fb) in send_msg_buf()
173 buf = &dec->msg_fb_it_buffers[dec->cur_buffer]; in send_msg_buf()
176 dec->ws->buffer_unmap(buf->res->buf); in send_msg_buf()
177 dec->msg = NULL; in send_msg_buf()
178 dec->fb = NULL; in send_msg_buf()
179 dec->it = NULL; in send_msg_buf()
182 if (dec->sessionctx.res) in send_msg_buf()
183 send_cmd(dec, RUVD_CMD_SESSION_CONTEXT_BUFFER, in send_msg_buf()
184 dec->sessionctx.res->buf, 0, RADEON_USAGE_READWRITE, in send_msg_buf()
188 send_cmd(dec, RUVD_CMD_MSG_BUFFER, buf->res->buf, 0, in send_msg_buf()
193 static void next_buffer(struct ruvd_decoder *dec) in next_buffer() argument
195 ++dec->cur_buffer; in next_buffer()
196 dec->cur_buffer %= NUM_BUFFERS; in next_buffer()
200 static uint32_t profile2stream_type(struct ruvd_decoder *dec, unsigned family) in profile2stream_type() argument
202 switch (u_reduce_video_profile(dec->base.profile)) { in profile2stream_type()
228 static unsigned calc_ctx_size_h264_perf(struct ruvd_decoder *dec) in calc_ctx_size_h264_perf() argument
231 unsigned width = align(dec->base.width, VL_MACROBLOCK_WIDTH); in calc_ctx_size_h264_perf()
232 unsigned height = align(dec->base.height, VL_MACROBLOCK_HEIGHT); in calc_ctx_size_h264_perf()
234 unsigned max_references = dec->base.max_references + 1; in calc_ctx_size_h264_perf()
240 if (!dec->use_legacy) { in calc_ctx_size_h264_perf()
243 switch(dec->base.level) { in calc_ctx_size_h264_perf()
282 static unsigned calc_ctx_size_h265_main(struct ruvd_decoder *dec) in calc_ctx_size_h265_main() argument
284 unsigned width = align(dec->base.width, VL_MACROBLOCK_WIDTH); in calc_ctx_size_h265_main()
285 unsigned height = align(dec->base.height, VL_MACROBLOCK_HEIGHT); in calc_ctx_size_h265_main()
287 unsigned max_references = dec->base.max_references + 1; in calc_ctx_size_h265_main()
289 if (dec->base.width * dec->base.height >= 4096*2000) in calc_ctx_size_h265_main()
299 static unsigned calc_ctx_size_h265_main10(struct ruvd_decoder *dec, struct pipe_h265_picture_desc *… in calc_ctx_size_h265_main10() argument
305 unsigned width = align(dec->base.width, VL_MACROBLOCK_WIDTH); in calc_ctx_size_h265_main10()
306 unsigned height = align(dec->base.height, VL_MACROBLOCK_HEIGHT); in calc_ctx_size_h265_main10()
309 unsigned max_references = dec->base.max_references + 1; in calc_ctx_size_h265_main10()
311 if (dec->base.width * dec->base.height >= 4096*2000) in calc_ctx_size_h265_main10()
332 static unsigned get_db_pitch_alignment(struct ruvd_decoder *dec) in get_db_pitch_alignment() argument
334 if (((struct si_screen*)dec->screen)->info.family < CHIP_VEGA10) in get_db_pitch_alignment()
341 static unsigned calc_dpb_size(struct ruvd_decoder *dec) in calc_dpb_size() argument
346 unsigned width = align(dec->base.width, VL_MACROBLOCK_WIDTH); in calc_dpb_size()
347 unsigned height = align(dec->base.height, VL_MACROBLOCK_HEIGHT); in calc_dpb_size()
350 unsigned max_references = dec->base.max_references + 1; in calc_dpb_size()
353 image_size = align(width, get_db_pitch_alignment(dec)) * height; in calc_dpb_size()
361 switch (u_reduce_video_profile(dec->base.profile)) { in calc_dpb_size()
363 if (!dec->use_legacy) { in calc_dpb_size()
367 if (dec->stream_type == RUVD_CODEC_H264_PERF) in calc_dpb_size()
369 switch(dec->base.level) { in calc_dpb_size()
398 if ((dec->stream_type != RUVD_CODEC_H264_PERF) || in calc_dpb_size()
399 (((struct si_screen*)dec->screen)->info.family < CHIP_POLARIS10)) { in calc_dpb_size()
408 if ((dec->stream_type != RUVD_CODEC_H264_PERF) || in calc_dpb_size()
409 (((struct si_screen*)dec->screen)->info.family < CHIP_POLARIS10)) { in calc_dpb_size()
420 if (dec->base.width * dec->base.height >= 4096*2000) in calc_dpb_size()
427 if (dec->base.profile == PIPE_VIDEO_PROFILE_HEVC_MAIN_10) in calc_dpb_size()
428 …dpb_size = align((align(width, get_db_pitch_alignment(dec)) * height * 9) / 4, 256) * max_referenc… in calc_dpb_size()
430 …dpb_size = align((align(width, get_db_pitch_alignment(dec)) * height * 3) / 2, 256) * max_referenc… in calc_dpb_size()
493 static struct ruvd_h264 get_h264_msg(struct ruvd_decoder *dec, struct pipe_h264_picture_desc *pic) in get_h264_msg() argument
517 result.level = dec->base.level; in get_h264_msg()
531 switch (dec->base.chroma_format) { in get_h264_msg()
569 if (dec->stream_type == RUVD_CODEC_H264_PERF) { in get_h264_msg()
570 memcpy(dec->it, result.scaling_list_4x4, 6*16); in get_h264_msg()
571 memcpy((dec->it + 96), result.scaling_list_8x8, 2*64); in get_h264_msg()
591 static struct ruvd_h265 get_h265_msg(struct ruvd_decoder *dec, struct pipe_video_buffer *target, in get_h265_msg() argument
609 if (((struct si_screen*)dec->screen)->info.family == CHIP_CARRIZO) in get_h265_msg()
679 if (dec->render_pic_list[i] == pic->ref[j]) in get_h265_msg()
682 dec->render_pic_list[i] = NULL; in get_h265_msg()
684 dec->render_pic_list[i] = NULL; in get_h265_msg()
688 if (dec->render_pic_list[i] == NULL) { in get_h265_msg()
689 dec->render_pic_list[i] = target; in get_h265_msg()
695 vl_video_buffer_set_associated_data(target, &dec->base, in get_h265_msg()
706 ref_pic = (uintptr_t)vl_video_buffer_get_associated_data(ref, &dec->base); in get_h265_msg()
733 memcpy(dec->it, pic->pps->sps->ScalingList4x4, 6 * 16); in get_h265_msg()
734 memcpy(dec->it + 96, pic->pps->sps->ScalingList8x8, 6 * 64); in get_h265_msg()
735 memcpy(dec->it + 480, pic->pps->sps->ScalingList16x16, 6 * 64); in get_h265_msg()
736 memcpy(dec->it + 864, pic->pps->sps->ScalingList32x32, 2 * 64); in get_h265_msg()
844 static uint32_t get_ref_pic_idx(struct ruvd_decoder *dec, struct pipe_video_buffer *ref) in get_ref_pic_idx() argument
846 uint32_t min = MAX2(dec->frame_number, NUM_MPEG2_REFS) - NUM_MPEG2_REFS; in get_ref_pic_idx()
847 uint32_t max = MAX2(dec->frame_number, 1) - 1; in get_ref_pic_idx()
855 frame = (uintptr_t)vl_video_buffer_get_associated_data(ref, &dec->base); in get_ref_pic_idx()
862 static struct ruvd_mpeg2 get_mpeg2_msg(struct ruvd_decoder *dec, in get_mpeg2_msg() argument
870 result.decoded_pic_idx = dec->frame_number; in get_mpeg2_msg()
872 result.ref_pic_idx[i] = get_ref_pic_idx(dec, pic->ref[i]); in get_mpeg2_msg()
908 static struct ruvd_mpeg4 get_mpeg4_msg(struct ruvd_decoder *dec, in get_mpeg4_msg() argument
915 result.decoded_pic_idx = dec->frame_number; in get_mpeg4_msg()
917 result.ref_pic_idx[i] = get_ref_pic_idx(dec, pic->ref[i]); in get_mpeg4_msg()
925 result.video_object_layer_width = dec->base.width; in get_mpeg4_msg()
926 result.video_object_layer_height = dec->base.height; in get_mpeg4_msg()
968 static void get_mjpeg_slice_header(struct ruvd_decoder *dec, struct pipe_mjpeg_picture_desc *pic) in get_mjpeg_slice_header() argument
972 uint8_t *buf = dec->bs_ptr; in get_mjpeg_slice_header()
1097 dec->bs_ptr += size; in get_mjpeg_slice_header()
1098 dec->bs_size += size; in get_mjpeg_slice_header()
1106 struct ruvd_decoder *dec = (struct ruvd_decoder*)decoder; in ruvd_destroy() local
1111 map_msg_fb_it_buf(dec); in ruvd_destroy()
1112 dec->msg->size = sizeof(*dec->msg); in ruvd_destroy()
1113 dec->msg->msg_type = RUVD_MSG_DESTROY; in ruvd_destroy()
1114 dec->msg->stream_handle = dec->stream_handle; in ruvd_destroy()
1115 send_msg_buf(dec); in ruvd_destroy()
1117 flush(dec, 0); in ruvd_destroy()
1119 dec->ws->cs_destroy(dec->cs); in ruvd_destroy()
1122 si_vid_destroy_buffer(&dec->msg_fb_it_buffers[i]); in ruvd_destroy()
1123 si_vid_destroy_buffer(&dec->bs_buffers[i]); in ruvd_destroy()
1126 si_vid_destroy_buffer(&dec->dpb); in ruvd_destroy()
1127 si_vid_destroy_buffer(&dec->ctx); in ruvd_destroy()
1128 si_vid_destroy_buffer(&dec->sessionctx); in ruvd_destroy()
1130 FREE(dec); in ruvd_destroy()
1140 struct ruvd_decoder *dec = (struct ruvd_decoder*)decoder; in ruvd_begin_frame() local
1145 frame = ++dec->frame_number; in ruvd_begin_frame()
1149 dec->bs_size = 0; in ruvd_begin_frame()
1150 dec->bs_ptr = dec->ws->buffer_map( in ruvd_begin_frame()
1151 dec->bs_buffers[dec->cur_buffer].res->buf, in ruvd_begin_frame()
1152 dec->cs, PIPE_TRANSFER_WRITE); in ruvd_begin_frame()
1178 struct ruvd_decoder *dec = (struct ruvd_decoder*)decoder; in ruvd_decode_bitstream() local
1184 if (!dec->bs_ptr) in ruvd_decode_bitstream()
1188 get_mjpeg_slice_header(dec, (struct pipe_mjpeg_picture_desc*)picture); in ruvd_decode_bitstream()
1191 struct rvid_buffer *buf = &dec->bs_buffers[dec->cur_buffer]; in ruvd_decode_bitstream()
1192 unsigned new_size = dec->bs_size + sizes[i]; in ruvd_decode_bitstream()
1198 dec->ws->buffer_unmap(buf->res->buf); in ruvd_decode_bitstream()
1199 if (!si_vid_resize_buffer(dec->screen, dec->cs, buf, new_size)) { in ruvd_decode_bitstream()
1204 dec->bs_ptr = dec->ws->buffer_map(buf->res->buf, dec->cs, in ruvd_decode_bitstream()
1206 if (!dec->bs_ptr) in ruvd_decode_bitstream()
1209 dec->bs_ptr += dec->bs_size; in ruvd_decode_bitstream()
1212 memcpy(dec->bs_ptr, buffers[i], sizes[i]); in ruvd_decode_bitstream()
1213 dec->bs_size += sizes[i]; in ruvd_decode_bitstream()
1214 dec->bs_ptr += sizes[i]; in ruvd_decode_bitstream()
1218 ((uint8_t *)dec->bs_ptr)[0] = 0xff; /* EOI */ in ruvd_decode_bitstream()
1219 ((uint8_t *)dec->bs_ptr)[1] = 0xd9; in ruvd_decode_bitstream()
1220 dec->bs_size += 2; in ruvd_decode_bitstream()
1221 dec->bs_ptr += 2; in ruvd_decode_bitstream()
1232 struct ruvd_decoder *dec = (struct ruvd_decoder*)decoder; in ruvd_end_frame() local
1239 if (!dec->bs_ptr) in ruvd_end_frame()
1242 msg_fb_it_buf = &dec->msg_fb_it_buffers[dec->cur_buffer]; in ruvd_end_frame()
1243 bs_buf = &dec->bs_buffers[dec->cur_buffer]; in ruvd_end_frame()
1245 bs_size = align(dec->bs_size, 128); in ruvd_end_frame()
1246 memset(dec->bs_ptr, 0, bs_size - dec->bs_size); in ruvd_end_frame()
1247 dec->ws->buffer_unmap(bs_buf->res->buf); in ruvd_end_frame()
1249 map_msg_fb_it_buf(dec); in ruvd_end_frame()
1250 dec->msg->size = sizeof(*dec->msg); in ruvd_end_frame()
1251 dec->msg->msg_type = RUVD_MSG_DECODE; in ruvd_end_frame()
1252 dec->msg->stream_handle = dec->stream_handle; in ruvd_end_frame()
1253 dec->msg->status_report_feedback_number = dec->frame_number; in ruvd_end_frame()
1255 dec->msg->body.decode.stream_type = dec->stream_type; in ruvd_end_frame()
1256 dec->msg->body.decode.decode_flags = 0x1; in ruvd_end_frame()
1257 dec->msg->body.decode.width_in_samples = dec->base.width; in ruvd_end_frame()
1258 dec->msg->body.decode.height_in_samples = dec->base.height; in ruvd_end_frame()
1262 dec->msg->body.decode.width_in_samples = align(dec->msg->body.decode.width_in_samples, 16) / 16; in ruvd_end_frame()
1263 dec->msg->body.decode.height_in_samples = align(dec->msg->body.decode.height_in_samples, 16) / 16; in ruvd_end_frame()
1266 if (dec->dpb.res) in ruvd_end_frame()
1267 dec->msg->body.decode.dpb_size = dec->dpb.res->buf->size; in ruvd_end_frame()
1268 dec->msg->body.decode.bsd_size = bs_size; in ruvd_end_frame()
1269 dec->msg->body.decode.db_pitch = align(dec->base.width, get_db_pitch_alignment(dec)); in ruvd_end_frame()
1271 if (dec->stream_type == RUVD_CODEC_H264_PERF && in ruvd_end_frame()
1272 ((struct si_screen*)dec->screen)->info.family >= CHIP_POLARIS10) in ruvd_end_frame()
1273 dec->msg->body.decode.dpb_reserved = dec->ctx.res->buf->size; in ruvd_end_frame()
1275 dt = dec->set_dtb(dec->msg, (struct vl_video_buffer *)target); in ruvd_end_frame()
1276 if (((struct si_screen*)dec->screen)->info.family >= CHIP_STONEY) in ruvd_end_frame()
1277 dec->msg->body.decode.dt_wa_chroma_top_offset = dec->msg->body.decode.dt_pitch / 2; in ruvd_end_frame()
1281 dec->msg->body.decode.codec.h264 = get_h264_msg(dec, (struct pipe_h264_picture_desc*)picture); in ruvd_end_frame()
1285dec->msg->body.decode.codec.h265 = get_h265_msg(dec, target, (struct pipe_h265_picture_desc*)pictu… in ruvd_end_frame()
1286 if (dec->ctx.res == NULL) { in ruvd_end_frame()
1288 if (dec->base.profile == PIPE_VIDEO_PROFILE_HEVC_MAIN_10) in ruvd_end_frame()
1289 ctx_size = calc_ctx_size_h265_main10(dec, (struct pipe_h265_picture_desc*)picture); in ruvd_end_frame()
1291 ctx_size = calc_ctx_size_h265_main(dec); in ruvd_end_frame()
1292 if (!si_vid_create_buffer(dec->screen, &dec->ctx, ctx_size, PIPE_USAGE_DEFAULT)) { in ruvd_end_frame()
1295 si_vid_clear_buffer(decoder->context, &dec->ctx); in ruvd_end_frame()
1298 if (dec->ctx.res) in ruvd_end_frame()
1299 dec->msg->body.decode.dpb_reserved = dec->ctx.res->buf->size; in ruvd_end_frame()
1303 dec->msg->body.decode.codec.vc1 = get_vc1_msg((struct pipe_vc1_picture_desc*)picture); in ruvd_end_frame()
1307 dec->msg->body.decode.codec.mpeg2 = get_mpeg2_msg(dec, (struct pipe_mpeg12_picture_desc*)picture); in ruvd_end_frame()
1311 dec->msg->body.decode.codec.mpeg4 = get_mpeg4_msg(dec, (struct pipe_mpeg4_picture_desc*)picture); in ruvd_end_frame()
1322 dec->msg->body.decode.db_surf_tile_config = dec->msg->body.decode.dt_surf_tile_config; in ruvd_end_frame()
1323 dec->msg->body.decode.extension_support = 0x1; in ruvd_end_frame()
1326 dec->fb[0] = dec->fb_size; in ruvd_end_frame()
1328 send_msg_buf(dec); in ruvd_end_frame()
1330 if (dec->dpb.res) in ruvd_end_frame()
1331 send_cmd(dec, RUVD_CMD_DPB_BUFFER, dec->dpb.res->buf, 0, in ruvd_end_frame()
1334 if (dec->ctx.res) in ruvd_end_frame()
1335 send_cmd(dec, RUVD_CMD_CONTEXT_BUFFER, dec->ctx.res->buf, 0, in ruvd_end_frame()
1337 send_cmd(dec, RUVD_CMD_BITSTREAM_BUFFER, bs_buf->res->buf, in ruvd_end_frame()
1339 send_cmd(dec, RUVD_CMD_DECODING_TARGET_BUFFER, dt, 0, in ruvd_end_frame()
1341 send_cmd(dec, RUVD_CMD_FEEDBACK_BUFFER, msg_fb_it_buf->res->buf, in ruvd_end_frame()
1343 if (have_it(dec)) in ruvd_end_frame()
1344 send_cmd(dec, RUVD_CMD_ITSCALING_TABLE_BUFFER, msg_fb_it_buf->res->buf, in ruvd_end_frame()
1345 FB_BUFFER_OFFSET + dec->fb_size, RADEON_USAGE_READ, RADEON_DOMAIN_GTT); in ruvd_end_frame()
1346 set_reg(dec, dec->reg.cntl, 1); in ruvd_end_frame()
1348 flush(dec, PIPE_FLUSH_ASYNC); in ruvd_end_frame()
1349 next_buffer(dec); in ruvd_end_frame()
1371 struct ruvd_decoder *dec; in si_common_uvd_create_decoder() local
1394 dec = CALLOC_STRUCT(ruvd_decoder); in si_common_uvd_create_decoder()
1396 if (!dec) in si_common_uvd_create_decoder()
1400 dec->use_legacy = true; in si_common_uvd_create_decoder()
1402 dec->base = *templ; in si_common_uvd_create_decoder()
1403 dec->base.context = context; in si_common_uvd_create_decoder()
1404 dec->base.width = width; in si_common_uvd_create_decoder()
1405 dec->base.height = height; in si_common_uvd_create_decoder()
1407 dec->base.destroy = ruvd_destroy; in si_common_uvd_create_decoder()
1408 dec->base.begin_frame = ruvd_begin_frame; in si_common_uvd_create_decoder()
1409 dec->base.decode_macroblock = ruvd_decode_macroblock; in si_common_uvd_create_decoder()
1410 dec->base.decode_bitstream = ruvd_decode_bitstream; in si_common_uvd_create_decoder()
1411 dec->base.end_frame = ruvd_end_frame; in si_common_uvd_create_decoder()
1412 dec->base.flush = ruvd_flush; in si_common_uvd_create_decoder()
1414 dec->stream_type = profile2stream_type(dec, rctx->family); in si_common_uvd_create_decoder()
1415 dec->set_dtb = set_dtb; in si_common_uvd_create_decoder()
1416 dec->stream_handle = si_vid_alloc_stream_handle(); in si_common_uvd_create_decoder()
1417 dec->screen = context->screen; in si_common_uvd_create_decoder()
1418 dec->ws = ws; in si_common_uvd_create_decoder()
1419 dec->cs = ws->cs_create(rctx->ctx, RING_UVD, NULL, NULL); in si_common_uvd_create_decoder()
1420 if (!dec->cs) { in si_common_uvd_create_decoder()
1426 dec->render_pic_list[i] = NULL; in si_common_uvd_create_decoder()
1427 dec->fb_size = (rctx->family == CHIP_TONGA) ? FB_BUFFER_SIZE_TONGA : in si_common_uvd_create_decoder()
1431 unsigned msg_fb_it_size = FB_BUFFER_OFFSET + dec->fb_size; in si_common_uvd_create_decoder()
1433 if (have_it(dec)) in si_common_uvd_create_decoder()
1435 if (!si_vid_create_buffer(dec->screen, &dec->msg_fb_it_buffers[i], in si_common_uvd_create_decoder()
1441 if (!si_vid_create_buffer(dec->screen, &dec->bs_buffers[i], in si_common_uvd_create_decoder()
1447 si_vid_clear_buffer(context, &dec->msg_fb_it_buffers[i]); in si_common_uvd_create_decoder()
1448 si_vid_clear_buffer(context, &dec->bs_buffers[i]); in si_common_uvd_create_decoder()
1451 dpb_size = calc_dpb_size(dec); in si_common_uvd_create_decoder()
1453 if (!si_vid_create_buffer(dec->screen, &dec->dpb, dpb_size, PIPE_USAGE_DEFAULT)) { in si_common_uvd_create_decoder()
1457 si_vid_clear_buffer(context, &dec->dpb); in si_common_uvd_create_decoder()
1460 if (dec->stream_type == RUVD_CODEC_H264_PERF && rctx->family >= CHIP_POLARIS10) { in si_common_uvd_create_decoder()
1461 unsigned ctx_size = calc_ctx_size_h264_perf(dec); in si_common_uvd_create_decoder()
1462 if (!si_vid_create_buffer(dec->screen, &dec->ctx, ctx_size, PIPE_USAGE_DEFAULT)) { in si_common_uvd_create_decoder()
1466 si_vid_clear_buffer(context, &dec->ctx); in si_common_uvd_create_decoder()
1470 if (!si_vid_create_buffer(dec->screen, &dec->sessionctx, in si_common_uvd_create_decoder()
1476 si_vid_clear_buffer(context, &dec->sessionctx); in si_common_uvd_create_decoder()
1480 dec->reg.data0 = RUVD_GPCOM_VCPU_DATA0_SOC15; in si_common_uvd_create_decoder()
1481 dec->reg.data1 = RUVD_GPCOM_VCPU_DATA1_SOC15; in si_common_uvd_create_decoder()
1482 dec->reg.cmd = RUVD_GPCOM_VCPU_CMD_SOC15; in si_common_uvd_create_decoder()
1483 dec->reg.cntl = RUVD_ENGINE_CNTL_SOC15; in si_common_uvd_create_decoder()
1485 dec->reg.data0 = RUVD_GPCOM_VCPU_DATA0; in si_common_uvd_create_decoder()
1486 dec->reg.data1 = RUVD_GPCOM_VCPU_DATA1; in si_common_uvd_create_decoder()
1487 dec->reg.cmd = RUVD_GPCOM_VCPU_CMD; in si_common_uvd_create_decoder()
1488 dec->reg.cntl = RUVD_ENGINE_CNTL; in si_common_uvd_create_decoder()
1491 map_msg_fb_it_buf(dec); in si_common_uvd_create_decoder()
1492 dec->msg->size = sizeof(*dec->msg); in si_common_uvd_create_decoder()
1493 dec->msg->msg_type = RUVD_MSG_CREATE; in si_common_uvd_create_decoder()
1494 dec->msg->stream_handle = dec->stream_handle; in si_common_uvd_create_decoder()
1495 dec->msg->body.create.stream_type = dec->stream_type; in si_common_uvd_create_decoder()
1496 dec->msg->body.create.width_in_samples = dec->base.width; in si_common_uvd_create_decoder()
1497 dec->msg->body.create.height_in_samples = dec->base.height; in si_common_uvd_create_decoder()
1498 dec->msg->body.create.dpb_size = dpb_size; in si_common_uvd_create_decoder()
1499 send_msg_buf(dec); in si_common_uvd_create_decoder()
1500 r = flush(dec, 0); in si_common_uvd_create_decoder()
1504 next_buffer(dec); in si_common_uvd_create_decoder()
1506 return &dec->base; in si_common_uvd_create_decoder()
1509 if (dec->cs) dec->ws->cs_destroy(dec->cs); in si_common_uvd_create_decoder()
1512 si_vid_destroy_buffer(&dec->msg_fb_it_buffers[i]); in si_common_uvd_create_decoder()
1513 si_vid_destroy_buffer(&dec->bs_buffers[i]); in si_common_uvd_create_decoder()
1516 si_vid_destroy_buffer(&dec->dpb); in si_common_uvd_create_decoder()
1517 si_vid_destroy_buffer(&dec->ctx); in si_common_uvd_create_decoder()
1518 si_vid_destroy_buffer(&dec->sessionctx); in si_common_uvd_create_decoder()
1520 FREE(dec); in si_common_uvd_create_decoder()