Lines Matching refs:p_hal
130 static MPP_RET vdpu383_setup_scale_origin_bufs(H264dHalCtx_t *p_hal, MppFrame mframe) in vdpu383_setup_scale_origin_bufs() argument
132 Vdpu383H264dRegCtx *ctx = (Vdpu383H264dRegCtx *)p_hal->reg_ctx; in vdpu383_setup_scale_origin_bufs()
156 static MPP_RET prepare_spspps(H264dHalCtx_t *p_hal, RK_U64 *data, RK_U32 len) in prepare_spspps() argument
160 DXVA_PicParams_H264_MVC *pp = p_hal->pp; in prepare_spspps()
166 if (!p_hal->fast_mode && !pp->spspps_update) { in prepare_spspps()
288 static MPP_RET prepare_framerps(H264dHalCtx_t *p_hal, RK_U64 *data, RK_U32 len) in prepare_framerps() argument
298 DXVA_PicParams_H264_MVC *pp = p_hal->pp; in prepare_framerps()
325 dpb_valid = (p_hal->slice_long[0].RefPicList[0][i].bPicEntry == 0xff) ? 0 : 1; in prepare_framerps()
326 dpb_idx = dpb_valid ? p_hal->slice_long[0].RefPicList[0][i].Index7Bits : 0; in prepare_framerps()
327 bottom_flag = dpb_valid ? p_hal->slice_long[0].RefPicList[0][i].AssociatedFlag : 0; in prepare_framerps()
340 dpb_valid = (p_hal->slice_long[0].RefPicList[j][i].bPicEntry == 0xff) ? 0 : 1; in prepare_framerps()
341 dpb_idx = dpb_valid ? p_hal->slice_long[0].RefPicList[j][i].Index7Bits : 0; in prepare_framerps()
342 bottom_flag = dpb_valid ? p_hal->slice_long[0].RefPicList[j][i].AssociatedFlag : 0; in prepare_framerps()
366 static MPP_RET prepare_scanlist(H264dHalCtx_t *p_hal, RK_U8 *data, RK_U32 len) in prepare_scanlist() argument
370 if (!p_hal->pp->scaleing_list_enable_flag) in prepare_scanlist()
376 data[n++] = p_hal->qm->bScalingLists4x4[i][j * 4 + 0]; in prepare_scanlist()
377 data[n++] = p_hal->qm->bScalingLists4x4[i][j * 4 + 1]; in prepare_scanlist()
378 data[n++] = p_hal->qm->bScalingLists4x4[i][j * 4 + 2]; in prepare_scanlist()
379 data[n++] = p_hal->qm->bScalingLists4x4[i][j * 4 + 3]; in prepare_scanlist()
392 data[n++] = p_hal->qm->bScalingLists8x8[i][pos + j * 8 + 0]; in prepare_scanlist()
393 data[n++] = p_hal->qm->bScalingLists8x8[i][pos + j * 8 + 1]; in prepare_scanlist()
394 data[n++] = p_hal->qm->bScalingLists8x8[i][pos + j * 8 + 2]; in prepare_scanlist()
395 data[n++] = p_hal->qm->bScalingLists8x8[i][pos + j * 8 + 3]; in prepare_scanlist()
415 static MPP_RET set_registers(H264dHalCtx_t *p_hal, Vdpu383H264dRegSet *regs, HalTaskInfo *task) in set_registers() argument
417 DXVA_PicParams_H264_MVC *pp = p_hal->pp; in set_registers()
420 Vdpu383H264dRegCtx *ctx = (Vdpu383H264dRegCtx *)p_hal->reg_ctx; in set_registers()
423 regs->h264d_paras.reg66_stream_len = p_hal->strm_len; in set_registers()
433 mpp_buf_slot_get_prop(p_hal->frame_slots, pp->CurrPic.Index7Bits, SLOT_FRAME_PTR, &mframe); in set_registers()
464 mpp_buf_slot_get_prop(p_hal->frame_slots, pp->CurrPic.Index7Bits, SLOT_BUFFER, &mbuffer); in set_registers()
470 mv_buf = hal_bufs_get_buf(p_hal->cmv_bufs, pp->CurrPic.Index7Bits); in set_registers()
492 mpp_buf_slot_get_prop(p_hal->frame_slots, ref_index, SLOT_BUFFER, &mbuffer); in set_registers()
493 mpp_buf_slot_get_prop(p_hal->frame_slots, ref_index, SLOT_FRAME_PTR, &mframe); in set_registers()
509 mv_buf = hal_bufs_get_buf(p_hal->cmv_bufs, ref_index); in set_registers()
519 mpp_buf_slot_get_prop(p_hal->frame_slots, ref_index, SLOT_BUFFER, &mbuffer); in set_registers()
527 mv_buf = hal_bufs_get_buf(p_hal->cmv_bufs, ref_index); in set_registers()
532 Vdpu383H264dRegCtx *reg_ctx = (Vdpu383H264dRegCtx *)p_hal->reg_ctx; in set_registers()
534 mpp_buf_slot_get_prop(p_hal->packet_slots, task->dec.input, SLOT_BUFFER, &mbuffer); in set_registers()
543 8 * p_hal->strm_len, 128, 0); in set_registers()
548 mpp_dev_set_reg_offset(p_hal->dev, 130, reg_ctx->offset_cabac); in set_registers()
558 mpp_buf_slot_get_prop(p_hal->frame_slots, pp->CurrPic.Index7Bits, SLOT_BUFFER, &mbuffer); in set_registers()
559 mpp_buf_slot_get_prop(p_hal->frame_slots, pp->CurrPic.Index7Bits, in set_registers()
571 … vdpu383_setup_down_scale(mframe, p_hal->dev, ®s->ctrl_regs, (void*)®s->h264d_paras); in set_registers()
575 … vdpu383_setup_down_scale(mframe, p_hal->dev, ®s->ctrl_regs, (void*)®s->h264d_paras); in set_registers()
632 H264dHalCtx_t *p_hal = (H264dHalCtx_t *)hal; in vdpu383_h264d_init() local
634 INP_CHECK(ret, NULL == p_hal); in vdpu383_h264d_init()
637 MEM_CHECK(ret, p_hal->reg_ctx = mpp_calloc_size(void, sizeof(Vdpu383H264dRegCtx))); in vdpu383_h264d_init()
638 Vdpu383H264dRegCtx *reg_ctx = (Vdpu383H264dRegCtx *)p_hal->reg_ctx; in vdpu383_h264d_init()
639 RK_U32 max_cnt = p_hal->fast_mode ? VDPU383_FAST_REG_SET_CNT : 1; in vdpu383_h264d_init()
643 FUN_CHECK(ret = mpp_buffer_get(p_hal->buf_group, ®_ctx->bufs, in vdpu383_h264d_init()
657 mpp_buffer_attach_dev(reg_ctx->bufs, p_hal->dev); in vdpu383_h264d_init()
659 if (!p_hal->fast_mode) { in vdpu383_h264d_init()
670 mpp_slots_set_prop(p_hal->frame_slots, SLOTS_HOR_ALIGN, mpp_align_128_odd_plus_64); in vdpu383_h264d_init()
671 mpp_slots_set_prop(p_hal->frame_slots, SLOTS_VER_ALIGN, rkv_ver_align); in vdpu383_h264d_init()
672 mpp_slots_set_prop(p_hal->frame_slots, SLOTS_LEN_ALIGN, rkv_len_align); in vdpu383_h264d_init()
689 H264dHalCtx_t *p_hal = (H264dHalCtx_t *)hal; in vdpu383_h264d_deinit() local
690 Vdpu383H264dRegCtx *reg_ctx = (Vdpu383H264dRegCtx *)p_hal->reg_ctx; in vdpu383_h264d_deinit()
693 RK_U32 loop = p_hal->fast_mode ? MPP_ARRAY_ELEMS(reg_ctx->reg_buf) : 1; in vdpu383_h264d_deinit()
703 loop = p_hal->fast_mode ? MPP_ARRAY_ELEMS(reg_ctx->rcb_buf) : 1; in vdpu383_h264d_deinit()
711 if (p_hal->cmv_bufs) { in vdpu383_h264d_deinit()
712 hal_bufs_deinit(p_hal->cmv_bufs); in vdpu383_h264d_deinit()
713 p_hal->cmv_bufs = NULL; in vdpu383_h264d_deinit()
721 MPP_FREE(p_hal->reg_ctx); in vdpu383_h264d_deinit()
726 static void h264d_refine_rcb_size(H264dHalCtx_t *p_hal, Vdpu383RcbInfo *rcb_info, in h264d_refine_rcb_size() argument
730 RK_U32 mbaff = p_hal->pp->MbaffFrameFlag; in h264d_refine_rcb_size()
731 RK_U32 bit_depth = p_hal->pp->bit_depth_luma_minus8 + 8; in h264d_refine_rcb_size()
732 RK_U32 chroma_format_idc = p_hal->pp->chroma_format_idc; in h264d_refine_rcb_size()
776 H264dHalCtx_t *p_hal = (H264dHalCtx_t*)hal; in hal_h264d_rcb_info_update() local
777 RK_U32 mbaff = p_hal->pp->MbaffFrameFlag; in hal_h264d_rcb_info_update()
778 RK_U32 bit_depth = p_hal->pp->bit_depth_luma_minus8 + 8; in hal_h264d_rcb_info_update()
779 RK_U32 chroma_format_idc = p_hal->pp->chroma_format_idc; in hal_h264d_rcb_info_update()
780 Vdpu383H264dRegCtx *ctx = (Vdpu383H264dRegCtx *)p_hal->reg_ctx; in hal_h264d_rcb_info_update()
781 RK_S32 width = MPP_ALIGN((p_hal->pp->wFrameWidthInMbsMinus1 + 1) << 4, 64); in hal_h264d_rcb_info_update()
782 RK_S32 height = MPP_ALIGN((p_hal->pp->wFrameHeightInMbsMinus1 + 1) << 4, 64); in hal_h264d_rcb_info_update()
790 RK_U32 loop = p_hal->fast_mode ? MPP_ARRAY_ELEMS(ctx->reg_buf) : 1; in hal_h264d_rcb_info_update()
801 mpp_buffer_get(p_hal->buf_group, &rcb_buf, ctx->rcb_buf_size); in hal_h264d_rcb_info_update()
815 H264dHalCtx_t *p_hal = (H264dHalCtx_t *)hal; in vdpu383_h264d_gen_regs() local
816 RK_S32 width = MPP_ALIGN((p_hal->pp->wFrameWidthInMbsMinus1 + 1) << 4, 64); in vdpu383_h264d_gen_regs()
817 RK_S32 height = MPP_ALIGN((p_hal->pp->wFrameHeightInMbsMinus1 + 1) << 4, 64); in vdpu383_h264d_gen_regs()
818 Vdpu383H264dRegCtx *ctx = (Vdpu383H264dRegCtx *)p_hal->reg_ctx; in vdpu383_h264d_gen_regs()
823 INP_CHECK(ret, NULL == p_hal); in vdpu383_h264d_gen_regs()
826 (task->dec.flags.ref_err && !p_hal->cfg->base.disable_error)) { in vdpu383_h264d_gen_regs()
831 if (!p_hal->pp->frame_mbs_only_flag) in vdpu383_h264d_gen_regs()
834 if (p_hal->cmv_bufs == NULL || p_hal->mv_size < mv_size) { in vdpu383_h264d_gen_regs()
837 if (p_hal->cmv_bufs) { in vdpu383_h264d_gen_regs()
838 hal_bufs_deinit(p_hal->cmv_bufs); in vdpu383_h264d_gen_regs()
839 p_hal->cmv_bufs = NULL; in vdpu383_h264d_gen_regs()
842 hal_bufs_init(&p_hal->cmv_bufs); in vdpu383_h264d_gen_regs()
843 if (p_hal->cmv_bufs == NULL) { in vdpu383_h264d_gen_regs()
847 p_hal->mv_size = mv_size; in vdpu383_h264d_gen_regs()
848 p_hal->mv_count = mpp_buf_slot_get_count(p_hal->frame_slots); in vdpu383_h264d_gen_regs()
849 hal_bufs_setup(p_hal->cmv_bufs, p_hal->mv_count, 1, &size); in vdpu383_h264d_gen_regs()
852 … mpp_buf_slot_get_prop(p_hal->frame_slots, p_hal->pp->CurrPic.Index7Bits, SLOT_FRAME_PTR, &mframe); in vdpu383_h264d_gen_regs()
855 vdpu383_setup_scale_origin_bufs(p_hal, mframe); in vdpu383_h264d_gen_regs()
858 if (p_hal->fast_mode) { in vdpu383_h264d_gen_regs()
886 prepare_spspps(p_hal, (RK_U64 *)&ctx->spspps, sizeof(ctx->spspps) / 8); in vdpu383_h264d_gen_regs()
887 prepare_framerps(p_hal, (RK_U64 *)&ctx->rps, sizeof(ctx->rps) / 8); in vdpu383_h264d_gen_regs()
888 prepare_scanlist(p_hal, ctx->sclst, sizeof(ctx->sclst)); in vdpu383_h264d_gen_regs()
889 set_registers(p_hal, regs, task); in vdpu383_h264d_gen_regs()
896 mpp_dev_set_reg_offset(p_hal->dev, 131, ctx->spspps_offset); in vdpu383_h264d_gen_regs()
900 mpp_dev_set_reg_offset(p_hal->dev, 129, ctx->rps_offset); in vdpu383_h264d_gen_regs()
902 if (p_hal->pp->scaleing_list_enable_flag) { in vdpu383_h264d_gen_regs()
905 mpp_dev_set_reg_offset(p_hal->dev, 132, ctx->sclst_offset); in vdpu383_h264d_gen_regs()
910 hal_h264d_rcb_info_update(p_hal); in vdpu383_h264d_gen_regs()
911 vdpu383_setup_rcb(®s->common_addr, p_hal->dev, p_hal->fast_mode ? in vdpu383_h264d_gen_regs()
924 H264dHalCtx_t *p_hal = (H264dHalCtx_t *)hal; in vdpu383_h264d_start() local
925 INP_CHECK(ret, NULL == p_hal); in vdpu383_h264d_start()
928 (task->dec.flags.ref_err && !p_hal->cfg->base.disable_error)) { in vdpu383_h264d_start()
932 Vdpu383H264dRegCtx *reg_ctx = (Vdpu383H264dRegCtx *)p_hal->reg_ctx; in vdpu383_h264d_start()
933 Vdpu383H264dRegSet *regs = p_hal->fast_mode ? in vdpu383_h264d_start()
936 MppDev dev = p_hal->dev; in vdpu383_h264d_start()
1005 H264dHalCtx_t *p_hal = (H264dHalCtx_t *)hal; in vdpu383_h264d_wait() local
1007 INP_CHECK(ret, NULL == p_hal); in vdpu383_h264d_wait()
1008 Vdpu383H264dRegCtx *reg_ctx = (Vdpu383H264dRegCtx *)p_hal->reg_ctx; in vdpu383_h264d_wait()
1009 Vdpu383H264dRegSet *p_regs = p_hal->fast_mode ? in vdpu383_h264d_wait()
1014 (task->dec.flags.ref_err && !p_hal->cfg->base.disable_error)) { in vdpu383_h264d_wait()
1018 ret = mpp_dev_ioctl(p_hal->dev, MPP_DEV_CMD_POLL, NULL); in vdpu383_h264d_wait()
1023 if (p_hal->dec_cb) { in vdpu383_h264d_wait()
1040 mpp_callback(p_hal->dec_cb, ¶m); in vdpu383_h264d_wait()
1043 if (p_hal->fast_mode) { in vdpu383_h264d_wait()
1055 H264dHalCtx_t *p_hal = (H264dHalCtx_t *)hal; in vdpu383_h264d_reset() local
1057 INP_CHECK(ret, NULL == p_hal); in vdpu383_h264d_reset()
1067 H264dHalCtx_t *p_hal = (H264dHalCtx_t *)hal; in vdpu383_h264d_flush() local
1069 INP_CHECK(ret, NULL == p_hal); in vdpu383_h264d_flush()
1078 H264dHalCtx_t *p_hal = (H264dHalCtx_t *)hal; in vdpu383_h264d_control() local
1080 INP_CHECK(ret, NULL == p_hal); in vdpu383_h264d_control()
1090 mpp_slots_set_prop(p_hal->frame_slots, SLOTS_LEN_ALIGN, rkv_len_align_422); in vdpu383_h264d_control()
1093 vdpu383_afbc_align_calc(p_hal->frame_slots, (MppFrame)param, 16); in vdpu383_h264d_control()
1095 mpp_slots_set_prop(p_hal->frame_slots, SLOTS_HOR_ALIGN, mpp_align_128_odd_plus_64); in vdpu383_h264d_control()