Lines Matching refs:ctx
77 jpegeV540cHalContext *ctx = (jpegeV540cHalContext *)hal; in hal_jpege_v540c_init() local
83 ctx->reg_out = mpp_calloc(JpegV540cStatus, 1); in hal_jpege_v540c_init()
84 ctx->regs = mpp_calloc(JpegV540cRegSet, 1); in hal_jpege_v540c_init()
85 ctx->input_fmt = mpp_calloc(VepuFmtCfg, 1); in hal_jpege_v540c_init()
86 ctx->cfg = cfg->cfg; in hal_jpege_v540c_init()
88 ctx->frame_cnt = 0; in hal_jpege_v540c_init()
89 ctx->enc_mode = 1; in hal_jpege_v540c_init()
97 ctx->dev = cfg->dev; in hal_jpege_v540c_init()
98 jpege_bits_init(&ctx->bits); in hal_jpege_v540c_init()
99 mpp_assert(ctx->bits); in hal_jpege_v540c_init()
100 hal_jpege_rc_init(&ctx->hal_rc); in hal_jpege_v540c_init()
108 jpegeV540cHalContext *ctx = (jpegeV540cHalContext *)hal; in hal_jpege_v540c_deinit() local
111 jpege_bits_deinit(ctx->bits); in hal_jpege_v540c_deinit()
112 MPP_FREE(ctx->regs); in hal_jpege_v540c_deinit()
114 MPP_FREE(ctx->reg_out); in hal_jpege_v540c_deinit()
116 MPP_FREE(ctx->input_fmt); in hal_jpege_v540c_deinit()
118 if (ctx->dev) { in hal_jpege_v540c_deinit()
119 mpp_dev_deinit(ctx->dev); in hal_jpege_v540c_deinit()
120 ctx->dev = NULL; in hal_jpege_v540c_deinit()
128 jpegeV540cHalContext *ctx = (jpegeV540cHalContext *)hal; in hal_jpege_vepu540c_prepare() local
131 VepuFmtCfg *fmt = (VepuFmtCfg *)ctx->input_fmt; in hal_jpege_vepu540c_prepare()
132 vepu5xx_set_fmt(fmt, ctx->cfg->prep.format); in hal_jpege_vepu540c_prepare()
141 jpegeV540cHalContext *ctx = (jpegeV540cHalContext *)hal; in hal_jpege_v540c_gen_regs() local
142 JpegV540cRegSet *regs = ctx->regs; in hal_jpege_v540c_gen_regs()
145 JpegeBits bits = ctx->bits; in hal_jpege_v540c_gen_regs()
149 JpegeSyntax *syntax = &ctx->syntax; in hal_jpege_v540c_gen_regs()
156 cfg.dev = ctx->dev; in hal_jpege_v540c_gen_regs()
157 cfg.input_fmt = ctx->input_fmt; in hal_jpege_v540c_gen_regs()
163 hal_jpege_rc_update(&ctx->hal_rc, syntax); in hal_jpege_v540c_gen_regs()
171 write_jpeg_header(bits, syntax, &ctx->hal_rc); in hal_jpege_v540c_gen_regs()
178 reg_ctl->reg0004_enc_strt.vepu_cmd = ctx->enc_mode; in hal_jpege_v540c_gen_regs()
214 tbl[i * 8 + j] = 0x8000 / ctx->hal_rc.qtables[0][j * 8 + i]; in hal_jpege_v540c_gen_regs()
220 tbl[i * 8 + j] = 0x8000 / ctx->hal_rc.qtables[1][j * 8 + i]; in hal_jpege_v540c_gen_regs()
226 tbl[i * 8 + j] = 0x8000 / ctx->hal_rc.qtables[1][j * 8 + i]; in hal_jpege_v540c_gen_regs()
230 ctx->frame_num++; in hal_jpege_v540c_gen_regs()
239 jpegeV540cHalContext *ctx = (jpegeV540cHalContext *)hal; in hal_jpege_v540c_start() local
240 JpegV540cRegSet *hw_regs = ctx->regs; in hal_jpege_v540c_start()
241 JpegV540cStatus *reg_out = ctx->reg_out; in hal_jpege_v540c_start()
256 ret = mpp_dev_ioctl(ctx->dev, MPP_DEV_REG_WR, &cfg); in hal_jpege_v540c_start()
266 ret = mpp_dev_ioctl(ctx->dev, MPP_DEV_REG_WR, &cfg); in hal_jpege_v540c_start()
276 ret = mpp_dev_ioctl(ctx->dev, MPP_DEV_REG_WR, &cfg); in hal_jpege_v540c_start()
286 ret = mpp_dev_ioctl(ctx->dev, MPP_DEV_REG_RD, &cfg1); in hal_jpege_v540c_start()
296 ret = mpp_dev_ioctl(ctx->dev, MPP_DEV_REG_RD, &cfg1); in hal_jpege_v540c_start()
302 ret = mpp_dev_ioctl(ctx->dev, MPP_DEV_CMD_SEND, NULL); in hal_jpege_v540c_start()
313 jpegeV540cHalContext *ctx = (jpegeV540cHalContext *)hal; in hal_jpege_vepu540c_status_check() local
314 JpegV540cStatus *elem = (JpegV540cStatus *)ctx->reg_out; in hal_jpege_vepu540c_status_check()
340 jpegeV540cHalContext *ctx = (jpegeV540cHalContext *)hal; in hal_jpege_v540c_wait() local
342 JpegV540cStatus *elem = (JpegV540cStatus *)ctx->reg_out; in hal_jpege_v540c_wait()
351 ret = mpp_dev_ioctl(ctx->dev, MPP_DEV_CMD_POLL, NULL); in hal_jpege_v540c_wait()
366 jpegeV540cHalContext *ctx = (jpegeV540cHalContext *)hal; in hal_jpege_v540c_get_task() local
373 memcpy(&ctx->syntax, syntax, sizeof(ctx->syntax)); in hal_jpege_v540c_get_task()
375 ctx->last_frame_type = ctx->frame_type; in hal_jpege_v540c_get_task()
380 mpp_meta_get_ptr(meta, KEY_ROI_DATA, (void **)&ctx->roi_data); in hal_jpege_v540c_get_task()
383 if (ctx->cfg->jpeg.update) { in hal_jpege_v540c_get_task()
384 hal_jpege_rc_update(&ctx->hal_rc, syntax); in hal_jpege_v540c_get_task()
385 ctx->cfg->jpeg.update = 0; in hal_jpege_v540c_get_task()