Lines Matching refs:fimc

61 	struct fimc_dev *fimc = ctx->fimc_dev;  in fimc_m2m_shutdown()  local
63 if (!fimc_m2m_pending(fimc)) in fimc_m2m_shutdown()
68 wait_event_timeout(fimc->irq_queue, in fimc_m2m_shutdown()
94 struct fimc_dev *fimc; in fimc_device_run() local
101 fimc = ctx->fimc_dev; in fimc_device_run()
102 spin_lock_irqsave(&fimc->slock, flags); in fimc_device_run()
104 set_bit(ST_M2M_PEND, &fimc->state); in fimc_device_run()
130 if (fimc->m2m.ctx != ctx) { in fimc_device_run()
132 fimc->m2m.ctx = ctx; in fimc_device_run()
148 if (fimc->drv_data->alpha_color) in fimc_device_run()
152 fimc_hw_set_input_addr(fimc, &sf->addr); in fimc_device_run()
153 fimc_hw_set_output_addr(fimc, &df->addr, -1); in fimc_device_run()
157 fimc_hw_activate_input_dma(fimc, true); in fimc_device_run()
160 spin_unlock_irqrestore(&fimc->slock, flags); in fimc_device_run()
231 struct fimc_dev *fimc = video_drvdata(file); in fimc_m2m_querycap() local
233 __fimc_vidioc_querycap(&fimc->pdev->dev, cap); in fimc_m2m_querycap()
266 struct fimc_dev *fimc = ctx->fimc_dev; in fimc_try_fmt_mplane() local
267 const struct fimc_variant *variant = fimc->variant; in fimc_try_fmt_mplane()
342 struct fimc_dev *fimc = ctx->fimc_dev; in fimc_m2m_s_fmt_mplane() local
355 v4l2_err(&fimc->m2m.vfd, "queue (%d) busy\n", f->type); in fimc_m2m_s_fmt_mplane()
430 struct fimc_dev *fimc = ctx->fimc_dev; in fimc_m2m_try_selection() local
436 v4l2_err(&fimc->m2m.vfd, in fimc_m2m_try_selection()
453 fimc->variant->min_inp_pixsize : fimc->variant->min_out_pixsize; in fimc_m2m_try_selection()
456 if (fimc->variant->min_vsize_align == 1) in fimc_m2m_try_selection()
459 halign = ffs(fimc->variant->min_vsize_align) - 1; in fimc_m2m_try_selection()
476 s->r.top = round_down(s->r.top, fimc->variant->hor_offs_align); in fimc_m2m_try_selection()
489 struct fimc_dev *fimc = ctx->fimc_dev; in fimc_m2m_s_selection() local
511 v4l2_err(&fimc->m2m.vfd, "Out of scaler range\n"); in fimc_m2m_s_selection()
605 struct fimc_dev *fimc = video_drvdata(file); in fimc_m2m_open() local
609 pr_debug("pid: %d, state: %#lx\n", task_pid_nr(current), fimc->state); in fimc_m2m_open()
611 if (mutex_lock_interruptible(&fimc->lock)) in fimc_m2m_open()
617 if (test_bit(ST_CAPT_BUSY, &fimc->state)) in fimc_m2m_open()
625 v4l2_fh_init(&ctx->fh, &fimc->m2m.vfd); in fimc_m2m_open()
626 ctx->fimc_dev = fimc; in fimc_m2m_open()
648 ctx->fh.m2m_ctx = v4l2_m2m_ctx_init(fimc->m2m.m2m_dev, ctx, queue_init); in fimc_m2m_open()
654 if (fimc->m2m.refcnt++ == 0) in fimc_m2m_open()
655 set_bit(ST_M2M_RUN, &fimc->state); in fimc_m2m_open()
661 mutex_unlock(&fimc->lock); in fimc_m2m_open()
673 mutex_unlock(&fimc->lock); in fimc_m2m_open()
680 struct fimc_dev *fimc = ctx->fimc_dev; in fimc_m2m_release() local
683 task_pid_nr(current), fimc->state, fimc->m2m.refcnt); in fimc_m2m_release()
685 mutex_lock(&fimc->lock); in fimc_m2m_release()
692 if (--fimc->m2m.refcnt <= 0) in fimc_m2m_release()
693 clear_bit(ST_M2M_RUN, &fimc->state); in fimc_m2m_release()
696 mutex_unlock(&fimc->lock); in fimc_m2m_release()
714 int fimc_register_m2m_device(struct fimc_dev *fimc, in fimc_register_m2m_device() argument
717 struct video_device *vfd = &fimc->m2m.vfd; in fimc_register_m2m_device()
720 fimc->v4l2_dev = v4l2_dev; in fimc_register_m2m_device()
728 vfd->lock = &fimc->lock; in fimc_register_m2m_device()
733 snprintf(vfd->name, sizeof(vfd->name), "fimc.%d.m2m", fimc->id); in fimc_register_m2m_device()
734 video_set_drvdata(vfd, fimc); in fimc_register_m2m_device()
736 fimc->m2m.m2m_dev = v4l2_m2m_init(&m2m_ops); in fimc_register_m2m_device()
737 if (IS_ERR(fimc->m2m.m2m_dev)) { in fimc_register_m2m_device()
739 return PTR_ERR(fimc->m2m.m2m_dev); in fimc_register_m2m_device()
757 v4l2_m2m_release(fimc->m2m.m2m_dev); in fimc_register_m2m_device()
761 void fimc_unregister_m2m_device(struct fimc_dev *fimc) in fimc_unregister_m2m_device() argument
763 if (!fimc) in fimc_unregister_m2m_device()
766 if (fimc->m2m.m2m_dev) in fimc_unregister_m2m_device()
767 v4l2_m2m_release(fimc->m2m.m2m_dev); in fimc_unregister_m2m_device()
769 if (video_is_registered(&fimc->m2m.vfd)) { in fimc_unregister_m2m_device()
770 video_unregister_device(&fimc->m2m.vfd); in fimc_unregister_m2m_device()
771 media_entity_cleanup(&fimc->m2m.vfd.entity); in fimc_unregister_m2m_device()