Lines Matching full:common
138 struct common_obj *common; in vpif_buffer_prepare() local
141 common = &fh->channel->common[VPIF_VIDEO_INDEX]; in vpif_buffer_prepare()
143 vb->width = common->width; in vpif_buffer_prepare()
144 vb->height = common->height; in vpif_buffer_prepare()
152 if (V4L2_MEMORY_USERPTR == common->memory) { in vpif_buffer_prepare()
165 if (!ISALIGNED(addr + common->ytop_off) || in vpif_buffer_prepare()
166 !ISALIGNED(addr + common->ybtm_off) || in vpif_buffer_prepare()
167 !ISALIGNED(addr + common->ctop_off) || in vpif_buffer_prepare()
168 !ISALIGNED(addr + common->cbtm_off)) in vpif_buffer_prepare()
186 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_buffer_setup() local
188 if (V4L2_MEMORY_MMAP != common->memory) in vpif_buffer_setup()
205 struct common_obj *common; in vpif_buffer_queue() local
207 common = &fh->channel->common[VPIF_VIDEO_INDEX]; in vpif_buffer_queue()
210 list_add_tail(&vb->queue, &common->dma_queue); in vpif_buffer_queue()
223 struct common_obj *common; in vpif_buffer_release() local
226 common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_buffer_release()
231 if (V4L2_MEMORY_MMAP != common->memory) in vpif_buffer_release()
245 static void process_progressive_mode(struct common_obj *common) in process_progressive_mode() argument
250 common->next_frm = list_entry(common->dma_queue.next, in process_progressive_mode()
253 list_del(&common->next_frm->queue); in process_progressive_mode()
255 common->next_frm->state = VIDEOBUF_ACTIVE; in process_progressive_mode()
258 addr = videobuf_to_dma_contig(common->next_frm); in process_progressive_mode()
259 common->set_addr(addr + common->ytop_off, in process_progressive_mode()
260 addr + common->ybtm_off, in process_progressive_mode()
261 addr + common->ctop_off, in process_progressive_mode()
262 addr + common->cbtm_off); in process_progressive_mode()
265 static void process_interlaced_mode(int fid, struct common_obj *common) in process_interlaced_mode() argument
270 if (common->cur_frm == common->next_frm) in process_interlaced_mode()
276 do_gettimeofday(&common->cur_frm->ts); in process_interlaced_mode()
278 common->cur_frm->state = VIDEOBUF_DONE; in process_interlaced_mode()
280 wake_up_interruptible(&common->cur_frm->done); in process_interlaced_mode()
282 common->cur_frm = common->next_frm; in process_interlaced_mode()
285 if (list_empty(&common->dma_queue) in process_interlaced_mode()
286 || (common->cur_frm != common->next_frm)) { in process_interlaced_mode()
293 process_progressive_mode(common); in process_interlaced_mode()
306 struct common_obj *common; in vpif_channel_isr() local
313 field = ch->common[VPIF_VIDEO_INDEX].fmt.fmt.pix.field; in vpif_channel_isr()
315 common = &ch->common[i]; in vpif_channel_isr()
317 if (0 == common->started) in vpif_channel_isr()
321 if (list_empty(&common->dma_queue)) in vpif_channel_isr()
328 do_gettimeofday(&common->cur_frm->ts); in vpif_channel_isr()
329 common->cur_frm->state = VIDEOBUF_DONE; in vpif_channel_isr()
330 wake_up_interruptible(&common->cur_frm->done); in vpif_channel_isr()
332 common->cur_frm = common->next_frm; in vpif_channel_isr()
336 process_progressive_mode(common); in vpif_channel_isr()
359 process_interlaced_mode(fid, common); in vpif_channel_isr()
402 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_update_resolution() local
415 common->fmt.fmt.pix.width = std_info->width; in vpif_update_resolution()
416 common->fmt.fmt.pix.height = std_info->height; in vpif_update_resolution()
418 common->fmt.fmt.pix.width, common->fmt.fmt.pix.height); in vpif_update_resolution()
421 common->height = std_info->height; in vpif_update_resolution()
422 common->width = std_info->width; in vpif_update_resolution()
433 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_calculate_offsets() local
435 enum v4l2_field field = common->fmt.fmt.pix.field; in vpif_calculate_offsets()
439 if (V4L2_FIELD_ANY == common->fmt.fmt.pix.field) { in vpif_calculate_offsets()
445 vid_ch->buf_field = common->fmt.fmt.pix.field; in vpif_calculate_offsets()
448 if (V4L2_MEMORY_USERPTR == common->memory) in vpif_calculate_offsets()
449 sizeimage = common->fmt.fmt.pix.sizeimage; in vpif_calculate_offsets()
453 hpitch = common->fmt.fmt.pix.bytesperline; in vpif_calculate_offsets()
457 common->ytop_off = 0; in vpif_calculate_offsets()
458 common->ybtm_off = hpitch; in vpif_calculate_offsets()
459 common->ctop_off = sizeimage / 2; in vpif_calculate_offsets()
460 common->cbtm_off = sizeimage / 2 + hpitch; in vpif_calculate_offsets()
462 common->ytop_off = 0; in vpif_calculate_offsets()
463 common->ybtm_off = sizeimage / 4; in vpif_calculate_offsets()
464 common->ctop_off = sizeimage / 2; in vpif_calculate_offsets()
465 common->cbtm_off = common->ctop_off + sizeimage / 4; in vpif_calculate_offsets()
467 common->ybtm_off = 0; in vpif_calculate_offsets()
468 common->ytop_off = sizeimage / 4; in vpif_calculate_offsets()
469 common->cbtm_off = sizeimage / 2; in vpif_calculate_offsets()
470 common->ctop_off = common->cbtm_off + sizeimage / 4; in vpif_calculate_offsets()
482 common->fmt.fmt.pix.bytesperline; in vpif_calculate_offsets()
487 common->fmt.fmt.pix.bytesperline * 2; in vpif_calculate_offsets()
490 common->fmt.fmt.pix.bytesperline; in vpif_calculate_offsets()
498 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_config_format() local
500 common->fmt.fmt.pix.field = V4L2_FIELD_ANY; in vpif_config_format()
502 common->memory = V4L2_MEMORY_USERPTR; in vpif_config_format()
504 common->memory = V4L2_MEMORY_MMAP; in vpif_config_format()
506 common->fmt.fmt.pix.sizeimage = in vpif_config_format()
508 common->fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_YUV422P; in vpif_config_format()
509 common->fmt.type = V4L2_BUF_TYPE_VIDEO_OUTPUT; in vpif_config_format()
515 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_check_format() local
528 if (V4L2_MEMORY_USERPTR == common->memory) in vpif_check_format()
549 pixfmt->width = common->fmt.fmt.pix.width; in vpif_check_format()
550 pixfmt->height = common->fmt.fmt.pix.height; in vpif_check_format()
565 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_config_addr() local
568 common->set_addr = ch3_set_videobuf_addr; in vpif_config_addr()
571 common->set_addr = ch2_set_videobuf_addr_yc_nmux; in vpif_config_addr()
573 common->set_addr = ch2_set_videobuf_addr; in vpif_config_addr()
584 struct common_obj *common = &(ch->common[VPIF_VIDEO_INDEX]); in vpif_mmap() local
588 return videobuf_mmap_mapper(&common->buffer_queue, vma); in vpif_mmap()
598 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_poll() local
600 if (common->started) in vpif_poll()
601 return videobuf_poll_stream(filep, &common->buffer_queue, wait); in vpif_poll()
653 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_release() local
658 common->io_usrs = 0; in vpif_release()
665 (2 == common->started)) { in vpif_release()
669 common->started = 0; in vpif_release()
671 videobuf_queue_cancel(&common->buffer_queue); in vpif_release()
672 videobuf_mmap_free(&common->buffer_queue); in vpif_release()
673 common->numbuffers = in vpif_release()
733 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_g_fmt_vid_out() local
736 if (common->fmt.type != fmt->type) in vpif_g_fmt_vid_out()
741 *fmt = common->fmt; in vpif_g_fmt_vid_out()
751 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_s_fmt_vid_out() local
768 if (common->started) { in vpif_s_fmt_vid_out()
780 common->fmt.fmt.pix = *pixfmt; in vpif_s_fmt_vid_out()
782 common->fmt = *fmt; in vpif_s_fmt_vid_out()
791 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_try_fmt_vid_out() local
797 *pixfmt = common->fmt.fmt.pix; in vpif_try_fmt_vid_out()
809 struct common_obj *common; in vpif_reqbufs() local
828 common = &ch->common[index]; in vpif_reqbufs()
830 if (common->fmt.type != reqbuf->type) in vpif_reqbufs()
833 if (0 != common->io_usrs) in vpif_reqbufs()
837 if (common->fmt.fmt.pix.field == V4L2_FIELD_ANY) in vpif_reqbufs()
840 field = common->fmt.fmt.pix.field; in vpif_reqbufs()
846 videobuf_queue_dma_contig_init(&common->buffer_queue, in vpif_reqbufs()
848 &common->irqlock, in vpif_reqbufs()
851 &common->lock); in vpif_reqbufs()
856 common->io_usrs = 1; in vpif_reqbufs()
858 common->memory = reqbuf->memory; in vpif_reqbufs()
859 INIT_LIST_HEAD(&common->dma_queue); in vpif_reqbufs()
862 return videobuf_reqbufs(&common->buffer_queue, reqbuf); in vpif_reqbufs()
870 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_querybuf() local
872 if (common->fmt.type != tbuf->type) in vpif_querybuf()
875 return videobuf_querybuf(&common->buffer_queue, tbuf); in vpif_querybuf()
883 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_qbuf() local
890 if (common->fmt.type != tbuf.type) in vpif_qbuf()
898 if (!(list_empty(&common->dma_queue)) || in vpif_qbuf()
899 (common->cur_frm != common->next_frm) || in vpif_qbuf()
900 !(common->started) || in vpif_qbuf()
901 (common->started && (0 == ch->field_id))) in vpif_qbuf()
902 return videobuf_qbuf(&common->buffer_queue, buf); in vpif_qbuf()
905 mutex_lock(&common->buffer_queue.vb_lock); in vpif_qbuf()
906 buf1 = common->buffer_queue.bufs[tbuf.index]; in vpif_qbuf()
930 vpif_buffer_release(&common->buffer_queue, buf1); in vpif_qbuf()
940 ret = vpif_buffer_prepare(&common->buffer_queue, buf1, in vpif_qbuf()
941 common->buffer_queue.field); in vpif_qbuf()
949 common->next_frm = buf1; in vpif_qbuf()
951 common->set_addr((addr + common->ytop_off), in vpif_qbuf()
952 (addr + common->ybtm_off), in vpif_qbuf()
953 (addr + common->ctop_off), in vpif_qbuf()
954 (addr + common->cbtm_off)); in vpif_qbuf()
958 list_add_tail(&buf1->stream, &common->buffer_queue.stream); in vpif_qbuf()
959 mutex_unlock(&common->buffer_queue.vb_lock); in vpif_qbuf()
963 mutex_unlock(&common->buffer_queue.vb_lock); in vpif_qbuf()
971 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_s_std() local
977 if (common->started) { in vpif_s_std()
998 common->fmt.fmt.pix.bytesperline = common->fmt.fmt.pix.width; in vpif_s_std()
1029 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_dqbuf() local
1031 return videobuf_dqbuf(&common->buffer_queue, p, in vpif_dqbuf()
1040 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_streamon() local
1059 if (common->started) { in vpif_streamon()
1065 && oth_ch->common[VPIF_VIDEO_INDEX].started && in vpif_streamon()
1068 && (2 == oth_ch->common[VPIF_VIDEO_INDEX].started))) { in vpif_streamon()
1073 ret = vpif_check_format(ch, &common->fmt.fmt.pix); in vpif_streamon()
1078 ret = videobuf_streamon(&common->buffer_queue); in vpif_streamon()
1085 if (list_empty(&common->dma_queue)) { in vpif_streamon()
1091 common->next_frm = common->cur_frm = in vpif_streamon()
1092 list_entry(common->dma_queue.next, in vpif_streamon()
1095 list_del(&common->cur_frm->queue); in vpif_streamon()
1097 common->cur_frm->state = VIDEOBUF_ACTIVE; in vpif_streamon()
1101 common->started = 1; in vpif_streamon()
1103 addr = common->cur_frm->boff; in vpif_streamon()
1108 ((common->fmt.fmt.pix.field != V4L2_FIELD_NONE) in vpif_streamon()
1109 && (common->fmt.fmt.pix.field != V4L2_FIELD_ANY))) in vpif_streamon()
1111 && (common->fmt.fmt.pix.field == V4L2_FIELD_NONE))) { in vpif_streamon()
1130 common->started = ret; in vpif_streamon()
1132 common->set_addr((addr + common->ytop_off), in vpif_streamon()
1133 (addr + common->ybtm_off), in vpif_streamon()
1134 (addr + common->ctop_off), in vpif_streamon()
1135 (addr + common->cbtm_off)); in vpif_streamon()
1146 || (common->started == 2)) { in vpif_streamon()
1161 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_streamoff() local
1173 if (!common->started) { in vpif_streamoff()
1185 (2 == common->started)) { in vpif_streamoff()
1191 common->started = 0; in vpif_streamoff()
1192 return videobuf_streamoff(&common->buffer_queue); in vpif_streamoff()
1200 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_cropcap() local
1206 crop->defrect.height = crop->bounds.height = common->height; in vpif_cropcap()
1207 crop->defrect.width = crop->bounds.width = common->width; in vpif_cropcap()
1235 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_s_output() local
1238 if (common->started) { in vpif_s_output()
1310 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_s_dv_preset() local
1314 if (common->started) { in vpif_s_dv_preset()
1326 if (mutex_lock_interruptible(&common->lock)) in vpif_s_dv_preset()
1344 mutex_unlock(&common->lock); in vpif_s_dv_preset()
1687 struct common_obj *common; in vpif_probe() local
1754 ch->common[k].numbuffers = 0; in vpif_probe()
1755 common = &ch->common[k]; in vpif_probe()
1756 common->io_usrs = 0; in vpif_probe()
1757 common->started = 0; in vpif_probe()
1758 spin_lock_init(&common->irqlock); in vpif_probe()
1759 mutex_init(&common->lock); in vpif_probe()
1760 common->numbuffers = 0; in vpif_probe()
1761 common->set_addr = NULL; in vpif_probe()
1762 common->ytop_off = common->ybtm_off = 0; in vpif_probe()
1763 common->ctop_off = common->cbtm_off = 0; in vpif_probe()
1764 common->cur_frm = common->next_frm = NULL; in vpif_probe()
1765 memset(&common->fmt, 0, sizeof(common->fmt)); in vpif_probe()
1766 common->numbuffers = config_params.numbuffers[k]; in vpif_probe()
1772 ch->common[VPIF_VIDEO_INDEX].numbuffers = in vpif_probe()
1775 ch->common[VPIF_VIDEO_INDEX].numbuffers = 0; in vpif_probe()
1781 ch->common[VPIF_VIDEO_INDEX].fmt.type = in vpif_probe()
1783 ch->video_dev->lock = &common->lock; in vpif_probe()