• Home
  • Raw
  • Download

Lines Matching refs:common

79 	struct common_obj *common;  in vpif_buffer_prepare()  local
84 common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_buffer_prepare()
86 vb2_set_plane_payload(vb, 0, common->fmt.fmt.pix.sizeimage); in vpif_buffer_prepare()
90 vbuf->field = common->fmt.fmt.pix.field; in vpif_buffer_prepare()
93 if (!IS_ALIGNED((addr + common->ytop_off), 8) || in vpif_buffer_prepare()
94 !IS_ALIGNED((addr + common->ybtm_off), 8) || in vpif_buffer_prepare()
95 !IS_ALIGNED((addr + common->ctop_off), 8) || in vpif_buffer_prepare()
96 !IS_ALIGNED((addr + common->cbtm_off), 8)) { in vpif_buffer_prepare()
123 struct common_obj *common; in vpif_buffer_queue_setup() local
125 common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_buffer_queue_setup()
129 if (fmt && fmt->fmt.pix.sizeimage < common->fmt.fmt.pix.sizeimage) in vpif_buffer_queue_setup()
136 sizes[0] = fmt ? fmt->fmt.pix.sizeimage : common->fmt.fmt.pix.sizeimage; in vpif_buffer_queue_setup()
137 alloc_ctxs[0] = common->alloc_ctx; in vpif_buffer_queue_setup()
154 struct common_obj *common; in vpif_buffer_queue() local
157 common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_buffer_queue()
161 spin_lock_irqsave(&common->irqlock, flags); in vpif_buffer_queue()
163 list_add_tail(&buf->list, &common->dma_queue); in vpif_buffer_queue()
164 spin_unlock_irqrestore(&common->irqlock, flags); in vpif_buffer_queue()
177 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_start_streaming() local
183 spin_lock_irqsave(&common->irqlock, flags); in vpif_start_streaming()
215 common->cur_frm = common->next_frm = list_entry(common->dma_queue.next, in vpif_start_streaming()
218 list_del(&common->cur_frm->list); in vpif_start_streaming()
219 spin_unlock_irqrestore(&common->irqlock, flags); in vpif_start_streaming()
221 addr = vb2_dma_contig_plane_dma_addr(&common->cur_frm->vb.vb2_buf, 0); in vpif_start_streaming()
223 common->set_addr(addr + common->ytop_off, in vpif_start_streaming()
224 addr + common->ybtm_off, in vpif_start_streaming()
225 addr + common->ctop_off, in vpif_start_streaming()
226 addr + common->cbtm_off); in vpif_start_streaming()
248 list_for_each_entry_safe(buf, tmp, &common->dma_queue, list) { in vpif_start_streaming()
252 spin_unlock_irqrestore(&common->irqlock, flags); in vpif_start_streaming()
267 struct common_obj *common; in vpif_stop_streaming() local
271 common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_stop_streaming()
291 spin_lock_irqsave(&common->irqlock, flags); in vpif_stop_streaming()
292 if (common->cur_frm == common->next_frm) { in vpif_stop_streaming()
293 vb2_buffer_done(&common->cur_frm->vb.vb2_buf, in vpif_stop_streaming()
296 if (common->cur_frm != NULL) in vpif_stop_streaming()
297 vb2_buffer_done(&common->cur_frm->vb.vb2_buf, in vpif_stop_streaming()
299 if (common->next_frm != NULL) in vpif_stop_streaming()
300 vb2_buffer_done(&common->next_frm->vb.vb2_buf, in vpif_stop_streaming()
304 while (!list_empty(&common->dma_queue)) { in vpif_stop_streaming()
305 common->next_frm = list_entry(common->dma_queue.next, in vpif_stop_streaming()
307 list_del(&common->next_frm->list); in vpif_stop_streaming()
308 vb2_buffer_done(&common->next_frm->vb.vb2_buf, in vpif_stop_streaming()
311 spin_unlock_irqrestore(&common->irqlock, flags); in vpif_stop_streaming()
332 static void vpif_process_buffer_complete(struct common_obj *common) in vpif_process_buffer_complete() argument
334 v4l2_get_timestamp(&common->cur_frm->vb.timestamp); in vpif_process_buffer_complete()
335 vb2_buffer_done(&common->cur_frm->vb.vb2_buf, VB2_BUF_STATE_DONE); in vpif_process_buffer_complete()
337 common->cur_frm = common->next_frm; in vpif_process_buffer_complete()
348 static void vpif_schedule_next_buffer(struct common_obj *common) in vpif_schedule_next_buffer() argument
352 spin_lock(&common->irqlock); in vpif_schedule_next_buffer()
353 common->next_frm = list_entry(common->dma_queue.next, in vpif_schedule_next_buffer()
356 list_del(&common->next_frm->list); in vpif_schedule_next_buffer()
357 spin_unlock(&common->irqlock); in vpif_schedule_next_buffer()
358 addr = vb2_dma_contig_plane_dma_addr(&common->next_frm->vb.vb2_buf, 0); in vpif_schedule_next_buffer()
361 common->set_addr(addr + common->ytop_off, in vpif_schedule_next_buffer()
362 addr + common->ybtm_off, in vpif_schedule_next_buffer()
363 addr + common->ctop_off, in vpif_schedule_next_buffer()
364 addr + common->cbtm_off); in vpif_schedule_next_buffer()
378 struct common_obj *common; in vpif_channel_isr() local
390 common = &ch->common[i]; in vpif_channel_isr()
395 spin_lock(&common->irqlock); in vpif_channel_isr()
396 if (list_empty(&common->dma_queue)) { in vpif_channel_isr()
397 spin_unlock(&common->irqlock); in vpif_channel_isr()
400 spin_unlock(&common->irqlock); in vpif_channel_isr()
403 vpif_process_buffer_complete(common); in vpif_channel_isr()
407 vpif_schedule_next_buffer(common); in vpif_channel_isr()
437 if (common->cur_frm == common->next_frm) in vpif_channel_isr()
441 vpif_process_buffer_complete(common); in vpif_channel_isr()
444 spin_lock(&common->irqlock); in vpif_channel_isr()
445 if (list_empty(&common->dma_queue) || in vpif_channel_isr()
446 (common->cur_frm != common->next_frm)) { in vpif_channel_isr()
447 spin_unlock(&common->irqlock); in vpif_channel_isr()
450 spin_unlock(&common->irqlock); in vpif_channel_isr()
452 vpif_schedule_next_buffer(common); in vpif_channel_isr()
468 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_update_std_info() local
499 common->fmt.fmt.pix.width = std_info->width; in vpif_update_std_info()
500 common->width = std_info->width; in vpif_update_std_info()
501 common->fmt.fmt.pix.height = std_info->height; in vpif_update_std_info()
502 common->height = std_info->height; in vpif_update_std_info()
503 common->fmt.fmt.pix.sizeimage = common->height * common->width * 2; in vpif_update_std_info()
504 common->fmt.fmt.pix.bytesperline = std_info->width; in vpif_update_std_info()
509 common->fmt.fmt.pix.colorspace = V4L2_COLORSPACE_SMPTE170M; in vpif_update_std_info()
511 common->fmt.fmt.pix.colorspace = V4L2_COLORSPACE_REC709; in vpif_update_std_info()
514 common->fmt.fmt.pix.field = V4L2_FIELD_NONE; in vpif_update_std_info()
516 common->fmt.fmt.pix.field = V4L2_FIELD_INTERLACED; in vpif_update_std_info()
519 common->fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_SBGGR8; in vpif_update_std_info()
521 common->fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_YUV422P; in vpif_update_std_info()
523 common->fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; in vpif_update_std_info()
540 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_calculate_offsets() local
541 enum v4l2_field field = common->fmt.fmt.pix.field; in vpif_calculate_offsets()
551 vid_ch->buf_field = common->fmt.fmt.pix.field; in vpif_calculate_offsets()
553 sizeimage = common->fmt.fmt.pix.sizeimage; in vpif_calculate_offsets()
555 hpitch = common->fmt.fmt.pix.bytesperline; in vpif_calculate_offsets()
560 common->ytop_off = 0; in vpif_calculate_offsets()
561 common->ybtm_off = hpitch; in vpif_calculate_offsets()
562 common->ctop_off = sizeimage / 2; in vpif_calculate_offsets()
563 common->cbtm_off = sizeimage / 2 + hpitch; in vpif_calculate_offsets()
566 common->ytop_off = 0; in vpif_calculate_offsets()
567 common->ybtm_off = sizeimage / 4; in vpif_calculate_offsets()
568 common->ctop_off = sizeimage / 2; in vpif_calculate_offsets()
569 common->cbtm_off = common->ctop_off + sizeimage / 4; in vpif_calculate_offsets()
572 common->ybtm_off = 0; in vpif_calculate_offsets()
573 common->ytop_off = sizeimage / 4; in vpif_calculate_offsets()
574 common->cbtm_off = sizeimage / 2; in vpif_calculate_offsets()
575 common->ctop_off = common->cbtm_off + sizeimage / 4; in vpif_calculate_offsets()
585 common->fmt.fmt.pix.bytesperline; in vpif_calculate_offsets()
590 common->fmt.fmt.pix.bytesperline * 2; in vpif_calculate_offsets()
593 common->fmt.fmt.pix.bytesperline; in vpif_calculate_offsets()
617 struct common_obj *common; in vpif_config_addr() local
621 common = &(ch->common[VPIF_VIDEO_INDEX]); in vpif_config_addr()
624 common->set_addr = ch1_set_videobuf_addr; in vpif_config_addr()
626 common->set_addr = ch0_set_videobuf_addr_yc_nmux; in vpif_config_addr()
628 common->set_addr = ch0_set_videobuf_addr; in vpif_config_addr()
792 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_s_std() local
807 if (vb2_is_busy(&common->buffer_queue)) in vpif_s_std()
880 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_s_input() local
888 if (vb2_is_busy(&common->buffer_queue)) in vpif_s_input()
936 struct common_obj *common = &(ch->common[VPIF_VIDEO_INDEX]); in vpif_try_fmt_vid_cap() local
951 common->fmt.fmt.pix.pixelformat = pixfmt->pixelformat; in vpif_try_fmt_vid_cap()
955 pixfmt->field = common->fmt.fmt.pix.field; in vpif_try_fmt_vid_cap()
956 pixfmt->colorspace = common->fmt.fmt.pix.colorspace; in vpif_try_fmt_vid_cap()
957 pixfmt->bytesperline = common->fmt.fmt.pix.width; in vpif_try_fmt_vid_cap()
958 pixfmt->width = common->fmt.fmt.pix.width; in vpif_try_fmt_vid_cap()
959 pixfmt->height = common->fmt.fmt.pix.height; in vpif_try_fmt_vid_cap()
978 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_g_fmt_vid_cap() local
981 if (common->fmt.type != fmt->type) in vpif_g_fmt_vid_cap()
985 *fmt = common->fmt; in vpif_g_fmt_vid_cap()
1000 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_s_fmt_vid_cap() local
1005 if (vb2_is_busy(&common->buffer_queue)) in vpif_s_fmt_vid_cap()
1013 common->fmt = *fmt; in vpif_s_fmt_vid_cap()
1118 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_s_dv_timings() local
1138 if (vb2_is_busy(&common->buffer_queue)) in vpif_s_dv_timings()
1341 struct common_obj *common; in vpif_probe_complete() local
1350 common = &(ch->common[VPIF_VIDEO_INDEX]); in vpif_probe_complete()
1351 spin_lock_init(&common->irqlock); in vpif_probe_complete()
1352 mutex_init(&common->lock); in vpif_probe_complete()
1365 q = &common->buffer_queue; in vpif_probe_complete()
1374 q->lock = &common->lock; in vpif_probe_complete()
1382 common->alloc_ctx = vb2_dma_contig_init_ctx(vpif_dev); in vpif_probe_complete()
1383 if (IS_ERR(common->alloc_ctx)) { in vpif_probe_complete()
1385 err = PTR_ERR(common->alloc_ctx); in vpif_probe_complete()
1389 INIT_LIST_HEAD(&common->dma_queue); in vpif_probe_complete()
1400 vdev->lock = &common->lock; in vpif_probe_complete()
1415 common = &ch->common[k]; in vpif_probe_complete()
1416 vb2_dma_contig_cleanup_ctx(common->alloc_ctx); in vpif_probe_complete()
1536 struct common_obj *common; in vpif_remove() local
1547 common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_remove()
1548 vb2_dma_contig_cleanup_ctx(common->alloc_ctx); in vpif_remove()
1563 struct common_obj *common; in vpif_suspend() local
1570 common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_suspend()
1572 if (!vb2_start_streaming_called(&common->buffer_queue)) in vpif_suspend()
1575 mutex_lock(&common->lock); in vpif_suspend()
1586 mutex_unlock(&common->lock); in vpif_suspend()
1597 struct common_obj *common; in vpif_resume() local
1604 common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_resume()
1606 if (!vb2_start_streaming_called(&common->buffer_queue)) in vpif_resume()
1609 mutex_lock(&common->lock); in vpif_resume()
1620 mutex_unlock(&common->lock); in vpif_resume()