Lines Matching refs:dma_q

85 	struct cx231xx_dmaqueue *dma_q = urb->context;  in cx231xx_isoc_vbi_copy()  local
110 if (dma_q->is_partial_line) { in cx231xx_isoc_vbi_copy()
113 sav_eav = dma_q->last_sav; in cx231xx_isoc_vbi_copy()
119 dma_q->partial_buf, in cx231xx_isoc_vbi_copy()
127 bytes_parsed += cx231xx_get_vbi_line(dev, dma_q, in cx231xx_isoc_vbi_copy()
134 dma_q->is_partial_line = 0; in cx231xx_isoc_vbi_copy()
149 dma_q, sav_eav, /* SAV/EAV */ in cx231xx_isoc_vbi_copy()
157 memcpy(dma_q->partial_buf, p_buffer + buffer_size - 4, 4); in cx231xx_isoc_vbi_copy()
304 struct cx231xx_dmaqueue *dma_q = urb->context; in cx231xx_irq_vbi_callback() local
306 container_of(dma_q, struct cx231xx_video_mode, vidq); in cx231xx_irq_vbi_callback()
390 struct cx231xx_dmaqueue *dma_q = &dev->vbi_mode.vidq; in cx231xx_init_vbi_isoc() local
408 dma_q->pos = 0; in cx231xx_init_vbi_isoc()
409 dma_q->is_partial_line = 0; in cx231xx_init_vbi_isoc()
410 dma_q->last_sav = 0; in cx231xx_init_vbi_isoc()
411 dma_q->current_field = -1; in cx231xx_init_vbi_isoc()
412 dma_q->bytes_left_in_line = dev->width << 1; in cx231xx_init_vbi_isoc()
413 dma_q->lines_per_field = ((dev->norm & V4L2_STD_625_50) ? in cx231xx_init_vbi_isoc()
415 dma_q->lines_completed = 0; in cx231xx_init_vbi_isoc()
417 dma_q->partial_buf[i] = 0; in cx231xx_init_vbi_isoc()
466 sb_size, cx231xx_irq_vbi_callback, dma_q); in cx231xx_init_vbi_isoc()
469 init_waitqueue_head(&dma_q->wq); in cx231xx_init_vbi_isoc()
488 u32 cx231xx_get_vbi_line(struct cx231xx *dev, struct cx231xx_dmaqueue *dma_q, in cx231xx_get_vbi_line() argument
510 dma_q->last_sav = sav_eav; in cx231xx_get_vbi_line()
513 cx231xx_copy_vbi_line(dev, dma_q, p_buffer, buffer_size, in cx231xx_get_vbi_line()
523 struct cx231xx_dmaqueue *dma_q, in vbi_buffer_filled() argument
539 u32 cx231xx_copy_vbi_line(struct cx231xx *dev, struct cx231xx_dmaqueue *dma_q, in cx231xx_copy_vbi_line() argument
546 if (dma_q->current_field == -1) { in cx231xx_copy_vbi_line()
548 cx231xx_reset_vbi_buffer(dev, dma_q); in cx231xx_copy_vbi_line()
551 if (dma_q->current_field != field_number) in cx231xx_copy_vbi_line()
552 dma_q->lines_completed = 0; in cx231xx_copy_vbi_line()
558 dma_q->current_field = field_number; in cx231xx_copy_vbi_line()
560 bytes_to_copy = dma_q->bytes_left_in_line; in cx231xx_copy_vbi_line()
564 if (dma_q->lines_completed >= dma_q->lines_per_field) { in cx231xx_copy_vbi_line()
565 dma_q->bytes_left_in_line -= bytes_to_copy; in cx231xx_copy_vbi_line()
566 dma_q->is_partial_line = in cx231xx_copy_vbi_line()
567 (dma_q->bytes_left_in_line == 0) ? 0 : 1; in cx231xx_copy_vbi_line()
571 dma_q->is_partial_line = 1; in cx231xx_copy_vbi_line()
576 dma_q->bytes_left_in_line -= bytes_to_copy; in cx231xx_copy_vbi_line()
577 dma_q->is_partial_line = in cx231xx_copy_vbi_line()
578 (dma_q->bytes_left_in_line == 0) ? 0 : 1; in cx231xx_copy_vbi_line()
583 cx231xx_do_vbi_copy(dev, dma_q, p_line, bytes_to_copy); in cx231xx_copy_vbi_line()
585 dma_q->pos += bytes_to_copy; in cx231xx_copy_vbi_line()
586 dma_q->bytes_left_in_line -= bytes_to_copy; in cx231xx_copy_vbi_line()
588 if (dma_q->bytes_left_in_line == 0) { in cx231xx_copy_vbi_line()
590 dma_q->bytes_left_in_line = _line_size; in cx231xx_copy_vbi_line()
591 dma_q->lines_completed++; in cx231xx_copy_vbi_line()
592 dma_q->is_partial_line = 0; in cx231xx_copy_vbi_line()
594 if (cx231xx_is_vbi_buffer_done(dev, dma_q) && buf) { in cx231xx_copy_vbi_line()
596 vbi_buffer_filled(dev, dma_q, buf); in cx231xx_copy_vbi_line()
598 dma_q->pos = 0; in cx231xx_copy_vbi_line()
599 dma_q->lines_completed = 0; in cx231xx_copy_vbi_line()
600 cx231xx_reset_vbi_buffer(dev, dma_q); in cx231xx_copy_vbi_line()
610 static inline void get_next_vbi_buf(struct cx231xx_dmaqueue *dma_q, in get_next_vbi_buf() argument
614 container_of(dma_q, struct cx231xx_video_mode, vidq); in get_next_vbi_buf()
618 if (list_empty(&dma_q->active)) { in get_next_vbi_buf()
626 *buf = list_entry(dma_q->active.next, struct cx231xx_buffer, vb.queue); in get_next_vbi_buf()
638 struct cx231xx_dmaqueue *dma_q) in cx231xx_reset_vbi_buffer() argument
646 get_next_vbi_buf(dma_q, &buf); in cx231xx_reset_vbi_buffer()
648 dma_q->pos = 0; in cx231xx_reset_vbi_buffer()
649 dma_q->current_field = -1; in cx231xx_reset_vbi_buffer()
652 dma_q->bytes_left_in_line = dev->width << 1; in cx231xx_reset_vbi_buffer()
653 dma_q->lines_completed = 0; in cx231xx_reset_vbi_buffer()
656 int cx231xx_do_vbi_copy(struct cx231xx *dev, struct cx231xx_dmaqueue *dma_q, in cx231xx_do_vbi_copy() argument
673 if (dma_q->bytes_left_in_line != _line_size) { in cx231xx_do_vbi_copy()
675 _line_size - dma_q->bytes_left_in_line; in cx231xx_do_vbi_copy()
678 offset = (dma_q->lines_completed * _line_size) + in cx231xx_do_vbi_copy()
681 if (dma_q->current_field == 2) { in cx231xx_do_vbi_copy()
683 offset += (dev->width * 2 * dma_q->lines_per_field); in cx231xx_do_vbi_copy()
689 lencopy = dma_q->bytes_left_in_line > bytes_to_copy ? in cx231xx_do_vbi_copy()
690 bytes_to_copy : dma_q->bytes_left_in_line; in cx231xx_do_vbi_copy()
698 struct cx231xx_dmaqueue *dma_q) in cx231xx_is_vbi_buffer_done() argument
704 if (dma_q->lines_completed == height && dma_q->current_field == 2) in cx231xx_is_vbi_buffer_done()