Lines Matching refs:gsc

30 	struct gsc_dev *gsc = ctx->gsc_dev;  in gsc_m2m_ctx_stop_req()  local
33 curr_ctx = v4l2_m2m_get_curr_priv(gsc->m2m.m2m_dev); in gsc_m2m_ctx_stop_req()
34 if (!gsc_m2m_pending(gsc) || (curr_ctx != ctx)) in gsc_m2m_ctx_stop_req()
38 ret = wait_event_timeout(gsc->irq_queue, in gsc_m2m_ctx_stop_req()
147 struct gsc_dev *gsc; in gsc_m2m_device_run() local
155 gsc = ctx->gsc_dev; in gsc_m2m_device_run()
156 spin_lock_irqsave(&gsc->slock, flags); in gsc_m2m_device_run()
158 set_bit(ST_M2M_PEND, &gsc->state); in gsc_m2m_device_run()
161 if (gsc->m2m.ctx != ctx) { in gsc_m2m_device_run()
163 gsc->m2m.ctx, ctx); in gsc_m2m_device_run()
165 gsc->m2m.ctx = ctx; in gsc_m2m_device_run()
172 wake_up(&gsc->irq_queue); in gsc_m2m_device_run()
182 gsc_set_prefbuf(gsc, &ctx->s_frame); in gsc_m2m_device_run()
183 gsc_hw_set_input_addr(gsc, &ctx->s_frame.addr, GSC_M2M_BUF_NUM); in gsc_m2m_device_run()
184 gsc_hw_set_output_addr(gsc, &ctx->d_frame.addr, GSC_M2M_BUF_NUM); in gsc_m2m_device_run()
187 gsc_hw_set_input_buf_masking(gsc, GSC_M2M_BUF_NUM, false); in gsc_m2m_device_run()
188 gsc_hw_set_output_buf_masking(gsc, GSC_M2M_BUF_NUM, false); in gsc_m2m_device_run()
189 gsc_hw_set_frm_done_irq_mask(gsc, false); in gsc_m2m_device_run()
190 gsc_hw_set_gsc_irq_enable(gsc, true); in gsc_m2m_device_run()
215 gsc_hw_enable_control(gsc, true); in gsc_m2m_device_run()
217 spin_unlock_irqrestore(&gsc->slock, flags); in gsc_m2m_device_run()
222 spin_unlock_irqrestore(&gsc->slock, flags); in gsc_m2m_device_run()
365 struct gsc_dev *gsc = ctx->gsc_dev; in gsc_m2m_reqbufs() local
369 gsc->variant->in_buf_cnt : gsc->variant->out_buf_cnt; in gsc_m2m_reqbufs()
608 struct gsc_dev *gsc = video_drvdata(file); in gsc_m2m_open() local
612 pr_debug("pid: %d, state: 0x%lx", task_pid_nr(current), gsc->state); in gsc_m2m_open()
614 if (mutex_lock_interruptible(&gsc->lock)) in gsc_m2m_open()
623 v4l2_fh_init(&ctx->fh, gsc->m2m.vfd); in gsc_m2m_open()
633 ctx->gsc_dev = gsc; in gsc_m2m_open()
643 ctx->m2m_ctx = v4l2_m2m_ctx_init(gsc->m2m.m2m_dev, ctx, queue_init); in gsc_m2m_open()
650 if (gsc->m2m.refcnt++ == 0) in gsc_m2m_open()
651 set_bit(ST_M2M_OPEN, &gsc->state); in gsc_m2m_open()
655 mutex_unlock(&gsc->lock); in gsc_m2m_open()
665 mutex_unlock(&gsc->lock); in gsc_m2m_open()
672 struct gsc_dev *gsc = ctx->gsc_dev; in gsc_m2m_release() local
675 task_pid_nr(current), gsc->state, gsc->m2m.refcnt); in gsc_m2m_release()
677 mutex_lock(&gsc->lock); in gsc_m2m_release()
684 if (--gsc->m2m.refcnt <= 0) in gsc_m2m_release()
685 clear_bit(ST_M2M_OPEN, &gsc->state); in gsc_m2m_release()
688 mutex_unlock(&gsc->lock); in gsc_m2m_release()
696 struct gsc_dev *gsc = ctx->gsc_dev; in gsc_m2m_poll() local
699 if (mutex_lock_interruptible(&gsc->lock)) in gsc_m2m_poll()
703 mutex_unlock(&gsc->lock); in gsc_m2m_poll()
711 struct gsc_dev *gsc = ctx->gsc_dev; in gsc_m2m_mmap() local
714 if (mutex_lock_interruptible(&gsc->lock)) in gsc_m2m_mmap()
718 mutex_unlock(&gsc->lock); in gsc_m2m_mmap()
737 int gsc_register_m2m_device(struct gsc_dev *gsc) in gsc_register_m2m_device() argument
742 if (!gsc) in gsc_register_m2m_device()
745 pdev = gsc->pdev; in gsc_register_m2m_device()
747 gsc->vdev.fops = &gsc_m2m_fops; in gsc_register_m2m_device()
748 gsc->vdev.ioctl_ops = &gsc_m2m_ioctl_ops; in gsc_register_m2m_device()
749 gsc->vdev.release = video_device_release_empty; in gsc_register_m2m_device()
750 gsc->vdev.lock = &gsc->lock; in gsc_register_m2m_device()
751 gsc->vdev.vfl_dir = VFL_DIR_M2M; in gsc_register_m2m_device()
752 gsc->vdev.v4l2_dev = &gsc->v4l2_dev; in gsc_register_m2m_device()
753 gsc->vdev.device_caps = V4L2_CAP_STREAMING | in gsc_register_m2m_device()
755 snprintf(gsc->vdev.name, sizeof(gsc->vdev.name), "%s.%d:m2m", in gsc_register_m2m_device()
756 GSC_MODULE_NAME, gsc->id); in gsc_register_m2m_device()
758 video_set_drvdata(&gsc->vdev, gsc); in gsc_register_m2m_device()
760 gsc->m2m.vfd = &gsc->vdev; in gsc_register_m2m_device()
761 gsc->m2m.m2m_dev = v4l2_m2m_init(&gsc_m2m_ops); in gsc_register_m2m_device()
762 if (IS_ERR(gsc->m2m.m2m_dev)) { in gsc_register_m2m_device()
764 return PTR_ERR(gsc->m2m.m2m_dev); in gsc_register_m2m_device()
767 ret = video_register_device(&gsc->vdev, VFL_TYPE_VIDEO, -1); in gsc_register_m2m_device()
774 pr_debug("gsc m2m driver registered as /dev/video%d", gsc->vdev.num); in gsc_register_m2m_device()
778 v4l2_m2m_release(gsc->m2m.m2m_dev); in gsc_register_m2m_device()
783 void gsc_unregister_m2m_device(struct gsc_dev *gsc) in gsc_unregister_m2m_device() argument
785 if (gsc) { in gsc_unregister_m2m_device()
786 v4l2_m2m_release(gsc->m2m.m2m_dev); in gsc_unregister_m2m_device()
787 video_unregister_device(&gsc->vdev); in gsc_unregister_m2m_device()