Lines Matching refs:JpegHalCtx
734 JpegdHalCtx *JpegHalCtx = (JpegdHalCtx *)hal; in hal_jpegd_vdpu1_init() local
736 mpp_assert(JpegHalCtx); in hal_jpegd_vdpu1_init()
740 JpegHalCtx->dec_cb = cfg->dec_cb; in hal_jpegd_vdpu1_init()
741 JpegHalCtx->packet_slots = cfg->packet_slots; in hal_jpegd_vdpu1_init()
742 JpegHalCtx->frame_slots = cfg->frame_slots; in hal_jpegd_vdpu1_init()
743 JpegHalCtx->have_pp = cfg->hw_info->cap_jpg_pp_out; in hal_jpegd_vdpu1_init()
746 if (JpegHalCtx->regs == NULL) { in hal_jpegd_vdpu1_init()
747 JpegHalCtx->regs = mpp_calloc_size(void, sizeof(JpegdIocRegInfo)); in hal_jpegd_vdpu1_init()
748 if (JpegHalCtx->regs == NULL) { in hal_jpegd_vdpu1_init()
755 JpegdIocRegInfo *info = (JpegdIocRegInfo *)JpegHalCtx->regs; in hal_jpegd_vdpu1_init()
759 if (JpegHalCtx->group == NULL) { in hal_jpegd_vdpu1_init()
760 ret = mpp_buffer_group_get_internal(&JpegHalCtx->group, in hal_jpegd_vdpu1_init()
768 ret = mpp_buffer_get(JpegHalCtx->group, &JpegHalCtx->pTableBase, in hal_jpegd_vdpu1_init()
775 PPInfo *pp_info = &(JpegHalCtx->pp_info); in hal_jpegd_vdpu1_init()
781 JpegHalCtx->output_fmt = MPP_FMT_YUV420SP; in hal_jpegd_vdpu1_init()
782 JpegHalCtx->set_output_fmt_flag = 0; in hal_jpegd_vdpu1_init()
785 JpegHalCtx->hal_debug_enable = 0; in hal_jpegd_vdpu1_init()
786 JpegHalCtx->frame_count = 0; in hal_jpegd_vdpu1_init()
787 JpegHalCtx->output_yuv_count = 0; in hal_jpegd_vdpu1_init()
796 JpegdHalCtx *JpegHalCtx = (JpegdHalCtx *)hal; in hal_jpegd_vdpu1_deinit() local
800 if (JpegHalCtx->dev) { in hal_jpegd_vdpu1_deinit()
801 mpp_dev_deinit(JpegHalCtx->dev); in hal_jpegd_vdpu1_deinit()
802 JpegHalCtx->dev = NULL; in hal_jpegd_vdpu1_deinit()
805 if (JpegHalCtx->pTableBase) { in hal_jpegd_vdpu1_deinit()
806 ret = mpp_buffer_put(JpegHalCtx->pTableBase); in hal_jpegd_vdpu1_deinit()
813 if (JpegHalCtx->group) { in hal_jpegd_vdpu1_deinit()
814 ret = mpp_buffer_group_put(JpegHalCtx->group); in hal_jpegd_vdpu1_deinit()
821 if (JpegHalCtx->regs) { in hal_jpegd_vdpu1_deinit()
822 mpp_free(JpegHalCtx->regs); in hal_jpegd_vdpu1_deinit()
823 JpegHalCtx->regs = NULL; in hal_jpegd_vdpu1_deinit()
826 JpegHalCtx->output_fmt = MPP_FMT_YUV420SP; in hal_jpegd_vdpu1_deinit()
827 JpegHalCtx->set_output_fmt_flag = 0; in hal_jpegd_vdpu1_deinit()
828 JpegHalCtx->hal_debug_enable = 0; in hal_jpegd_vdpu1_deinit()
829 JpegHalCtx->frame_count = 0; in hal_jpegd_vdpu1_deinit()
830 JpegHalCtx->output_yuv_count = 0; in hal_jpegd_vdpu1_deinit()
845 JpegdHalCtx *JpegHalCtx = (JpegdHalCtx *)hal; in hal_jpegd_vdpu1_gen_regs() local
858 jpegd_setup_output_fmt(JpegHalCtx, syntax, syn->dec.output); in hal_jpegd_vdpu1_gen_regs()
865 mpp_buf_slot_get_prop(JpegHalCtx->packet_slots, syn->dec.input, in hal_jpegd_vdpu1_gen_regs()
867 JpegHalCtx->pkt_fd = mpp_buffer_get_fd(streambuf); in hal_jpegd_vdpu1_gen_regs()
868 if (JpegHalCtx->pkt_fd <= 0) { in hal_jpegd_vdpu1_gen_regs()
876 mpp_buf_slot_get_prop(JpegHalCtx->frame_slots, syn->dec.output, in hal_jpegd_vdpu1_gen_regs()
878 JpegHalCtx->frame_fd = mpp_buffer_get_fd(outputBuf); in hal_jpegd_vdpu1_gen_regs()
879 if (JpegHalCtx->frame_fd <= 0) { in hal_jpegd_vdpu1_gen_regs()
884 ret = jpegd_gen_regs(JpegHalCtx, syntax); in hal_jpegd_vdpu1_gen_regs()
886 mpp_buffer_sync_end(JpegHalCtx->pTableBase); in hal_jpegd_vdpu1_gen_regs()
908 JpegdHalCtx *JpegHalCtx = (JpegdHalCtx *)hal; in hal_jpegd_vdpu1_start() local
909 RK_U32 *regs = (RK_U32 *)JpegHalCtx->regs; in hal_jpegd_vdpu1_start()
931 ret = mpp_dev_ioctl(JpegHalCtx->dev, MPP_DEV_REG_WR, &wr_cfg); in hal_jpegd_vdpu1_start()
943 ret = mpp_dev_ioctl(JpegHalCtx->dev, MPP_DEV_REG_RD, &rd_cfg); in hal_jpegd_vdpu1_start()
949 ret = mpp_dev_ioctl(JpegHalCtx->dev, MPP_DEV_CMD_SEND, NULL); in hal_jpegd_vdpu1_start()
969 JpegdHalCtx *JpegHalCtx = (JpegdHalCtx *)hal; in hal_jpegd_vdpu1_wait() local
970 JpegRegSet *reg_out = JpegHalCtx->regs; in hal_jpegd_vdpu1_wait()
977 ret = mpp_dev_ioctl(JpegHalCtx->dev, MPP_DEV_CMD_POLL, NULL); in hal_jpegd_vdpu1_wait()
984 if (JpegHalCtx->dec_cb) { in hal_jpegd_vdpu1_wait()
996 if (JpegHalCtx->output_fmt != MPP_FMT_YUV420SP) in hal_jpegd_vdpu1_wait()
999 mpp_err_f("IRQ STREAM ERROR! %d", JpegHalCtx->output_fmt); in hal_jpegd_vdpu1_wait()
1009 mpp_callback(JpegHalCtx->dec_cb, ¶m); in hal_jpegd_vdpu1_wait()
1018 mpp_buf_slot_get_prop(JpegHalCtx->frame_slots, task->dec.output, in hal_jpegd_vdpu1_wait()
1023 JpegHalCtx->output_yuv_count); in hal_jpegd_vdpu1_wait()
1032 JpegHalCtx->output_yuv_count, in hal_jpegd_vdpu1_wait()
1036 JpegHalCtx->output_yuv_count++; in hal_jpegd_vdpu1_wait()
1050 JpegdHalCtx *JpegHalCtx = (JpegdHalCtx *)hal; in hal_jpegd_vdpu1_control() local
1051 if (NULL == JpegHalCtx) { in hal_jpegd_vdpu1_control()
1058 JpegHalCtx->output_fmt = *((MppFrameFormat *)param); in hal_jpegd_vdpu1_control()
1059 JpegHalCtx->set_output_fmt_flag = 1; in hal_jpegd_vdpu1_control()
1060 jpegd_dbg_hal("output_format: 0x%x\n", JpegHalCtx->output_fmt); in hal_jpegd_vdpu1_control()
1062 …if (!MPP_FRAME_FMT_IS_YUV(JpegHalCtx->output_fmt) && !MPP_FRAME_FMT_IS_RGB(JpegHalCtx->output_fmt)… in hal_jpegd_vdpu1_control()
1063 mpp_err_f("invalid output format 0x%x\n", JpegHalCtx->output_fmt); in hal_jpegd_vdpu1_control()