• Home
  • Raw
  • Download

Lines Matching refs:common

74 	struct common_obj *common;  in vpif_buffer_prepare()  local
76 common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_buffer_prepare()
78 vb2_set_plane_payload(vb, 0, common->fmt.fmt.pix.sizeimage); in vpif_buffer_prepare()
82 vbuf->field = common->fmt.fmt.pix.field; in vpif_buffer_prepare()
87 if (!ISALIGNED(addr + common->ytop_off) || in vpif_buffer_prepare()
88 !ISALIGNED(addr + common->ybtm_off) || in vpif_buffer_prepare()
89 !ISALIGNED(addr + common->ctop_off) || in vpif_buffer_prepare()
90 !ISALIGNED(addr + common->cbtm_off)) { in vpif_buffer_prepare()
118 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_buffer_queue_setup() local
120 if (fmt && fmt->fmt.pix.sizeimage < common->fmt.fmt.pix.sizeimage) in vpif_buffer_queue_setup()
127 sizes[0] = fmt ? fmt->fmt.pix.sizeimage : common->fmt.fmt.pix.sizeimage; in vpif_buffer_queue_setup()
128 alloc_ctxs[0] = common->alloc_ctx; in vpif_buffer_queue_setup()
147 struct common_obj *common; in vpif_buffer_queue() local
150 common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_buffer_queue()
153 spin_lock_irqsave(&common->irqlock, flags); in vpif_buffer_queue()
154 list_add_tail(&buf->list, &common->dma_queue); in vpif_buffer_queue()
155 spin_unlock_irqrestore(&common->irqlock, flags); in vpif_buffer_queue()
168 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_start_streaming() local
174 spin_lock_irqsave(&common->irqlock, flags); in vpif_start_streaming()
197 common->next_frm = common->cur_frm = in vpif_start_streaming()
198 list_entry(common->dma_queue.next, in vpif_start_streaming()
201 list_del(&common->cur_frm->list); in vpif_start_streaming()
202 spin_unlock_irqrestore(&common->irqlock, flags); in vpif_start_streaming()
204 addr = vb2_dma_contig_plane_dma_addr(&common->cur_frm->vb.vb2_buf, 0); in vpif_start_streaming()
205 common->set_addr((addr + common->ytop_off), in vpif_start_streaming()
206 (addr + common->ybtm_off), in vpif_start_streaming()
207 (addr + common->ctop_off), in vpif_start_streaming()
208 (addr + common->cbtm_off)); in vpif_start_streaming()
234 list_for_each_entry_safe(buf, tmp, &common->dma_queue, list) { in vpif_start_streaming()
238 spin_unlock_irqrestore(&common->irqlock, flags); in vpif_start_streaming()
253 struct common_obj *common; in vpif_stop_streaming() local
256 common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_stop_streaming()
269 spin_lock_irqsave(&common->irqlock, flags); in vpif_stop_streaming()
270 if (common->cur_frm == common->next_frm) { in vpif_stop_streaming()
271 vb2_buffer_done(&common->cur_frm->vb.vb2_buf, in vpif_stop_streaming()
274 if (common->cur_frm != NULL) in vpif_stop_streaming()
275 vb2_buffer_done(&common->cur_frm->vb.vb2_buf, in vpif_stop_streaming()
277 if (common->next_frm != NULL) in vpif_stop_streaming()
278 vb2_buffer_done(&common->next_frm->vb.vb2_buf, in vpif_stop_streaming()
282 while (!list_empty(&common->dma_queue)) { in vpif_stop_streaming()
283 common->next_frm = list_entry(common->dma_queue.next, in vpif_stop_streaming()
285 list_del(&common->next_frm->list); in vpif_stop_streaming()
286 vb2_buffer_done(&common->next_frm->vb.vb2_buf, in vpif_stop_streaming()
289 spin_unlock_irqrestore(&common->irqlock, flags); in vpif_stop_streaming()
302 static void process_progressive_mode(struct common_obj *common) in process_progressive_mode() argument
306 spin_lock(&common->irqlock); in process_progressive_mode()
308 common->next_frm = list_entry(common->dma_queue.next, in process_progressive_mode()
311 list_del(&common->next_frm->list); in process_progressive_mode()
312 spin_unlock(&common->irqlock); in process_progressive_mode()
315 addr = vb2_dma_contig_plane_dma_addr(&common->next_frm->vb.vb2_buf, 0); in process_progressive_mode()
316 common->set_addr(addr + common->ytop_off, in process_progressive_mode()
317 addr + common->ybtm_off, in process_progressive_mode()
318 addr + common->ctop_off, in process_progressive_mode()
319 addr + common->cbtm_off); in process_progressive_mode()
322 static void process_interlaced_mode(int fid, struct common_obj *common) in process_interlaced_mode() argument
327 if (common->cur_frm == common->next_frm) in process_interlaced_mode()
333 v4l2_get_timestamp(&common->cur_frm->vb.timestamp); in process_interlaced_mode()
335 vb2_buffer_done(&common->cur_frm->vb.vb2_buf, in process_interlaced_mode()
338 common->cur_frm = common->next_frm; in process_interlaced_mode()
341 spin_lock(&common->irqlock); in process_interlaced_mode()
342 if (list_empty(&common->dma_queue) in process_interlaced_mode()
343 || (common->cur_frm != common->next_frm)) { in process_interlaced_mode()
344 spin_unlock(&common->irqlock); in process_interlaced_mode()
347 spin_unlock(&common->irqlock); in process_interlaced_mode()
352 process_progressive_mode(common); in process_interlaced_mode()
364 struct common_obj *common; in vpif_channel_isr() local
374 common = &ch->common[i]; in vpif_channel_isr()
378 spin_lock(&common->irqlock); in vpif_channel_isr()
379 if (list_empty(&common->dma_queue)) { in vpif_channel_isr()
380 spin_unlock(&common->irqlock); in vpif_channel_isr()
383 spin_unlock(&common->irqlock); in vpif_channel_isr()
390 &common->cur_frm->vb.timestamp); in vpif_channel_isr()
391 vb2_buffer_done(&common->cur_frm->vb.vb2_buf, in vpif_channel_isr()
394 common->cur_frm = common->next_frm; in vpif_channel_isr()
398 process_progressive_mode(common); in vpif_channel_isr()
421 process_interlaced_mode(fid, common); in vpif_channel_isr()
458 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_update_resolution() local
471 common->fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_YUV422P; in vpif_update_resolution()
472 common->fmt.fmt.pix.width = std_info->width; in vpif_update_resolution()
473 common->fmt.fmt.pix.height = std_info->height; in vpif_update_resolution()
475 common->fmt.fmt.pix.width, common->fmt.fmt.pix.height); in vpif_update_resolution()
478 common->height = std_info->height; in vpif_update_resolution()
479 common->width = std_info->width; in vpif_update_resolution()
480 common->fmt.fmt.pix.sizeimage = common->height * common->width * 2; in vpif_update_resolution()
483 common->fmt.fmt.pix.colorspace = V4L2_COLORSPACE_SMPTE170M; in vpif_update_resolution()
485 common->fmt.fmt.pix.colorspace = V4L2_COLORSPACE_REC709; in vpif_update_resolution()
488 common->fmt.fmt.pix.field = V4L2_FIELD_NONE; in vpif_update_resolution()
490 common->fmt.fmt.pix.field = V4L2_FIELD_INTERLACED; in vpif_update_resolution()
501 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_calculate_offsets() local
503 enum v4l2_field field = common->fmt.fmt.pix.field; in vpif_calculate_offsets()
507 if (V4L2_FIELD_ANY == common->fmt.fmt.pix.field) { in vpif_calculate_offsets()
513 vid_ch->buf_field = common->fmt.fmt.pix.field; in vpif_calculate_offsets()
516 sizeimage = common->fmt.fmt.pix.sizeimage; in vpif_calculate_offsets()
518 hpitch = common->fmt.fmt.pix.bytesperline; in vpif_calculate_offsets()
521 common->ytop_off = 0; in vpif_calculate_offsets()
522 common->ybtm_off = hpitch; in vpif_calculate_offsets()
523 common->ctop_off = sizeimage / 2; in vpif_calculate_offsets()
524 common->cbtm_off = sizeimage / 2 + hpitch; in vpif_calculate_offsets()
526 common->ytop_off = 0; in vpif_calculate_offsets()
527 common->ybtm_off = sizeimage / 4; in vpif_calculate_offsets()
528 common->ctop_off = sizeimage / 2; in vpif_calculate_offsets()
529 common->cbtm_off = common->ctop_off + sizeimage / 4; in vpif_calculate_offsets()
531 common->ybtm_off = 0; in vpif_calculate_offsets()
532 common->ytop_off = sizeimage / 4; in vpif_calculate_offsets()
533 common->cbtm_off = sizeimage / 2; in vpif_calculate_offsets()
534 common->ctop_off = common->cbtm_off + sizeimage / 4; in vpif_calculate_offsets()
546 common->fmt.fmt.pix.bytesperline; in vpif_calculate_offsets()
551 common->fmt.fmt.pix.bytesperline * 2; in vpif_calculate_offsets()
554 common->fmt.fmt.pix.bytesperline; in vpif_calculate_offsets()
562 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_config_addr() local
565 common->set_addr = ch3_set_videobuf_addr; in vpif_config_addr()
568 common->set_addr = ch2_set_videobuf_addr_yc_nmux; in vpif_config_addr()
570 common->set_addr = ch2_set_videobuf_addr; in vpif_config_addr()
615 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_g_fmt_vid_out() local
618 if (common->fmt.type != fmt->type) in vpif_g_fmt_vid_out()
623 *fmt = common->fmt; in vpif_g_fmt_vid_out()
632 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_try_fmt_vid_out() local
640 pixfmt->pixelformat = common->fmt.fmt.pix.pixelformat; in vpif_try_fmt_vid_out()
645 pixfmt->colorspace = common->fmt.fmt.pix.colorspace; in vpif_try_fmt_vid_out()
646 pixfmt->field = common->fmt.fmt.pix.field; in vpif_try_fmt_vid_out()
647 pixfmt->bytesperline = common->fmt.fmt.pix.width; in vpif_try_fmt_vid_out()
648 pixfmt->width = common->fmt.fmt.pix.width; in vpif_try_fmt_vid_out()
649 pixfmt->height = common->fmt.fmt.pix.height; in vpif_try_fmt_vid_out()
660 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_s_fmt_vid_out() local
664 if (vb2_is_busy(&common->buffer_queue)) in vpif_s_fmt_vid_out()
672 common->fmt.fmt.pix = *pixfmt; in vpif_s_fmt_vid_out()
675 common->fmt = *fmt; in vpif_s_fmt_vid_out()
684 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_s_std() local
697 if (vb2_is_busy(&common->buffer_queue)) in vpif_s_std()
711 common->fmt.fmt.pix.bytesperline = common->fmt.fmt.pix.width; in vpif_s_std()
848 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_s_output() local
850 if (vb2_is_busy(&common->buffer_queue)) in vpif_s_output()
917 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_s_dv_timings() local
933 if (vb2_is_busy(&common->buffer_queue)) in vpif_s_dv_timings()
1140 struct common_obj *common; in vpif_probe_complete() local
1150 common = &ch->common[k]; in vpif_probe_complete()
1151 spin_lock_init(&common->irqlock); in vpif_probe_complete()
1152 mutex_init(&common->lock); in vpif_probe_complete()
1153 common->set_addr = NULL; in vpif_probe_complete()
1154 common->ytop_off = 0; in vpif_probe_complete()
1155 common->ybtm_off = 0; in vpif_probe_complete()
1156 common->ctop_off = 0; in vpif_probe_complete()
1157 common->cbtm_off = 0; in vpif_probe_complete()
1158 common->cur_frm = NULL; in vpif_probe_complete()
1159 common->next_frm = NULL; in vpif_probe_complete()
1160 memset(&common->fmt, 0, sizeof(common->fmt)); in vpif_probe_complete()
1169 ch->common[VPIF_VIDEO_INDEX].fmt.type = in vpif_probe_complete()
1183 q = &common->buffer_queue; in vpif_probe_complete()
1192 q->lock = &common->lock; in vpif_probe_complete()
1199 common->alloc_ctx = vb2_dma_contig_init_ctx(vpif_dev); in vpif_probe_complete()
1200 if (IS_ERR(common->alloc_ctx)) { in vpif_probe_complete()
1202 err = PTR_ERR(common->alloc_ctx); in vpif_probe_complete()
1206 INIT_LIST_HEAD(&common->dma_queue); in vpif_probe_complete()
1221 vdev->lock = &common->lock; in vpif_probe_complete()
1234 common = &ch->common[k]; in vpif_probe_complete()
1235 vb2_dma_contig_cleanup_ctx(common->alloc_ctx); in vpif_probe_complete()
1345 struct common_obj *common; in vpif_remove() local
1356 common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_remove()
1357 vb2_dma_contig_cleanup_ctx(common->alloc_ctx); in vpif_remove()
1369 struct common_obj *common; in vpif_suspend() local
1376 common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_suspend()
1378 if (!vb2_start_streaming_called(&common->buffer_queue)) in vpif_suspend()
1381 mutex_lock(&common->lock); in vpif_suspend()
1392 mutex_unlock(&common->lock); in vpif_suspend()
1401 struct common_obj *common; in vpif_resume() local
1408 common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_resume()
1410 if (!vb2_start_streaming_called(&common->buffer_queue)) in vpif_resume()
1413 mutex_lock(&common->lock); in vpif_resume()
1424 mutex_unlock(&common->lock); in vpif_resume()