Lines Matching refs:ctx

225 static struct emmaprp_q_data *get_q_data(struct emmaprp_ctx *ctx,  in get_q_data()  argument
230 return &(ctx->q_data[V4L2_M2M_SRC]); in get_q_data()
232 return &(ctx->q_data[V4L2_M2M_DST]); in get_q_data()
244 struct emmaprp_ctx *ctx = priv; in emmaprp_job_abort() local
245 struct emmaprp_dev *pcdev = ctx->dev; in emmaprp_job_abort()
247 ctx->aborting = 1; in emmaprp_job_abort()
251 v4l2_m2m_job_finish(pcdev->m2m_dev, ctx->m2m_ctx); in emmaprp_job_abort()
256 struct emmaprp_ctx *ctx = priv; in emmaprp_lock() local
257 struct emmaprp_dev *pcdev = ctx->dev; in emmaprp_lock()
263 struct emmaprp_ctx *ctx = priv; in emmaprp_unlock() local
264 struct emmaprp_dev *pcdev = ctx->dev; in emmaprp_unlock()
290 struct emmaprp_ctx *ctx = priv; in emmaprp_device_run() local
293 struct emmaprp_dev *pcdev = ctx->dev; in emmaprp_device_run()
300 src_buf = v4l2_m2m_next_src_buf(ctx->m2m_ctx); in emmaprp_device_run()
301 dst_buf = v4l2_m2m_next_dst_buf(ctx->m2m_ctx); in emmaprp_device_run()
303 s_q_data = get_q_data(ctx, V4L2_BUF_TYPE_VIDEO_OUTPUT); in emmaprp_device_run()
307 d_q_data = get_q_data(ctx, V4L2_BUF_TYPE_VIDEO_CAPTURE); in emmaprp_device_run()
452 static int vidioc_g_fmt(struct emmaprp_ctx *ctx, struct v4l2_format *f) in vidioc_g_fmt() argument
457 vq = v4l2_m2m_get_vq(ctx->m2m_ctx, f->type); in vidioc_g_fmt()
461 q_data = get_q_data(ctx, f->type); in vidioc_g_fmt()
526 struct emmaprp_ctx *ctx = priv; in vidioc_try_fmt_vid_cap() local
530 v4l2_err(&ctx->dev->v4l2_dev, in vidioc_try_fmt_vid_cap()
543 struct emmaprp_ctx *ctx = priv; in vidioc_try_fmt_vid_out() local
547 v4l2_err(&ctx->dev->v4l2_dev, in vidioc_try_fmt_vid_out()
556 static int vidioc_s_fmt(struct emmaprp_ctx *ctx, struct v4l2_format *f) in vidioc_s_fmt() argument
562 vq = v4l2_m2m_get_vq(ctx->m2m_ctx, f->type); in vidioc_s_fmt()
566 q_data = get_q_data(ctx, f->type); in vidioc_s_fmt()
571 v4l2_err(&ctx->dev->v4l2_dev, "%s queue busy\n", __func__); in vidioc_s_fmt()
587 dprintk(ctx->dev, in vidioc_s_fmt()
621 struct emmaprp_ctx *ctx = priv; in vidioc_reqbufs() local
623 return v4l2_m2m_reqbufs(file, ctx->m2m_ctx, reqbufs); in vidioc_reqbufs()
629 struct emmaprp_ctx *ctx = priv; in vidioc_querybuf() local
631 return v4l2_m2m_querybuf(file, ctx->m2m_ctx, buf); in vidioc_querybuf()
636 struct emmaprp_ctx *ctx = priv; in vidioc_qbuf() local
638 return v4l2_m2m_qbuf(file, ctx->m2m_ctx, buf); in vidioc_qbuf()
643 struct emmaprp_ctx *ctx = priv; in vidioc_dqbuf() local
645 return v4l2_m2m_dqbuf(file, ctx->m2m_ctx, buf); in vidioc_dqbuf()
651 struct emmaprp_ctx *ctx = priv; in vidioc_streamon() local
653 return v4l2_m2m_streamon(file, ctx->m2m_ctx, type); in vidioc_streamon()
659 struct emmaprp_ctx *ctx = priv; in vidioc_streamoff() local
661 return v4l2_m2m_streamoff(file, ctx->m2m_ctx, type); in vidioc_streamoff()
696 struct emmaprp_ctx *ctx = vb2_get_drv_priv(vq); in emmaprp_queue_setup() local
700 q_data = get_q_data(ctx, vq->type); in emmaprp_queue_setup()
714 alloc_ctxs[0] = ctx->dev->alloc_ctx; in emmaprp_queue_setup()
716 dprintk(ctx->dev, "get %d buffer(s) of size %d each.\n", count, size); in emmaprp_queue_setup()
723 struct emmaprp_ctx *ctx = vb2_get_drv_priv(vb->vb2_queue); in emmaprp_buf_prepare() local
726 dprintk(ctx->dev, "type: %d\n", vb->vb2_queue->type); in emmaprp_buf_prepare()
728 q_data = get_q_data(ctx, vb->vb2_queue->type); in emmaprp_buf_prepare()
731 dprintk(ctx->dev, "%s data will not fit into plane" in emmaprp_buf_prepare()
746 struct emmaprp_ctx *ctx = vb2_get_drv_priv(vb->vb2_queue); in emmaprp_buf_queue() local
747 v4l2_m2m_buf_queue(ctx->m2m_ctx, vbuf); in emmaprp_buf_queue()
759 struct emmaprp_ctx *ctx = priv; in queue_init() local
764 src_vq->drv_priv = ctx; in queue_init()
776 dst_vq->drv_priv = ctx; in queue_init()
791 struct emmaprp_ctx *ctx; in emmaprp_open() local
793 ctx = kzalloc(sizeof *ctx, GFP_KERNEL); in emmaprp_open()
794 if (!ctx) in emmaprp_open()
797 file->private_data = ctx; in emmaprp_open()
798 ctx->dev = pcdev; in emmaprp_open()
801 kfree(ctx); in emmaprp_open()
805 ctx->m2m_ctx = v4l2_m2m_ctx_init(pcdev->m2m_dev, ctx, &queue_init); in emmaprp_open()
807 if (IS_ERR(ctx->m2m_ctx)) { in emmaprp_open()
808 int ret = PTR_ERR(ctx->m2m_ctx); in emmaprp_open()
811 kfree(ctx); in emmaprp_open()
817 ctx->q_data[V4L2_M2M_SRC].fmt = &formats[1]; in emmaprp_open()
818 ctx->q_data[V4L2_M2M_DST].fmt = &formats[0]; in emmaprp_open()
821 dprintk(pcdev, "Created instance %p, m2m_ctx: %p\n", ctx, ctx->m2m_ctx); in emmaprp_open()
829 struct emmaprp_ctx *ctx = file->private_data; in emmaprp_release() local
831 dprintk(pcdev, "Releasing instance %p\n", ctx); in emmaprp_release()
836 v4l2_m2m_ctx_release(ctx->m2m_ctx); in emmaprp_release()
838 kfree(ctx); in emmaprp_release()
847 struct emmaprp_ctx *ctx = file->private_data; in emmaprp_poll() local
851 res = v4l2_m2m_poll(file, ctx->m2m_ctx, wait); in emmaprp_poll()
859 struct emmaprp_ctx *ctx = file->private_data; in emmaprp_mmap() local
864 ret = v4l2_m2m_mmap(file, ctx->m2m_ctx, vma); in emmaprp_mmap()