Lines Matching full:video

29 sun6i_video_remote_subdev(struct sun6i_video *video, u32 *pad)  in sun6i_video_remote_subdev()  argument
33 remote = media_pad_remote_pad_first(&video->pad); in sun6i_video_remote_subdev()
87 /* Video */
98 struct sun6i_video *video = &csi_dev->video; in sun6i_video_configure() local
101 config.pixelformat = video->format.fmt.pix.pixelformat; in sun6i_video_configure()
102 config.code = video->mbus_code; in sun6i_video_configure()
103 config.field = video->format.fmt.pix.field; in sun6i_video_configure()
104 config.width = video->format.fmt.pix.width; in sun6i_video_configure()
105 config.height = video->format.fmt.pix.height; in sun6i_video_configure()
119 struct sun6i_video *video = &csi_dev->video; in sun6i_video_queue_setup() local
120 unsigned int size = video->format.fmt.pix.sizeimage; in sun6i_video_queue_setup()
134 struct sun6i_video *video = &csi_dev->video; in sun6i_video_buffer_prepare() local
139 unsigned long size = video->format.fmt.pix.sizeimage; in sun6i_video_buffer_prepare()
150 v4l2_buffer->field = video->format.fmt.pix.field; in sun6i_video_buffer_prepare()
158 struct sun6i_video *video = &csi_dev->video; in sun6i_video_buffer_queue() local
164 spin_lock_irqsave(&video->dma_queue_lock, flags); in sun6i_video_buffer_queue()
166 list_add_tail(&csi_buffer->list, &video->dma_queue); in sun6i_video_buffer_queue()
167 spin_unlock_irqrestore(&video->dma_queue_lock, flags); in sun6i_video_buffer_queue()
174 struct sun6i_video *video = &csi_dev->video; in sun6i_video_start_streaming() local
175 struct video_device *video_dev = &video->video_dev; in sun6i_video_start_streaming()
182 video->sequence = 0; in sun6i_video_start_streaming()
188 if (video->mbus_code == 0) { in sun6i_video_start_streaming()
193 subdev = sun6i_video_remote_subdev(video, NULL); in sun6i_video_start_streaming()
201 spin_lock_irqsave(&video->dma_queue_lock, flags); in sun6i_video_start_streaming()
203 buf = list_first_entry(&video->dma_queue, in sun6i_video_start_streaming()
229 spin_unlock_irqrestore(&video->dma_queue_lock, flags); in sun6i_video_start_streaming()
231 ret = v4l2_subdev_call(subdev, video, s_stream, 1); in sun6i_video_start_streaming()
244 spin_lock_irqsave(&video->dma_queue_lock, flags); in sun6i_video_start_streaming()
245 list_for_each_entry(buf, &video->dma_queue, list) in sun6i_video_start_streaming()
248 INIT_LIST_HEAD(&video->dma_queue); in sun6i_video_start_streaming()
249 spin_unlock_irqrestore(&video->dma_queue_lock, flags); in sun6i_video_start_streaming()
257 struct sun6i_video *video = &csi_dev->video; in sun6i_video_stop_streaming() local
262 subdev = sun6i_video_remote_subdev(video, NULL); in sun6i_video_stop_streaming()
264 v4l2_subdev_call(subdev, video, s_stream, 0); in sun6i_video_stop_streaming()
268 video_device_pipeline_stop(&video->video_dev); in sun6i_video_stop_streaming()
271 spin_lock_irqsave(&video->dma_queue_lock, flags); in sun6i_video_stop_streaming()
272 list_for_each_entry(buf, &video->dma_queue, list) in sun6i_video_stop_streaming()
274 INIT_LIST_HEAD(&video->dma_queue); in sun6i_video_stop_streaming()
275 spin_unlock_irqrestore(&video->dma_queue_lock, flags); in sun6i_video_stop_streaming()
280 struct sun6i_video *video = &csi_dev->video; in sun6i_video_frame_done() local
285 spin_lock(&video->dma_queue_lock); in sun6i_video_frame_done()
287 buf = list_first_entry(&video->dma_queue, in sun6i_video_frame_done()
289 if (list_is_last(&buf->list, &video->dma_queue)) { in sun6i_video_frame_done()
309 v4l2_buffer->sequence = video->sequence; in sun6i_video_frame_done()
313 if (!list_is_last(&next_buf->list, &video->dma_queue)) { in sun6i_video_frame_done()
321 video->sequence++; in sun6i_video_frame_done()
322 spin_unlock(&video->dma_queue_lock); in sun6i_video_frame_done()
341 struct video_device *video_dev = &csi_dev->video.video_dev; in sun6i_video_querycap()
368 struct sun6i_video *video = &csi_dev->video; in sun6i_video_g_fmt() local
370 *format = video->format; in sun6i_video_g_fmt()
375 static int sun6i_video_format_try(struct sun6i_video *video, in sun6i_video_format_try() argument
406 static int sun6i_video_format_set(struct sun6i_video *video, in sun6i_video_format_set() argument
411 ret = sun6i_video_format_try(video, format); in sun6i_video_format_set()
415 video->format = *format; in sun6i_video_format_set()
424 struct sun6i_video *video = &csi_dev->video; in sun6i_video_s_fmt() local
426 if (vb2_is_busy(&video->queue)) in sun6i_video_s_fmt()
429 return sun6i_video_format_set(video, format); in sun6i_video_s_fmt()
436 struct sun6i_video *video = &csi_dev->video; in sun6i_video_try_fmt() local
438 return sun6i_video_format_try(video, format); in sun6i_video_try_fmt()
498 struct sun6i_video *video = &csi_dev->video; in sun6i_video_open() local
501 if (mutex_lock_interruptible(&video->lock)) in sun6i_video_open()
508 ret = v4l2_pipeline_pm_get(&video->video_dev.entity); in sun6i_video_open()
519 mutex_unlock(&video->lock); in sun6i_video_open()
527 mutex_unlock(&video->lock); in sun6i_video_open()
535 struct sun6i_video *video = &csi_dev->video; in sun6i_video_close() local
538 mutex_lock(&video->lock); in sun6i_video_close()
543 v4l2_pipeline_pm_put(&video->video_dev.entity); in sun6i_video_close()
549 mutex_unlock(&video->lock); in sun6i_video_close()
585 struct sun6i_video *video = &csi_dev->video; in sun6i_video_link_validate() local
589 video->mbus_code = 0; in sun6i_video_link_validate()
592 dev_info(csi_dev->dev, "video node %s pad not connected\n", in sun6i_video_link_validate()
602 video->format.fmt.pix.pixelformat, in sun6i_video_link_validate()
606 video->format.fmt.pix.pixelformat, in sun6i_video_link_validate()
611 if (source_fmt.format.width != video->format.fmt.pix.width || in sun6i_video_link_validate()
612 source_fmt.format.height != video->format.fmt.pix.height) { in sun6i_video_link_validate()
615 video->format.fmt.pix.width, video->format.fmt.pix.height, in sun6i_video_link_validate()
620 video->mbus_code = source_fmt.format.code; in sun6i_video_link_validate()
629 /* Video */
633 struct sun6i_video *video = &csi_dev->video; in sun6i_video_setup() local
635 struct video_device *video_dev = &video->video_dev; in sun6i_video_setup()
636 struct vb2_queue *queue = &video->queue; in sun6i_video_setup()
637 struct media_pad *pad = &video->pad; in sun6i_video_setup()
656 INIT_LIST_HEAD(&video->dma_queue); in sun6i_video_setup()
657 spin_lock_init(&video->dma_queue_lock); in sun6i_video_setup()
659 video->sequence = 0; in sun6i_video_setup()
663 mutex_init(&video->lock); in sun6i_video_setup()
671 queue->lock = &video->lock; in sun6i_video_setup()
692 sun6i_video_format_set(video, &format); in sun6i_video_setup()
694 /* Video Device */ in sun6i_video_setup()
704 video_dev->lock = &video->lock; in sun6i_video_setup()
710 v4l2_err(v4l2_dev, "failed to register video device: %d\n", in sun6i_video_setup()
720 mutex_destroy(&video->lock); in sun6i_video_setup()
727 struct sun6i_video *video = &csi_dev->video; in sun6i_video_cleanup() local
728 struct video_device *video_dev = &video->video_dev; in sun6i_video_cleanup()
732 mutex_destroy(&video->lock); in sun6i_video_cleanup()