Lines Matching refs:p_hal
84 static MPP_RET prepare_header(Avs2dHalCtx_t *p_hal, RK_U8 *data, RK_U32 len) in prepare_header() argument
89 Avs2dSyntax_t *syntax = &p_hal->syntax; in prepare_header()
172 static MPP_RET prepare_scalist(Avs2dHalCtx_t *p_hal, RK_U8 *data, RK_U32 len) in prepare_scalist() argument
174 Avs2dSyntax_t *syntax = &p_hal->syntax; in prepare_scalist()
214 static RK_S32 get_frame_fd(Avs2dHalCtx_t *p_hal, RK_S32 idx) in get_frame_fd() argument
219 mpp_buf_slot_get_prop(p_hal->frame_slots, idx, SLOT_BUFFER, &mbuffer); in get_frame_fd()
225 static RK_S32 get_packet_fd(Avs2dHalCtx_t *p_hal, RK_S32 idx) in get_packet_fd() argument
230 mpp_buf_slot_get_prop(p_hal->packet_slots, idx, SLOT_BUFFER, &mbuffer); in get_packet_fd()
323 Avs2dHalCtx_t *p_hal = (Avs2dHalCtx_t *)hal; in hal_avs2d_rcb_info_update() local
324 Avs2dRkvRegCtx_t *reg_ctx = (Avs2dRkvRegCtx_t *)p_hal->reg_ctx; in hal_avs2d_rcb_info_update()
325 RK_S32 width = p_hal->syntax.pp.pic_width_in_luma_samples; in hal_avs2d_rcb_info_update()
326 RK_S32 height = p_hal->syntax.pp.pic_height_in_luma_samples; in hal_avs2d_rcb_info_update()
328 RK_S32 loop = p_hal->fast_mode ? MPP_ARRAY_ELEMS(reg_ctx->reg_buf) : 1; in hal_avs2d_rcb_info_update()
333 avs2d_refine_rcb_size(reg_ctx->rcb_info, width, height, (void *)&p_hal->syntax); in hal_avs2d_rcb_info_update()
343 ret = mpp_buffer_get(p_hal->buf_group, &rcb_buf, reg_ctx->rcb_buf_size); in hal_avs2d_rcb_info_update()
351 static MPP_RET fill_registers(Avs2dHalCtx_t *p_hal, Vdpu383Avs2dRegSet *regs, HalTaskInfo *task) in fill_registers() argument
356 Avs2dSyntax_t *syntax = &p_hal->syntax; in fill_registers()
364 mpp_buf_slot_get_prop(p_hal->frame_slots, task_dec->output, SLOT_FRAME_PTR, &mframe); in fill_registers()
405 RK_S32 fd = get_frame_fd(p_hal, task_dec->output); in fill_registers()
411 mv_buf = hal_bufs_get_buf(p_hal->cmv_bufs, task_dec->output); in fill_registers()
445 mpp_buf_slot_get_prop(p_hal->frame_slots, slot_idx, SLOT_FRAME_PTR, &frame_ref); in fill_registers()
448 regs->avs2d_addrs.reg170_185_ref_base[i] = get_frame_fd(p_hal, slot_idx); in fill_registers()
449 … regs->avs2d_addrs.reg195_210_payload_st_ref_base[i] = get_frame_fd(p_hal, slot_idx); in fill_registers()
450 mv_buf = hal_bufs_get_buf(p_hal->cmv_bufs, slot_idx); in fill_registers()
456 if (p_hal->syntax.refp.scene_ref_enable && p_hal->syntax.refp.scene_ref_slot_idx >= 0) { in fill_registers()
458 RK_S32 slot_idx = p_hal->syntax.refp.scene_ref_slot_idx; in fill_registers()
459 RK_S32 replace_idx = p_hal->syntax.refp.scene_ref_replace_pos; in fill_registers()
461 mpp_buf_slot_get_prop(p_hal->frame_slots, slot_idx, SLOT_FRAME_PTR, &scene_ref); in fill_registers()
464 regs->avs2d_addrs.reg170_185_ref_base[replace_idx] = get_frame_fd(p_hal, slot_idx); in fill_registers()
466 mv_buf = hal_bufs_get_buf(p_hal->cmv_bufs, slot_idx); in fill_registers()
476 regs->common_addr.reg128_strm_base = get_packet_fd(p_hal, task_dec->input); in fill_registers()
483 mpp_buf_slot_get_prop(p_hal->frame_slots, task_dec->output, in fill_registers()
487 vdpu383_setup_down_scale(mframe, p_hal->dev, ®s->ctrl_regs, in fill_registers()
501 Avs2dHalCtx_t *p_hal = (Avs2dHalCtx_t *)hal; in hal_avs2d_vdpu383_deinit() local
502 Avs2dRkvRegCtx_t *reg_ctx = (Avs2dRkvRegCtx_t *)p_hal->reg_ctx; in hal_avs2d_vdpu383_deinit()
509 loop = p_hal->fast_mode ? MPP_ARRAY_ELEMS(reg_ctx->reg_buf) : 1; in hal_avs2d_vdpu383_deinit()
524 if (p_hal->cmv_bufs) { in hal_avs2d_vdpu383_deinit()
525 hal_bufs_deinit(p_hal->cmv_bufs); in hal_avs2d_vdpu383_deinit()
526 p_hal->cmv_bufs = NULL; in hal_avs2d_vdpu383_deinit()
529 MPP_FREE(p_hal->reg_ctx); in hal_avs2d_vdpu383_deinit()
541 Avs2dHalCtx_t *p_hal = (Avs2dHalCtx_t *)hal; in hal_avs2d_vdpu383_init() local
545 INP_CHECK(ret, NULL == p_hal); in hal_avs2d_vdpu383_init()
547 MEM_CHECK(ret, p_hal->reg_ctx = mpp_calloc_size(void, sizeof(Avs2dRkvRegCtx_t))); in hal_avs2d_vdpu383_init()
548 reg_ctx = (Avs2dRkvRegCtx_t *)p_hal->reg_ctx; in hal_avs2d_vdpu383_init()
551 loop = p_hal->fast_mode ? MPP_ARRAY_ELEMS(reg_ctx->reg_buf) : 1; in hal_avs2d_vdpu383_init()
552 FUN_CHECK(ret = mpp_buffer_get(p_hal->buf_group, ®_ctx->bufs, AVS2_ALL_TBL_BUF_SIZE(loop))); in hal_avs2d_vdpu383_init()
555 mpp_buffer_attach_dev(reg_ctx->bufs, p_hal->dev); in hal_avs2d_vdpu383_init()
564 if (!p_hal->fast_mode) { in hal_avs2d_vdpu383_init()
570 mpp_slots_set_prop(p_hal->frame_slots, SLOTS_HOR_ALIGN, mpp_align_128_odd_plus_64); in hal_avs2d_vdpu383_init()
571 mpp_slots_set_prop(p_hal->frame_slots, SLOTS_VER_ALIGN, avs2d_ver_align); in hal_avs2d_vdpu383_init()
572 mpp_slots_set_prop(p_hal->frame_slots, SLOTS_LEN_ALIGN, avs2d_len_align); in hal_avs2d_vdpu383_init()
579 hal_avs2d_vdpu383_deinit(p_hal); in hal_avs2d_vdpu383_init()
597 Avs2dHalCtx_t *p_hal = (Avs2dHalCtx_t *)hal; in set_up_colmv_buf() local
598 Avs2dSyntax_t *syntax = &p_hal->syntax; in set_up_colmv_buf()
600 RK_U32 ctu_size = 1 << (p_hal->syntax.pp.lcu_size); in set_up_colmv_buf()
607 if (p_hal->cmv_bufs == NULL || p_hal->mv_size < (RK_U32)mv_size) { in set_up_colmv_buf()
610 if (p_hal->cmv_bufs) { in set_up_colmv_buf()
611 hal_bufs_deinit(p_hal->cmv_bufs); in set_up_colmv_buf()
612 p_hal->cmv_bufs = NULL; in set_up_colmv_buf()
615 hal_bufs_init(&p_hal->cmv_bufs); in set_up_colmv_buf()
616 if (p_hal->cmv_bufs == NULL) { in set_up_colmv_buf()
622 p_hal->mv_size = mv_size; in set_up_colmv_buf()
623 p_hal->mv_count = mpp_buf_slot_get_count(p_hal->frame_slots); in set_up_colmv_buf()
624 hal_bufs_setup(p_hal->cmv_bufs, p_hal->mv_count, 1, &size); in set_up_colmv_buf()
635 Avs2dHalCtx_t *p_hal = (Avs2dHalCtx_t *)hal; in hal_avs2d_vdpu383_gen_regs() local
640 INP_CHECK(ret, NULL == p_hal); in hal_avs2d_vdpu383_gen_regs()
642 !p_hal->cfg->base.disable_error) { in hal_avs2d_vdpu383_gen_regs()
647 ret = set_up_colmv_buf(p_hal); in hal_avs2d_vdpu383_gen_regs()
651 reg_ctx = (Avs2dRkvRegCtx_t *)p_hal->reg_ctx; in hal_avs2d_vdpu383_gen_regs()
653 if (p_hal->fast_mode) { in hal_avs2d_vdpu383_gen_regs()
673 prepare_header(p_hal, reg_ctx->shph_dat, sizeof(reg_ctx->shph_dat) / 8); in hal_avs2d_vdpu383_gen_regs()
674 prepare_scalist(p_hal, reg_ctx->scalist_dat, sizeof(reg_ctx->scalist_dat)); in hal_avs2d_vdpu383_gen_regs()
676 ret = fill_registers(p_hal, regs, task); in hal_avs2d_vdpu383_gen_regs()
686 mpp_dev_set_reg_offset(p_hal->dev, 131, reg_ctx->shph_offset); in hal_avs2d_vdpu383_gen_regs()
690 mpp_dev_set_reg_offset(p_hal->dev, 132, reg_ctx->sclst_offset); in hal_avs2d_vdpu383_gen_regs()
695 hal_avs2d_rcb_info_update(p_hal, regs); in hal_avs2d_vdpu383_gen_regs()
696 vdpu383_setup_rcb(®s->common_addr, p_hal->dev, p_hal->fast_mode ? in hal_avs2d_vdpu383_gen_regs()
716 Avs2dHalCtx_t *p_hal = (Avs2dHalCtx_t *)hal; in hal_avs2d_vdpu383_start() local
719 INP_CHECK(ret, NULL == p_hal); in hal_avs2d_vdpu383_start()
722 !p_hal->cfg->base.disable_error) { in hal_avs2d_vdpu383_start()
726 reg_ctx = (Avs2dRkvRegCtx_t *)p_hal->reg_ctx; in hal_avs2d_vdpu383_start()
727 regs = p_hal->fast_mode ? reg_ctx->reg_buf[task->dec.reg_index].regs : reg_ctx->regs; in hal_avs2d_vdpu383_start()
728 dev = p_hal->dev; in hal_avs2d_vdpu383_start()
730 p_hal->frame_no++; in hal_avs2d_vdpu383_start()
827 Avs2dHalCtx_t *p_hal = (Avs2dHalCtx_t *)hal; in hal_avs2d_vdpu383_dump_yuv() local
840 ret = mpp_buf_slot_get_prop(p_hal->frame_slots, task->dec.output, SLOT_FRAME_PTR, &frame); in hal_avs2d_vdpu383_dump_yuv()
845 ret = mpp_buf_slot_get_prop(p_hal->frame_slots, task->dec.output, SLOT_BUFFER, &buffer); in hal_avs2d_vdpu383_dump_yuv()
856 p_hal->frame_no); in hal_avs2d_vdpu383_dump_yuv()
887 Avs2dHalCtx_t *p_hal = (Avs2dHalCtx_t *)hal; in hal_avs2d_vdpu383_wait() local
891 INP_CHECK(ret, NULL == p_hal); in hal_avs2d_vdpu383_wait()
892 reg_ctx = (Avs2dRkvRegCtx_t *)p_hal->reg_ctx; in hal_avs2d_vdpu383_wait()
893 regs = p_hal->fast_mode ? reg_ctx->reg_buf[task->dec.reg_index].regs : reg_ctx->regs; in hal_avs2d_vdpu383_wait()
896 !p_hal->cfg->base.disable_error) { in hal_avs2d_vdpu383_wait()
901 ret = mpp_dev_ioctl(p_hal->dev, MPP_DEV_CMD_POLL, NULL); in hal_avs2d_vdpu383_wait()
911 if (p_hal->dec_cb) { in hal_avs2d_vdpu383_wait()
930 AVS2D_HAL_TRACE("hal frame %d hard_err= %d", p_hal->frame_no, param.hard_err); in hal_avs2d_vdpu383_wait()
932 mpp_callback(p_hal->dec_cb, ¶m); in hal_avs2d_vdpu383_wait()
936 if (p_hal->fast_mode) in hal_avs2d_vdpu383_wait()