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()
97 struct fimc_dev *fimc; in fimc_device_run() local
104 fimc = ctx->fimc_dev; in fimc_device_run()
105 spin_lock_irqsave(&fimc->slock, flags); in fimc_device_run()
107 set_bit(ST_M2M_PEND, &fimc->state); in fimc_device_run()
133 if (fimc->m2m.ctx != ctx) { in fimc_device_run()
135 fimc->m2m.ctx = ctx; in fimc_device_run()
151 if (fimc->drv_data->alpha_color) in fimc_device_run()
155 fimc_hw_set_input_addr(fimc, &sf->paddr); in fimc_device_run()
156 fimc_hw_set_output_addr(fimc, &df->paddr, -1); in fimc_device_run()
160 fimc_hw_activate_input_dma(fimc, true); in fimc_device_run()
163 spin_unlock_irqrestore(&fimc->slock, flags); in fimc_device_run()
234 struct fimc_dev *fimc = video_drvdata(file); in fimc_m2m_querycap() local
236 __fimc_vidioc_querycap(&fimc->pdev->dev, cap); in fimc_m2m_querycap()
269 struct fimc_dev *fimc = ctx->fimc_dev; in fimc_try_fmt_mplane() local
270 const struct fimc_variant *variant = fimc->variant; in fimc_try_fmt_mplane()
345 struct fimc_dev *fimc = ctx->fimc_dev; in fimc_m2m_s_fmt_mplane() local
358 v4l2_err(&fimc->m2m.vfd, "queue (%d) busy\n", f->type); in fimc_m2m_s_fmt_mplane()
433 struct fimc_dev *fimc = ctx->fimc_dev; in fimc_m2m_try_selection() local
439 v4l2_err(&fimc->m2m.vfd, in fimc_m2m_try_selection()
456 fimc->variant->min_inp_pixsize : fimc->variant->min_out_pixsize; in fimc_m2m_try_selection()
459 if (fimc->variant->min_vsize_align == 1) in fimc_m2m_try_selection()
462 halign = ffs(fimc->variant->min_vsize_align) - 1; in fimc_m2m_try_selection()
479 s->r.top = round_down(s->r.top, fimc->variant->hor_offs_align); in fimc_m2m_try_selection()
492 struct fimc_dev *fimc = ctx->fimc_dev; in fimc_m2m_s_selection() local
514 v4l2_err(&fimc->m2m.vfd, "Out of scaler range\n"); in fimc_m2m_s_selection()
608 struct fimc_dev *fimc = video_drvdata(file); in fimc_m2m_open() local
612 pr_debug("pid: %d, state: %#lx\n", task_pid_nr(current), fimc->state); in fimc_m2m_open()
614 if (mutex_lock_interruptible(&fimc->lock)) in fimc_m2m_open()
620 if (test_bit(ST_CAPT_BUSY, &fimc->state)) in fimc_m2m_open()
628 v4l2_fh_init(&ctx->fh, &fimc->m2m.vfd); in fimc_m2m_open()
629 ctx->fimc_dev = fimc; in fimc_m2m_open()
651 ctx->fh.m2m_ctx = v4l2_m2m_ctx_init(fimc->m2m.m2m_dev, ctx, queue_init); in fimc_m2m_open()
657 if (fimc->m2m.refcnt++ == 0) in fimc_m2m_open()
658 set_bit(ST_M2M_RUN, &fimc->state); in fimc_m2m_open()
664 mutex_unlock(&fimc->lock); in fimc_m2m_open()
676 mutex_unlock(&fimc->lock); in fimc_m2m_open()
683 struct fimc_dev *fimc = ctx->fimc_dev; in fimc_m2m_release() local
686 task_pid_nr(current), fimc->state, fimc->m2m.refcnt); in fimc_m2m_release()
688 mutex_lock(&fimc->lock); in fimc_m2m_release()
695 if (--fimc->m2m.refcnt <= 0) in fimc_m2m_release()
696 clear_bit(ST_M2M_RUN, &fimc->state); in fimc_m2m_release()
699 mutex_unlock(&fimc->lock); in fimc_m2m_release()
717 int fimc_register_m2m_device(struct fimc_dev *fimc, in fimc_register_m2m_device() argument
720 struct video_device *vfd = &fimc->m2m.vfd; in fimc_register_m2m_device()
723 fimc->v4l2_dev = v4l2_dev; in fimc_register_m2m_device()
731 vfd->lock = &fimc->lock; in fimc_register_m2m_device()
736 snprintf(vfd->name, sizeof(vfd->name), "fimc.%d.m2m", fimc->id); in fimc_register_m2m_device()
737 video_set_drvdata(vfd, fimc); in fimc_register_m2m_device()
739 fimc->m2m.m2m_dev = v4l2_m2m_init(&m2m_ops); in fimc_register_m2m_device()
740 if (IS_ERR(fimc->m2m.m2m_dev)) { in fimc_register_m2m_device()
742 return PTR_ERR(fimc->m2m.m2m_dev); in fimc_register_m2m_device()
760 v4l2_m2m_release(fimc->m2m.m2m_dev); in fimc_register_m2m_device()
764 void fimc_unregister_m2m_device(struct fimc_dev *fimc) in fimc_unregister_m2m_device() argument
766 if (!fimc) in fimc_unregister_m2m_device()
769 if (fimc->m2m.m2m_dev) in fimc_unregister_m2m_device()
770 v4l2_m2m_release(fimc->m2m.m2m_dev); in fimc_unregister_m2m_device()
772 if (video_is_registered(&fimc->m2m.vfd)) { in fimc_unregister_m2m_device()
773 video_unregister_device(&fimc->m2m.vfd); in fimc_unregister_m2m_device()
774 media_entity_cleanup(&fimc->m2m.vfd.entity); in fimc_unregister_m2m_device()