Lines Matching +full:pix +full:- +full:limits
1 // SPDX-License-Identifier: GPL-2.0
15 #include <linux/limits.h>
25 #include <media/media-entity.h>
26 #include <media/v4l2-ctrls.h>
27 #include <media/v4l2-device.h>
28 #include <media/v4l2-event.h>
29 #include <media/v4l2-fh.h>
30 #include <media/v4l2-ioctl.h>
31 #include <media/v4l2-mem2mem.h>
32 #include <media/videobuf2-core.h>
33 #include <media/videobuf2-dma-contig.h>
35 #include "imx8-isi-core.h"
85 return &ctx->queues.out; in mxc_isi_m2m_ctx_qdata()
87 return &ctx->queues.cap; in mxc_isi_m2m_ctx_qdata()
90 /* -----------------------------------------------------------------------------
96 struct mxc_isi_m2m *m2m = &pipe->isi->m2m; in mxc_isi_m2m_frame_write_done()
100 ctx = v4l2_m2m_get_curr_priv(m2m->m2m_dev); in mxc_isi_m2m_frame_write_done()
102 dev_err(m2m->isi->dev, in mxc_isi_m2m_frame_write_done()
107 src_vbuf = v4l2_m2m_src_buf_remove(ctx->fh.m2m_ctx); in mxc_isi_m2m_frame_write_done()
108 dst_vbuf = v4l2_m2m_dst_buf_remove(ctx->fh.m2m_ctx); in mxc_isi_m2m_frame_write_done()
112 src_vbuf->sequence = ctx->queues.out.sequence++; in mxc_isi_m2m_frame_write_done()
113 dst_vbuf->sequence = ctx->queues.cap.sequence++; in mxc_isi_m2m_frame_write_done()
118 v4l2_m2m_job_finish(m2m->m2m_dev, ctx->fh.m2m_ctx); in mxc_isi_m2m_frame_write_done()
124 struct mxc_isi_m2m *m2m = ctx->m2m; in mxc_isi_m2m_device_run()
128 mxc_isi_channel_disable(m2m->pipe); in mxc_isi_m2m_device_run()
130 mutex_lock(&m2m->lock); in mxc_isi_m2m_device_run()
133 if (m2m->last_ctx != ctx) { in mxc_isi_m2m_device_run()
135 .width = ctx->queues.out.format.width, in mxc_isi_m2m_device_run()
136 .height = ctx->queues.out.format.height, in mxc_isi_m2m_device_run()
139 .width = ctx->queues.cap.format.width, in mxc_isi_m2m_device_run()
140 .height = ctx->queues.cap.format.height, in mxc_isi_m2m_device_run()
143 .width = ctx->queues.cap.format.width, in mxc_isi_m2m_device_run()
144 .height = ctx->queues.cap.format.height, in mxc_isi_m2m_device_run()
147 mxc_isi_channel_config(m2m->pipe, MXC_ISI_INPUT_MEM, in mxc_isi_m2m_device_run()
149 ctx->queues.out.info->encoding, in mxc_isi_m2m_device_run()
150 ctx->queues.cap.info->encoding); in mxc_isi_m2m_device_run()
151 mxc_isi_channel_set_input_format(m2m->pipe, in mxc_isi_m2m_device_run()
152 ctx->queues.out.info, in mxc_isi_m2m_device_run()
153 &ctx->queues.out.format); in mxc_isi_m2m_device_run()
154 mxc_isi_channel_set_output_format(m2m->pipe, in mxc_isi_m2m_device_run()
155 ctx->queues.cap.info, in mxc_isi_m2m_device_run()
156 &ctx->queues.cap.format); in mxc_isi_m2m_device_run()
158 m2m->last_ctx = ctx; in mxc_isi_m2m_device_run()
161 mutex_unlock(&m2m->lock); in mxc_isi_m2m_device_run()
163 mutex_lock(ctx->ctrls.handler.lock); in mxc_isi_m2m_device_run()
164 mxc_isi_channel_set_alpha(m2m->pipe, ctx->ctrls.alpha); in mxc_isi_m2m_device_run()
165 mxc_isi_channel_set_flip(m2m->pipe, ctx->ctrls.hflip, ctx->ctrls.vflip); in mxc_isi_m2m_device_run()
166 mutex_unlock(ctx->ctrls.handler.lock); in mxc_isi_m2m_device_run()
168 src_vbuf = v4l2_m2m_next_src_buf(ctx->fh.m2m_ctx); in mxc_isi_m2m_device_run()
169 dst_vbuf = v4l2_m2m_next_dst_buf(ctx->fh.m2m_ctx); in mxc_isi_m2m_device_run()
174 mxc_isi_channel_set_inbuf(m2m->pipe, src_buf->dma_addrs[0]); in mxc_isi_m2m_device_run()
175 mxc_isi_channel_set_outbuf(m2m->pipe, dst_buf->dma_addrs, MXC_ISI_BUF1); in mxc_isi_m2m_device_run()
176 mxc_isi_channel_set_outbuf(m2m->pipe, dst_buf->dma_addrs, MXC_ISI_BUF2); in mxc_isi_m2m_device_run()
178 mxc_isi_channel_enable(m2m->pipe); in mxc_isi_m2m_device_run()
180 mxc_isi_channel_m2m_start(m2m->pipe); in mxc_isi_m2m_device_run()
187 /* -----------------------------------------------------------------------------
199 mxc_isi_m2m_ctx_qdata(ctx, q->type); in mxc_isi_m2m_vb2_queue_setup()
201 return mxc_isi_video_queue_setup(&qdata->format, qdata->info, in mxc_isi_m2m_vb2_queue_setup()
207 struct vb2_queue *vq = vb2->vb2_queue; in mxc_isi_m2m_vb2_buffer_init()
209 struct mxc_isi_m2m_ctx *ctx = vb2_get_drv_priv(vb2->vb2_queue); in mxc_isi_m2m_vb2_buffer_init()
211 mxc_isi_m2m_ctx_qdata(ctx, vq->type); in mxc_isi_m2m_vb2_buffer_init()
213 mxc_isi_video_buffer_init(vb2, buf->dma_addrs, qdata->info, in mxc_isi_m2m_vb2_buffer_init()
214 &qdata->format); in mxc_isi_m2m_vb2_buffer_init()
221 struct vb2_queue *vq = vb2->vb2_queue; in mxc_isi_m2m_vb2_buffer_prepare()
224 mxc_isi_m2m_ctx_qdata(ctx, vq->type); in mxc_isi_m2m_vb2_buffer_prepare()
226 return mxc_isi_video_buffer_prepare(ctx->m2m->isi, vb2, qdata->info, in mxc_isi_m2m_vb2_buffer_prepare()
227 &qdata->format); in mxc_isi_m2m_vb2_buffer_prepare()
233 struct mxc_isi_m2m_ctx *ctx = vb2_get_drv_priv(vb2->vb2_queue); in mxc_isi_m2m_vb2_buffer_queue()
235 v4l2_m2m_buf_queue(ctx->fh.m2m_ctx, vbuf); in mxc_isi_m2m_vb2_buffer_queue()
243 mxc_isi_m2m_ctx_qdata(ctx, q->type); in mxc_isi_m2m_vb2_start_streaming()
245 qdata->sequence = 0; in mxc_isi_m2m_vb2_start_streaming()
256 if (q->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) in mxc_isi_m2m_vb2_stop_streaming()
257 vbuf = v4l2_m2m_src_buf_remove(ctx->fh.m2m_ctx); in mxc_isi_m2m_vb2_stop_streaming()
259 vbuf = v4l2_m2m_dst_buf_remove(ctx->fh.m2m_ctx); in mxc_isi_m2m_vb2_stop_streaming()
282 struct mxc_isi_m2m *m2m = ctx->m2m; in mxc_isi_m2m_queue_init()
285 src_vq->type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; in mxc_isi_m2m_queue_init()
286 src_vq->io_modes = VB2_MMAP | VB2_DMABUF; in mxc_isi_m2m_queue_init()
287 src_vq->drv_priv = ctx; in mxc_isi_m2m_queue_init()
288 src_vq->buf_struct_size = sizeof(struct mxc_isi_m2m_buffer); in mxc_isi_m2m_queue_init()
289 src_vq->ops = &mxc_isi_m2m_vb2_qops; in mxc_isi_m2m_queue_init()
290 src_vq->mem_ops = &vb2_dma_contig_memops; in mxc_isi_m2m_queue_init()
291 src_vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY; in mxc_isi_m2m_queue_init()
292 src_vq->lock = &ctx->vb2_lock; in mxc_isi_m2m_queue_init()
293 src_vq->dev = m2m->isi->dev; in mxc_isi_m2m_queue_init()
299 dst_vq->type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; in mxc_isi_m2m_queue_init()
300 dst_vq->io_modes = VB2_MMAP | VB2_DMABUF; in mxc_isi_m2m_queue_init()
301 dst_vq->drv_priv = ctx; in mxc_isi_m2m_queue_init()
302 dst_vq->buf_struct_size = sizeof(struct mxc_isi_m2m_buffer); in mxc_isi_m2m_queue_init()
303 dst_vq->ops = &mxc_isi_m2m_vb2_qops; in mxc_isi_m2m_queue_init()
304 dst_vq->mem_ops = &vb2_dma_contig_memops; in mxc_isi_m2m_queue_init()
305 dst_vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY; in mxc_isi_m2m_queue_init()
306 dst_vq->lock = &ctx->vb2_lock; in mxc_isi_m2m_queue_init()
307 dst_vq->dev = m2m->isi->dev; in mxc_isi_m2m_queue_init()
312 /* -----------------------------------------------------------------------------
319 return container_of(ctrl->handler, struct mxc_isi_m2m_ctx, ctrls.handler); in ctrl_to_mxc_isi_m2m_ctx()
326 switch (ctrl->id) { in mxc_isi_m2m_ctx_s_ctrl()
328 ctx->ctrls.hflip = ctrl->val; in mxc_isi_m2m_ctx_s_ctrl()
332 ctx->ctrls.vflip = ctrl->val; in mxc_isi_m2m_ctx_s_ctrl()
336 ctx->ctrls.alpha = ctrl->val; in mxc_isi_m2m_ctx_s_ctrl()
349 struct v4l2_ctrl_handler *handler = &ctx->ctrls.handler; in mxc_isi_m2m_ctx_ctrls_create()
361 if (handler->error) { in mxc_isi_m2m_ctx_ctrls_create()
362 ret = handler->error; in mxc_isi_m2m_ctx_ctrls_create()
367 ctx->fh.ctrl_handler = handler; in mxc_isi_m2m_ctx_ctrls_create()
374 v4l2_ctrl_handler_free(&ctx->ctrls.handler); in mxc_isi_m2m_ctx_ctrls_delete()
377 /* -----------------------------------------------------------------------------
384 strscpy(cap->driver, MXC_ISI_DRIVER_NAME, sizeof(cap->driver)); in mxc_isi_m2m_querycap()
385 strscpy(cap->card, MXC_ISI_M2M, sizeof(cap->card)); in mxc_isi_m2m_querycap()
386 cap->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_M2M_MPLANE; in mxc_isi_m2m_querycap()
387 cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS; in mxc_isi_m2m_querycap()
396 f->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE ? in mxc_isi_m2m_enum_fmt_vid()
400 info = mxc_isi_format_enum(f->index, type); in mxc_isi_m2m_enum_fmt_vid()
402 return -EINVAL; in mxc_isi_m2m_enum_fmt_vid()
404 f->pixelformat = info->fourcc; in mxc_isi_m2m_enum_fmt_vid()
405 f->flags |= V4L2_FMT_FLAG_CSC_COLORSPACE | V4L2_FMT_FLAG_CSC_YCBCR_ENC in mxc_isi_m2m_enum_fmt_vid()
413 struct v4l2_pix_format_mplane *pix, in __mxc_isi_m2m_try_fmt_vid() argument
418 pix->width = min(pix->width, ctx->queues.out.format.width); in __mxc_isi_m2m_try_fmt_vid()
419 pix->height = min(pix->height, ctx->queues.out.format.height); in __mxc_isi_m2m_try_fmt_vid()
422 return mxc_isi_format_try(ctx->m2m->pipe, pix, type); in __mxc_isi_m2m_try_fmt_vid()
429 f->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE ? in mxc_isi_m2m_try_fmt_vid()
433 __mxc_isi_m2m_try_fmt_vid(ctx, &f->fmt.pix_mp, type); in mxc_isi_m2m_try_fmt_vid()
443 mxc_isi_m2m_ctx_qdata(ctx, f->type); in mxc_isi_m2m_g_fmt_vid()
445 f->fmt.pix_mp = qdata->format; in mxc_isi_m2m_g_fmt_vid()
454 f->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE ? in mxc_isi_m2m_s_fmt_vid()
457 struct v4l2_pix_format_mplane *pix = &f->fmt.pix_mp; in mxc_isi_m2m_s_fmt_vid() local
461 vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, f->type); in mxc_isi_m2m_s_fmt_vid()
463 return -EINVAL; in mxc_isi_m2m_s_fmt_vid()
466 return -EBUSY; in mxc_isi_m2m_s_fmt_vid()
468 info = __mxc_isi_m2m_try_fmt_vid(ctx, pix, type); in mxc_isi_m2m_s_fmt_vid()
470 if (f->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { in mxc_isi_m2m_s_fmt_vid()
471 ctx->queues.out.format = *pix; in mxc_isi_m2m_s_fmt_vid()
472 ctx->queues.out.info = info; in mxc_isi_m2m_s_fmt_vid()
479 ctx->queues.cap.format = *pix; in mxc_isi_m2m_s_fmt_vid()
480 ctx->queues.cap.info = info; in mxc_isi_m2m_s_fmt_vid()
489 const struct v4l2_pix_format_mplane *out_pix = &ctx->queues.out.format; in mxc_isi_m2m_streamon()
490 const struct v4l2_pix_format_mplane *cap_pix = &ctx->queues.cap.format; in mxc_isi_m2m_streamon()
491 const struct mxc_isi_format_info *cap_info = ctx->queues.cap.info; in mxc_isi_m2m_streamon()
492 const struct mxc_isi_format_info *out_info = ctx->queues.out.info; in mxc_isi_m2m_streamon()
493 struct mxc_isi_m2m *m2m = ctx->m2m; in mxc_isi_m2m_streamon()
498 mutex_lock(&m2m->lock); in mxc_isi_m2m_streamon()
500 if (m2m->usage_count == INT_MAX) { in mxc_isi_m2m_streamon()
501 ret = -EOVERFLOW; in mxc_isi_m2m_streamon()
505 bypass = cap_pix->width == out_pix->width && in mxc_isi_m2m_streamon()
506 cap_pix->height == out_pix->height && in mxc_isi_m2m_streamon()
507 cap_info->encoding == out_info->encoding; in mxc_isi_m2m_streamon()
513 if (m2m->usage_count == 0) { in mxc_isi_m2m_streamon()
514 ret = mxc_isi_channel_acquire(m2m->pipe, in mxc_isi_m2m_streamon()
520 mxc_isi_channel_get(m2m->pipe); in mxc_isi_m2m_streamon()
523 m2m->usage_count++; in mxc_isi_m2m_streamon()
529 if (!ctx->chained && out_pix->width > MXC_ISI_MAX_WIDTH_UNCHAINED) { in mxc_isi_m2m_streamon()
530 ret = mxc_isi_channel_chain(m2m->pipe, bypass); in mxc_isi_m2m_streamon()
534 m2m->chained_count++; in mxc_isi_m2m_streamon()
535 ctx->chained = true; in mxc_isi_m2m_streamon()
542 mutex_unlock(&m2m->lock); in mxc_isi_m2m_streamon()
546 mutex_lock(&m2m->lock); in mxc_isi_m2m_streamon()
553 if (ctx->chained && --m2m->chained_count == 0) in mxc_isi_m2m_streamon()
554 mxc_isi_channel_unchain(m2m->pipe); in mxc_isi_m2m_streamon()
555 ctx->chained = false; in mxc_isi_m2m_streamon()
558 if (--m2m->usage_count == 0) { in mxc_isi_m2m_streamon()
559 mxc_isi_channel_put(m2m->pipe); in mxc_isi_m2m_streamon()
560 mxc_isi_channel_release(m2m->pipe); in mxc_isi_m2m_streamon()
564 mutex_unlock(&m2m->lock); in mxc_isi_m2m_streamon()
572 struct mxc_isi_m2m *m2m = ctx->m2m; in mxc_isi_m2m_streamoff()
576 mutex_lock(&m2m->lock); in mxc_isi_m2m_streamoff()
582 if (m2m->last_ctx == ctx) in mxc_isi_m2m_streamoff()
583 m2m->last_ctx = NULL; in mxc_isi_m2m_streamoff()
586 if (ctx->chained && --m2m->chained_count == 0) in mxc_isi_m2m_streamoff()
587 mxc_isi_channel_unchain(m2m->pipe); in mxc_isi_m2m_streamoff()
588 ctx->chained = false; in mxc_isi_m2m_streamoff()
591 if (--m2m->usage_count == 0) { in mxc_isi_m2m_streamoff()
592 mxc_isi_channel_disable(m2m->pipe); in mxc_isi_m2m_streamoff()
593 mxc_isi_channel_put(m2m->pipe); in mxc_isi_m2m_streamoff()
594 mxc_isi_channel_release(m2m->pipe); in mxc_isi_m2m_streamoff()
597 WARN_ON(m2m->usage_count < 0); in mxc_isi_m2m_streamoff()
599 mutex_unlock(&m2m->lock); in mxc_isi_m2m_streamoff()
631 /* -----------------------------------------------------------------------------
639 qdata->format.width = MXC_ISI_DEF_WIDTH; in mxc_isi_m2m_init_format()
640 qdata->format.height = MXC_ISI_DEF_HEIGHT; in mxc_isi_m2m_init_format()
641 qdata->format.pixelformat = MXC_ISI_DEF_PIXEL_FORMAT; in mxc_isi_m2m_init_format()
643 qdata->info = mxc_isi_format_try(ctx->m2m->pipe, &qdata->format, type); in mxc_isi_m2m_init_format()
655 return -ENOMEM; in mxc_isi_m2m_open()
657 ctx->m2m = m2m; in mxc_isi_m2m_open()
658 mutex_init(&ctx->vb2_lock); in mxc_isi_m2m_open()
660 v4l2_fh_init(&ctx->fh, vdev); in mxc_isi_m2m_open()
661 file->private_data = &ctx->fh; in mxc_isi_m2m_open()
663 ctx->fh.m2m_ctx = v4l2_m2m_ctx_init(m2m->m2m_dev, ctx, in mxc_isi_m2m_open()
665 if (IS_ERR(ctx->fh.m2m_ctx)) { in mxc_isi_m2m_open()
666 ret = PTR_ERR(ctx->fh.m2m_ctx); in mxc_isi_m2m_open()
667 ctx->fh.m2m_ctx = NULL; in mxc_isi_m2m_open()
671 mxc_isi_m2m_init_format(ctx, &ctx->queues.out, MXC_ISI_VIDEO_M2M_OUT); in mxc_isi_m2m_open()
672 mxc_isi_m2m_init_format(ctx, &ctx->queues.cap, MXC_ISI_VIDEO_M2M_CAP); in mxc_isi_m2m_open()
678 ret = pm_runtime_resume_and_get(m2m->isi->dev); in mxc_isi_m2m_open()
682 v4l2_fh_add(&ctx->fh); in mxc_isi_m2m_open()
689 v4l2_m2m_ctx_release(ctx->fh.m2m_ctx); in mxc_isi_m2m_open()
691 v4l2_fh_exit(&ctx->fh); in mxc_isi_m2m_open()
692 mutex_destroy(&ctx->vb2_lock); in mxc_isi_m2m_open()
700 struct mxc_isi_m2m_ctx *ctx = to_isi_m2m_ctx(file->private_data); in mxc_isi_m2m_release()
702 v4l2_m2m_ctx_release(ctx->fh.m2m_ctx); in mxc_isi_m2m_release()
705 v4l2_fh_del(&ctx->fh); in mxc_isi_m2m_release()
706 v4l2_fh_exit(&ctx->fh); in mxc_isi_m2m_release()
708 mutex_destroy(&ctx->vb2_lock); in mxc_isi_m2m_release()
711 pm_runtime_put(m2m->isi->dev); in mxc_isi_m2m_release()
725 /* -----------------------------------------------------------------------------
731 struct mxc_isi_m2m *m2m = &isi->m2m; in mxc_isi_m2m_register()
732 struct video_device *vdev = &m2m->vdev; in mxc_isi_m2m_register()
736 m2m->isi = isi; in mxc_isi_m2m_register()
737 m2m->pipe = &isi->pipes[0]; in mxc_isi_m2m_register()
739 mutex_init(&m2m->lock); in mxc_isi_m2m_register()
742 snprintf(vdev->name, sizeof(vdev->name), "mxc_isi.m2m"); in mxc_isi_m2m_register()
744 vdev->fops = &mxc_isi_m2m_fops; in mxc_isi_m2m_register()
745 vdev->ioctl_ops = &mxc_isi_m2m_ioctl_ops; in mxc_isi_m2m_register()
746 vdev->v4l2_dev = v4l2_dev; in mxc_isi_m2m_register()
747 vdev->minor = -1; in mxc_isi_m2m_register()
748 vdev->release = video_device_release_empty; in mxc_isi_m2m_register()
749 vdev->vfl_dir = VFL_DIR_M2M; in mxc_isi_m2m_register()
751 vdev->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_M2M_MPLANE; in mxc_isi_m2m_register()
755 m2m->m2m_dev = v4l2_m2m_init(&mxc_isi_m2m_ops); in mxc_isi_m2m_register()
756 if (IS_ERR(m2m->m2m_dev)) { in mxc_isi_m2m_register()
757 dev_err(isi->dev, "failed to initialize m2m device\n"); in mxc_isi_m2m_register()
758 ret = PTR_ERR(m2m->m2m_dev); in mxc_isi_m2m_register()
763 ret = video_register_device(vdev, VFL_TYPE_VIDEO, -1); in mxc_isi_m2m_register()
765 dev_err(isi->dev, "failed to register m2m device\n"); in mxc_isi_m2m_register()
775 * - The entity in the video_device, which isn't touched by the V4L2 in mxc_isi_m2m_register()
779 * - The video device at the end of the pipeline provides the sink in mxc_isi_m2m_register()
782 * - A new interface is created, pointing at both entities. The sink in mxc_isi_m2m_register()
785 m2m->pad.flags = MEDIA_PAD_FL_SOURCE; in mxc_isi_m2m_register()
786 vdev->entity.name = "mxc_isi.output"; in mxc_isi_m2m_register()
787 vdev->entity.function = MEDIA_ENT_F_IO_V4L; in mxc_isi_m2m_register()
788 ret = media_entity_pads_init(&vdev->entity, 1, &m2m->pad); in mxc_isi_m2m_register()
792 ret = media_device_register_entity(v4l2_dev->mdev, &vdev->entity); in mxc_isi_m2m_register()
796 ret = media_create_pad_link(&vdev->entity, 0, in mxc_isi_m2m_register()
797 &m2m->isi->crossbar.sd.entity, in mxc_isi_m2m_register()
798 m2m->isi->crossbar.num_sinks - 1, in mxc_isi_m2m_register()
804 m2m->intf = media_devnode_create(v4l2_dev->mdev, MEDIA_INTF_T_V4L_VIDEO, in mxc_isi_m2m_register()
805 0, VIDEO_MAJOR, vdev->minor); in mxc_isi_m2m_register()
806 if (!m2m->intf) { in mxc_isi_m2m_register()
807 ret = -ENOMEM; in mxc_isi_m2m_register()
811 link = media_create_intf_link(&vdev->entity, &m2m->intf->intf, in mxc_isi_m2m_register()
815 ret = -ENOMEM; in mxc_isi_m2m_register()
819 link = media_create_intf_link(&m2m->pipe->video.vdev.entity, in mxc_isi_m2m_register()
820 &m2m->intf->intf, in mxc_isi_m2m_register()
824 ret = -ENOMEM; in mxc_isi_m2m_register()
831 media_devnode_remove(m2m->intf); in mxc_isi_m2m_register()
833 media_device_unregister_entity(&vdev->entity); in mxc_isi_m2m_register()
835 media_entity_cleanup(&vdev->entity); in mxc_isi_m2m_register()
839 v4l2_m2m_release(m2m->m2m_dev); in mxc_isi_m2m_register()
841 mutex_destroy(&m2m->lock); in mxc_isi_m2m_register()
847 struct mxc_isi_m2m *m2m = &isi->m2m; in mxc_isi_m2m_unregister()
848 struct video_device *vdev = &m2m->vdev; in mxc_isi_m2m_unregister()
852 v4l2_m2m_release(m2m->m2m_dev); in mxc_isi_m2m_unregister()
853 media_devnode_remove(m2m->intf); in mxc_isi_m2m_unregister()
854 media_entity_cleanup(&vdev->entity); in mxc_isi_m2m_unregister()
855 mutex_destroy(&m2m->lock); in mxc_isi_m2m_unregister()