Lines Matching refs:ctx

93  * @ctx:		V4L2 context
102 struct mtk_vcodec_dec_ctx *ctx;
107 static void *vdec_vp8_slice_get_ctrl_ptr(struct mtk_vcodec_dec_ctx *ctx, int id)
109 struct v4l2_ctrl *ctrl = v4l2_ctrl_find(&ctx->ctrl_hdl, id);
119 struct mtk_vcodec_dec_ctx *ctx = inst->ctx;
122 data[0] = ctx->picinfo.pic_w;
123 data[1] = ctx->picinfo.pic_h;
124 data[2] = ctx->capture_fourcc;
127 ctx->picinfo.buf_w = ALIGN(ctx->picinfo.pic_w, 64);
128 ctx->picinfo.buf_h = ALIGN(ctx->picinfo.pic_h, 64);
129 ctx->picinfo.fb_sz[0] = inst->vpu.fb_sz[0];
130 ctx->picinfo.fb_sz[1] = inst->vpu.fb_sz[1];
132 inst->vsi->pic.pic_w = ctx->picinfo.pic_w;
133 inst->vsi->pic.pic_h = ctx->picinfo.pic_h;
134 inst->vsi->pic.buf_w = ctx->picinfo.buf_w;
135 inst->vsi->pic.buf_h = ctx->picinfo.buf_h;
136 inst->vsi->pic.fb_sz[0] = ctx->picinfo.fb_sz[0];
137 inst->vsi->pic.fb_sz[1] = ctx->picinfo.fb_sz[1];
138 mtk_vdec_debug(inst->ctx, "pic(%d, %d), buf(%d, %d)",
139 ctx->picinfo.pic_w, ctx->picinfo.pic_h,
140 ctx->picinfo.buf_w, ctx->picinfo.buf_h);
141 mtk_vdec_debug(inst->ctx, "fb size: Y(%d), C(%d)",
142 ctx->picinfo.fb_sz[0], ctx->picinfo.fb_sz[1]);
152 err = mtk_vcodec_mem_alloc(inst->ctx, mem);
154 mtk_vdec_err(inst->ctx, "Cannot allocate working buffer");
161 err = mtk_vcodec_mem_alloc(inst->ctx, mem);
163 mtk_vdec_err(inst->ctx, "cannot allocate WRAP Y buffer");
170 err = mtk_vcodec_mem_alloc(inst->ctx, mem);
172 mtk_vdec_err(inst->ctx, "cannot allocate WRAP C buffer");
179 err = mtk_vcodec_mem_alloc(inst->ctx, mem);
181 mtk_vdec_err(inst->ctx, "cannot allocate vld wrapper buffer");
195 mtk_vcodec_mem_free(inst->ctx, mem);
200 mtk_vcodec_mem_free(inst->ctx, mem);
205 mtk_vcodec_mem_free(inst->ctx, mem);
210 mtk_vcodec_mem_free(inst->ctx, mem);
234 struct mtk_vcodec_dec_ctx *ctx = inst->ctx;
240 frame_header = vdec_vp8_slice_get_ctrl_ptr(inst->ctx, V4L2_CID_STATELESS_VP8_FRAME);
244 vq = v4l2_m2m_get_vq(ctx->m2m_ctx, V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE);
250 mtk_vdec_err(inst->ctx, "reference invalid: index(%d) ts(%lld)",
259 if (ctx->q_data[MTK_Q_DATA_DST].fmt->num_planes == 2)
265 ctx->picinfo.fb_sz[0];
273 static int vdec_vp8_slice_init(struct mtk_vcodec_dec_ctx *ctx)
282 inst->ctx = ctx;
286 inst->vpu.ctx = ctx;
287 inst->vpu.codec_type = ctx->current_codec;
288 inst->vpu.capture_type = ctx->capture_fourcc;
292 mtk_vdec_err(ctx, "vdec_vp8 init err=%d", err);
301 mtk_vdec_debug(ctx, "vp8 struct size = %d vsi: %d\n",
304 mtk_vdec_debug(ctx, "vp8:%p, codec_type = 0x%x vsi: 0x%p",
307 ctx->drv_handle = inst;
336 fb = inst->ctx->dev->vdec_pdata->get_cap_buffer(inst->ctx);
340 if (inst->ctx->q_data[MTK_Q_DATA_DST].fmt->num_planes == 1)
342 inst->ctx->picinfo.buf_w * inst->ctx->picinfo.buf_h;
351 mtk_vdec_debug(inst->ctx, "frame[%d] bs(%zu 0x%llx) y/c(0x%llx 0x%llx)",
352 inst->ctx->decoded_frame_cnt,
365 mtk_vdec_debug(inst->ctx, "vp8 dec start err!");
370 mtk_vdec_debug(inst->ctx, "- resolution_changed -");
376 timeout = mtk_vcodec_wait_for_done_ctx(inst->ctx, MTK_INST_IRQ_RECEIVED,
381 mtk_vdec_debug(inst->ctx, "vp8 dec error timeout:%d err: %d pic_%d",
382 timeout, err, inst->ctx->decoded_frame_cnt);
384 mtk_vdec_debug(inst->ctx, "pic[%d] crc: 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x",
385 inst->ctx->decoded_frame_cnt,
391 inst->ctx->decoded_frame_cnt++;
405 mtk_vdec_debug(inst->ctx, "No need to get vp8 crop information.");
411 mtk_vdec_err(inst->ctx, "invalid get parameter type=%d", type);