Lines Matching full:fimc
3 * Samsung S5P/EXYNOS4 SoC series FIMC (video postprocessor) driver
27 #include "fimc-core.h"
28 #include "fimc-reg.h"
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()
343 struct fimc_dev *fimc = ctx->fimc_dev; in fimc_m2m_s_fmt_mplane() local
356 v4l2_err(&fimc->m2m.vfd, "queue (%d) busy\n", f->type); in fimc_m2m_s_fmt_mplane()
431 struct fimc_dev *fimc = ctx->fimc_dev; in fimc_m2m_try_selection() local
437 v4l2_err(&fimc->m2m.vfd, in fimc_m2m_try_selection()
454 fimc->variant->min_inp_pixsize : fimc->variant->min_out_pixsize; in fimc_m2m_try_selection()
457 if (fimc->variant->min_vsize_align == 1) in fimc_m2m_try_selection()
460 halign = ffs(fimc->variant->min_vsize_align) - 1; in fimc_m2m_try_selection()
477 s->r.top = round_down(s->r.top, fimc->variant->hor_offs_align); in fimc_m2m_try_selection()
490 struct fimc_dev *fimc = ctx->fimc_dev; in fimc_m2m_s_selection() local
512 v4l2_err(&fimc->m2m.vfd, "Out of scaler range\n"); in fimc_m2m_s_selection()
606 struct fimc_dev *fimc = video_drvdata(file); in fimc_m2m_open() local
610 pr_debug("pid: %d, state: %#lx\n", task_pid_nr(current), fimc->state); in fimc_m2m_open()
612 if (mutex_lock_interruptible(&fimc->lock)) in fimc_m2m_open()
616 * capture video node that belong to same FIMC IP instance. in fimc_m2m_open()
618 if (test_bit(ST_CAPT_BUSY, &fimc->state)) in fimc_m2m_open()
626 v4l2_fh_init(&ctx->fh, &fimc->m2m.vfd); in fimc_m2m_open()
627 ctx->fimc_dev = fimc; in fimc_m2m_open()
649 ctx->fh.m2m_ctx = v4l2_m2m_ctx_init(fimc->m2m.m2m_dev, ctx, queue_init); in fimc_m2m_open()
655 if (fimc->m2m.refcnt++ == 0) in fimc_m2m_open()
656 set_bit(ST_M2M_RUN, &fimc->state); in fimc_m2m_open()
662 mutex_unlock(&fimc->lock); in fimc_m2m_open()
674 mutex_unlock(&fimc->lock); in fimc_m2m_open()
681 struct fimc_dev *fimc = ctx->fimc_dev; in fimc_m2m_release() local
684 task_pid_nr(current), fimc->state, fimc->m2m.refcnt); in fimc_m2m_release()
686 mutex_lock(&fimc->lock); in fimc_m2m_release()
693 if (--fimc->m2m.refcnt <= 0) in fimc_m2m_release()
694 clear_bit(ST_M2M_RUN, &fimc->state); in fimc_m2m_release()
697 mutex_unlock(&fimc->lock); in fimc_m2m_release()
715 int fimc_register_m2m_device(struct fimc_dev *fimc, in fimc_register_m2m_device() argument
718 struct video_device *vfd = &fimc->m2m.vfd; in fimc_register_m2m_device()
721 fimc->v4l2_dev = v4l2_dev; in fimc_register_m2m_device()
729 vfd->lock = &fimc->lock; in fimc_register_m2m_device()
734 snprintf(vfd->name, sizeof(vfd->name), "fimc.%d.m2m", fimc->id); in fimc_register_m2m_device()
735 video_set_drvdata(vfd, fimc); in fimc_register_m2m_device()
737 fimc->m2m.m2m_dev = v4l2_m2m_init(&m2m_ops); in fimc_register_m2m_device()
738 if (IS_ERR(fimc->m2m.m2m_dev)) { in fimc_register_m2m_device()
740 return PTR_ERR(fimc->m2m.m2m_dev); in fimc_register_m2m_device()
758 v4l2_m2m_release(fimc->m2m.m2m_dev); in fimc_register_m2m_device()
762 void fimc_unregister_m2m_device(struct fimc_dev *fimc) in fimc_unregister_m2m_device() argument
764 if (!fimc) in fimc_unregister_m2m_device()
767 if (fimc->m2m.m2m_dev) in fimc_unregister_m2m_device()
768 v4l2_m2m_release(fimc->m2m.m2m_dev); in fimc_unregister_m2m_device()
770 if (video_is_registered(&fimc->m2m.vfd)) { in fimc_unregister_m2m_device()
771 video_unregister_device(&fimc->m2m.vfd); in fimc_unregister_m2m_device()
772 media_entity_cleanup(&fimc->m2m.vfd.entity); in fimc_unregister_m2m_device()