Lines Matching refs:p_hal

103 static MPP_RET prepare_header(Avs2dHalCtx_t *p_hal, RK_U8 *data, RK_U32 len)  in prepare_header()  argument
108 Avs2dSyntax_t *syntax = &p_hal->syntax; in prepare_header()
185 static MPP_RET prepare_scalist(Avs2dHalCtx_t *p_hal, RK_U8 *data, RK_U32 len) in prepare_scalist() argument
191 Avs2dSyntax_t *syntax = &p_hal->syntax; in prepare_scalist()
213 static RK_S32 get_frame_fd(Avs2dHalCtx_t *p_hal, RK_S32 idx) in get_frame_fd() argument
218 mpp_buf_slot_get_prop(p_hal->frame_slots, idx, SLOT_BUFFER, &mbuffer); in get_frame_fd()
224 static RK_S32 get_packet_fd(Avs2dHalCtx_t *p_hal, RK_S32 idx) in get_packet_fd() argument
229 mpp_buf_slot_get_prop(p_hal->packet_slots, idx, SLOT_BUFFER, &mbuffer); in get_packet_fd()
357 Avs2dHalCtx_t *p_hal = (Avs2dHalCtx_t *)hal; in hal_avs2d_rcb_info_update() local
358 Avs2dVdpu382RegCtx_t *reg_ctx = (Avs2dVdpu382RegCtx_t *)p_hal->reg_ctx; in hal_avs2d_rcb_info_update()
359 RK_S32 width = p_hal->syntax.pp.pic_width_in_luma_samples; in hal_avs2d_rcb_info_update()
360 RK_S32 height = p_hal->syntax.pp.pic_height_in_luma_samples; in hal_avs2d_rcb_info_update()
362 RK_S32 loop = p_hal->fast_mode ? MPP_ARRAY_ELEMS(reg_ctx->reg_buf) : 1; in hal_avs2d_rcb_info_update()
365 avs2d_refine_rcb_size(reg_ctx->rcb_info, hw_regs, width, height, (void *)&p_hal->syntax); in hal_avs2d_rcb_info_update()
375 ret = mpp_buffer_get(p_hal->buf_group, &rcb_buf, reg_ctx->rcb_buf_size); in hal_avs2d_rcb_info_update()
384 static MPP_RET fill_registers(Avs2dHalCtx_t *p_hal, Vdpu382Avs2dRegSet *p_regs, HalTaskInfo *task) in fill_registers() argument
389 Avs2dSyntax_t *syntax = &p_hal->syntax; in fill_registers()
397 mpp_buf_slot_get_prop(p_hal->frame_slots, task_dec->output, SLOT_FRAME_PTR, &mframe); in fill_registers()
433 fd = get_frame_fd(p_hal, task_dec->output); in fill_registers()
436 mv_buf = hal_bufs_get_buf(p_hal->cmv_bufs, task_dec->output); in fill_registers()
470 mpp_buf_slot_get_prop(p_hal->frame_slots, slot_idx, SLOT_FRAME_PTR, &frame_ref); in fill_registers()
483 p_regs->avs2d_addr.ref_base[i] = get_frame_fd(p_hal, slot_idx); in fill_registers()
484 mv_buf = hal_bufs_get_buf(p_hal->cmv_bufs, slot_idx); in fill_registers()
497 if (p_hal->syntax.refp.scene_ref_enable && p_hal->syntax.refp.scene_ref_slot_idx >= 0) { in fill_registers()
499 RK_S32 replace_idx = p_hal->syntax.refp.scene_ref_replace_pos; in fill_registers()
500 RK_S32 slot_idx = p_hal->syntax.refp.scene_ref_slot_idx; in fill_registers()
502 mpp_buf_slot_get_prop(p_hal->frame_slots, slot_idx, SLOT_FRAME_PTR, &scene_ref); in fill_registers()
505 p_regs->avs2d_addr.ref_base[replace_idx] = get_frame_fd(p_hal, slot_idx); in fill_registers()
506 mv_buf = hal_bufs_get_buf(p_hal->cmv_bufs, slot_idx); in fill_registers()
520 p_regs->common_addr.reg128_rlc_base = get_packet_fd(p_hal, task_dec->input); in fill_registers()
530 vdpu382_setup_down_scale(mframe, p_hal->dev, &p_regs->common); in fill_registers()
544 Avs2dHalCtx_t *p_hal = (Avs2dHalCtx_t *)hal; in hal_avs2d_vdpu382_deinit() local
545 Avs2dVdpu382RegCtx_t *reg_ctx = (Avs2dVdpu382RegCtx_t *)p_hal->reg_ctx; in hal_avs2d_vdpu382_deinit()
552 loop = p_hal->fast_mode ? MPP_ARRAY_ELEMS(reg_ctx->reg_buf) : 1; in hal_avs2d_vdpu382_deinit()
567 if (p_hal->cmv_bufs) { in hal_avs2d_vdpu382_deinit()
568 hal_bufs_deinit(p_hal->cmv_bufs); in hal_avs2d_vdpu382_deinit()
569 p_hal->cmv_bufs = NULL; in hal_avs2d_vdpu382_deinit()
572 MPP_FREE(p_hal->reg_ctx); in hal_avs2d_vdpu382_deinit()
584 Avs2dHalCtx_t *p_hal = (Avs2dHalCtx_t *)hal; in hal_avs2d_vdpu382_init() local
588 INP_CHECK(ret, NULL == p_hal); in hal_avs2d_vdpu382_init()
590 MEM_CHECK(ret, p_hal->reg_ctx = mpp_calloc_size(void, sizeof(Avs2dVdpu382RegCtx_t))); in hal_avs2d_vdpu382_init()
591 reg_ctx = (Avs2dVdpu382RegCtx_t *)p_hal->reg_ctx; in hal_avs2d_vdpu382_init()
594 loop = p_hal->fast_mode ? MPP_ARRAY_ELEMS(reg_ctx->reg_buf) : 1; in hal_avs2d_vdpu382_init()
595 FUN_CHECK(ret = mpp_buffer_get(p_hal->buf_group, &reg_ctx->bufs, AVS2_ALL_TBL_BUF_SIZE(loop))); in hal_avs2d_vdpu382_init()
606 if (!p_hal->fast_mode) { in hal_avs2d_vdpu382_init()
613 mpp_slots_set_prop(p_hal->frame_slots, SLOTS_HOR_ALIGN, avs2d_hor_align_64); in hal_avs2d_vdpu382_init()
615 mpp_slots_set_prop(p_hal->frame_slots, SLOTS_HOR_ALIGN, avs2d_hor_align); in hal_avs2d_vdpu382_init()
617 mpp_slots_set_prop(p_hal->frame_slots, SLOTS_HOR_ALIGN, avs2d_hor_align); in hal_avs2d_vdpu382_init()
618 mpp_slots_set_prop(p_hal->frame_slots, SLOTS_VER_ALIGN, avs2d_ver_align); in hal_avs2d_vdpu382_init()
619 mpp_slots_set_prop(p_hal->frame_slots, SLOTS_LEN_ALIGN, avs2d_len_align); in hal_avs2d_vdpu382_init()
626 hal_avs2d_vdpu382_deinit(p_hal); in hal_avs2d_vdpu382_init()
634 Avs2dHalCtx_t *p_hal = (Avs2dHalCtx_t *)hal; in set_up_colmv_buf() local
635 Avs2dSyntax_t *syntax = &p_hal->syntax; in set_up_colmv_buf()
638 RK_U32 ctu_size = 1 << (p_hal->syntax.pp.lcu_size); in set_up_colmv_buf()
639 RK_U32 width = p_hal->syntax.pp.pic_width_in_luma_samples; in set_up_colmv_buf()
640 RK_U32 height = p_hal->syntax.pp.pic_height_in_luma_samples; in set_up_colmv_buf()
648 if (p_hal->cmv_bufs == NULL || p_hal->mv_size < mv_size) { in set_up_colmv_buf()
651 if (p_hal->cmv_bufs) { in set_up_colmv_buf()
652 hal_bufs_deinit(p_hal->cmv_bufs); in set_up_colmv_buf()
653 p_hal->cmv_bufs = NULL; in set_up_colmv_buf()
656 hal_bufs_init(&p_hal->cmv_bufs); in set_up_colmv_buf()
657 if (p_hal->cmv_bufs == NULL) { in set_up_colmv_buf()
663 p_hal->mv_size = mv_size; in set_up_colmv_buf()
664 p_hal->mv_count = mpp_buf_slot_get_count(p_hal->frame_slots); in set_up_colmv_buf()
665 hal_bufs_setup(p_hal->cmv_bufs, p_hal->mv_count, 1, &size); in set_up_colmv_buf()
676 Avs2dHalCtx_t *p_hal = (Avs2dHalCtx_t *)hal; in hal_avs2d_vdpu382_gen_regs() local
681 INP_CHECK(ret, NULL == p_hal); in hal_avs2d_vdpu382_gen_regs()
684 !p_hal->cfg->base.disable_error) { in hal_avs2d_vdpu382_gen_regs()
689 ret = set_up_colmv_buf(p_hal); in hal_avs2d_vdpu382_gen_regs()
693 reg_ctx = (Avs2dVdpu382RegCtx_t *)p_hal->reg_ctx; in hal_avs2d_vdpu382_gen_regs()
695 if (p_hal->fast_mode) { in hal_avs2d_vdpu382_gen_regs()
715 prepare_header(p_hal, reg_ctx->shph_dat, sizeof(reg_ctx->shph_dat)); in hal_avs2d_vdpu382_gen_regs()
716 prepare_scalist(p_hal, reg_ctx->scalist_dat, sizeof(reg_ctx->scalist_dat)); in hal_avs2d_vdpu382_gen_regs()
718 ret = fill_registers(p_hal, regs, task); in hal_avs2d_vdpu382_gen_regs()
729 mpp_dev_set_reg_offset(p_hal->dev, 161, reg_ctx->shph_offset); in hal_avs2d_vdpu382_gen_regs()
735 mpp_dev_set_reg_offset(p_hal->dev, 180, reg_ctx->sclst_offset); in hal_avs2d_vdpu382_gen_regs()
741 snprintf(name, sizeof(name), "/data/tmp/rkv_shph_%03d.bin", p_hal->frame_no); in hal_avs2d_vdpu382_gen_regs()
750 snprintf(name, sizeof(name), "/data/tmp/rkv_scalist_%03d.bin", p_hal->frame_no); in hal_avs2d_vdpu382_gen_regs()
758 hal_avs2d_rcb_info_update(p_hal, regs); in hal_avs2d_vdpu382_gen_regs()
759 vdpu382_setup_rcb(&regs->common_addr, p_hal->dev, p_hal->fast_mode ? in hal_avs2d_vdpu382_gen_regs()
769 snprintf(name, sizeof(name), "/data/tmp/rkv_rcb_%03d.bin", p_hal->frame_no); in hal_avs2d_vdpu382_gen_regs()
791 Avs2dHalCtx_t *p_hal = (Avs2dHalCtx_t *)hal; in hal_avs2d_vdpu382_dump_reg_write() local
795 snprintf(name, sizeof(name), "/data/tmp/rkv_reg_write_%03d.txt", p_hal->frame_no); in hal_avs2d_vdpu382_dump_reg_write()
798 fprintf(fp_reg, "********Frame num %d\n", p_hal->frame_no); in hal_avs2d_vdpu382_dump_reg_write()
849 Avs2dHalCtx_t *p_hal = (Avs2dHalCtx_t *)hal; in hal_avs2d_vdpu382_dump_stream() local
855 mpp_buf_slot_get_prop(p_hal->packet_slots, task->dec.input, SLOT_BUFFER, &buffer); in hal_avs2d_vdpu382_dump_stream()
857 snprintf(name, sizeof(name), "/data/tmp/rkv_stream_in_%03d.bin", p_hal->frame_no); in hal_avs2d_vdpu382_dump_stream()
871 Avs2dHalCtx_t *p_hal = (Avs2dHalCtx_t *)hal; in hal_avs2d_vdpu382_start() local
874 INP_CHECK(ret, NULL == p_hal); in hal_avs2d_vdpu382_start()
877 !p_hal->cfg->base.disable_error) { in hal_avs2d_vdpu382_start()
882 reg_ctx = (Avs2dVdpu382RegCtx_t *)p_hal->reg_ctx; in hal_avs2d_vdpu382_start()
883 regs = p_hal->fast_mode ? reg_ctx->reg_buf[task->dec.reg_index].regs : reg_ctx->regs; in hal_avs2d_vdpu382_start()
884 dev = p_hal->dev; in hal_avs2d_vdpu382_start()
886 p_hal->frame_no++; in hal_avs2d_vdpu382_start()
1029 Avs2dHalCtx_t *p_hal = (Avs2dHalCtx_t *)hal; in hal_avs2d_vdpu382_dump_yuv() local
1042 ret = mpp_buf_slot_get_prop(p_hal->frame_slots, task->dec.output, SLOT_FRAME_PTR, &frame); in hal_avs2d_vdpu382_dump_yuv()
1047 ret = mpp_buf_slot_get_prop(p_hal->frame_slots, task->dec.output, SLOT_BUFFER, &buffer); in hal_avs2d_vdpu382_dump_yuv()
1058 p_hal->frame_no); in hal_avs2d_vdpu382_dump_yuv()
1097 Avs2dHalCtx_t *p_hal = (Avs2dHalCtx_t *)hal; in hal_avs2d_vdpu382_wait() local
1101 INP_CHECK(ret, NULL == p_hal); in hal_avs2d_vdpu382_wait()
1102 reg_ctx = (Avs2dVdpu382RegCtx_t *)p_hal->reg_ctx; in hal_avs2d_vdpu382_wait()
1103 p_regs = p_hal->fast_mode ? reg_ctx->reg_buf[task->dec.reg_index].regs : reg_ctx->regs; in hal_avs2d_vdpu382_wait()
1106 !p_hal->cfg->base.disable_error) { in hal_avs2d_vdpu382_wait()
1111 ret = mpp_dev_ioctl(p_hal->dev, MPP_DEV_CMD_POLL, NULL); in hal_avs2d_vdpu382_wait()
1123 snprintf(name, sizeof(name), "/data/tmp/rkv_reg_read_%03d.txt", p_hal->frame_no); in hal_avs2d_vdpu382_wait()
1134 if (p_hal->dec_cb) { in hal_avs2d_vdpu382_wait()
1156 AVS2D_HAL_TRACE("hal frame %d ref miss %x hard_err %d hw_usage %x", p_hal->frame_no, in hal_avs2d_vdpu382_wait()
1160 AVS2D_HAL_TRACE("hal frame %d hard_err= %d", p_hal->frame_no, param.hard_err); in hal_avs2d_vdpu382_wait()
1162 mpp_callback(p_hal->dec_cb, &param); in hal_avs2d_vdpu382_wait()
1167 if (p_hal->fast_mode) in hal_avs2d_vdpu382_wait()