Lines Matching defs:fh

615 static inline struct mxc_jpeg_ctx *mxc_jpeg_fh_to_ctx(struct v4l2_fh *fh)
617 return container_of(fh, struct mxc_jpeg_ctx, fh);
734 v4l2_event_queue_fh(&ctx->fh, &ev);
745 v4l2_event_queue_fh(&ctx->fh, &ev);
825 if (v4l2_m2m_is_last_draining_src_buf(ctx->fh.m2m_ctx, src_buf)) {
827 v4l2_m2m_mark_stopped(ctx->fh.m2m_ctx);
839 dst_buf = v4l2_m2m_next_dst_buf(ctx->fh.m2m_ctx);
840 src_buf = v4l2_m2m_next_src_buf(ctx->fh.m2m_ctx);
842 v4l2_m2m_src_buf_remove(ctx->fh.m2m_ctx);
843 v4l2_m2m_dst_buf_remove(ctx->fh.m2m_ctx);
918 dst_buf = v4l2_m2m_next_dst_buf(ctx->fh.m2m_ctx);
919 src_buf = v4l2_m2m_next_src_buf(ctx->fh.m2m_ctx);
985 v4l2_m2m_job_finish(jpeg->m2m_dev, ctx->fh.m2m_ctx);
1329 next_dst_buf = v4l2_m2m_dst_buf_remove(ctx->fh.m2m_ctx);
1331 ctx->fh.m2m_ctx->is_draining = true;
1332 ctx->fh.m2m_ctx->next_buf_last = true;
1336 v4l2_m2m_last_buffer_done(ctx->fh.m2m_ctx, next_dst_buf);
1399 if (vb2_is_streaming(v4l2_m2m_get_dst_vq(ctx->fh.m2m_ctx)))
1425 v4l2_m2m_job_finish(ctx->mxc_jpeg->m2m_dev, ctx->fh.m2m_ctx);
1442 src_buf = v4l2_m2m_next_src_buf(ctx->fh.m2m_ctx);
1443 dst_buf = v4l2_m2m_next_dst_buf(ctx->fh.m2m_ctx);
1469 v4l2_m2m_src_buf_remove(ctx->fh.m2m_ctx);
1470 v4l2_m2m_dst_buf_remove(ctx->fh.m2m_ctx);
1474 v4l2_m2m_job_finish(jpeg->m2m_dev, ctx->fh.m2m_ctx);
1481 v4l2_m2m_job_finish(jpeg->m2m_dev, ctx->fh.m2m_ctx);
1525 struct v4l2_fh *fh = file->private_data;
1526 struct mxc_jpeg_ctx *ctx = mxc_jpeg_fh_to_ctx(fh);
1530 ret = v4l2_m2m_ioctl_try_decoder_cmd(file, fh, cmd);
1534 if (!vb2_is_streaming(v4l2_m2m_get_src_vq(fh->m2m_ctx)))
1544 v4l2_m2m_has_stopped(fh->m2m_ctx)) {
1550 v4l2_m2m_has_stopped(fh->m2m_ctx))
1551 vb2_clear_last_buffer_dequeued(&fh->m2m_ctx->cap_q_ctx.q);
1558 struct v4l2_fh *fh = file->private_data;
1559 struct mxc_jpeg_ctx *ctx = mxc_jpeg_fh_to_ctx(fh);
1563 ret = v4l2_m2m_ioctl_try_encoder_cmd(file, fh, cmd);
1567 if (!vb2_is_streaming(v4l2_m2m_get_src_vq(fh->m2m_ctx)) ||
1568 !vb2_is_streaming(v4l2_m2m_get_dst_vq(fh->m2m_ctx)))
1572 ret = v4l2_m2m_ioctl_encoder_cmd(file, fh, cmd);
1578 v4l2_m2m_has_stopped(fh->m2m_ctx))
1582 v4l2_m2m_has_stopped(fh->m2m_ctx))
1583 vb2_clear_last_buffer_dequeued(&fh->m2m_ctx->cap_q_ctx.q);
1630 v4l2_m2m_update_start_streaming_state(ctx->fh.m2m_ctx, q);
1656 vbuf = v4l2_m2m_src_buf_remove(ctx->fh.m2m_ctx);
1658 vbuf = v4l2_m2m_dst_buf_remove(ctx->fh.m2m_ctx);
1664 v4l2_m2m_update_stop_streaming_state(ctx->fh.m2m_ctx, q);
1668 if (V4L2_TYPE_IS_CAPTURE(q->type) && ctx->source_change && ctx->fh.m2m_ctx->last_src_buf)
1669 ctx->fh.m2m_ctx->is_draining = true;
1672 v4l2_m2m_has_stopped(ctx->fh.m2m_ctx)) {
1892 if (!v4l2_m2m_num_src_bufs_ready(ctx->fh.m2m_ctx))
1907 v4l2_m2m_dst_buf_is_last(ctx->fh.m2m_ctx)) {
1913 v4l2_m2m_last_buffer_done(ctx->fh.m2m_ctx, vbuf);
1933 v4l2_m2m_buf_queue(ctx->fh.m2m_ctx, vbuf);
2115 v4l2_fh_init(&ctx->fh, mxc_vfd);
2116 file->private_data = &ctx->fh;
2117 v4l2_fh_add(&ctx->fh);
2121 ctx->fh.m2m_ctx = v4l2_m2m_ctx_init(mxc_jpeg->m2m_dev, ctx,
2124 if (IS_ERR(ctx->fh.m2m_ctx)) {
2125 ret = PTR_ERR(ctx->fh.m2m_ctx);
2134 ctx->fh.ctrl_handler = &ctx->ctrl_handler;
2148 v4l2_m2m_ctx_release(ctx->fh.m2m_ctx);
2150 v4l2_fh_del(&ctx->fh);
2151 v4l2_fh_exit(&ctx->fh);
2407 vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, f->type);
2444 dst_vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, cap_type);
2502 static int mxc_jpeg_dec_g_selection(struct file *file, void *fh, struct v4l2_selection *s)
2504 struct mxc_jpeg_ctx *ctx = mxc_jpeg_fh_to_ctx(fh);
2531 static int mxc_jpeg_enc_g_selection(struct file *file, void *fh, struct v4l2_selection *s)
2533 struct mxc_jpeg_ctx *ctx = mxc_jpeg_fh_to_ctx(fh);
2559 static int mxc_jpeg_g_selection(struct file *file, void *fh, struct v4l2_selection *s)
2561 struct mxc_jpeg_ctx *ctx = mxc_jpeg_fh_to_ctx(fh);
2564 return mxc_jpeg_dec_g_selection(file, fh, s);
2566 return mxc_jpeg_enc_g_selection(file, fh, s);
2569 static int mxc_jpeg_s_selection(struct file *file, void *fh, struct v4l2_selection *s)
2571 struct mxc_jpeg_ctx *ctx = mxc_jpeg_fh_to_ctx(fh);
2596 static int mxc_jpeg_subscribe_event(struct v4l2_fh *fh,
2601 return v4l2_event_subscribe(fh, sub, 0, NULL);
2603 return v4l2_src_change_event_subscribe(fh, sub);
2605 return v4l2_ctrl_subscribe_event(fh, sub);
2662 v4l2_m2m_ctx_release(ctx->fh.m2m_ctx);
2663 v4l2_fh_del(&ctx->fh);
2664 v4l2_fh_exit(&ctx->fh);