Lines Matching refs:dma_q

178 				 struct cx231xx_dmaqueue *dma_q,  in buffer_filled()  argument
237 static inline void get_next_buf(struct cx231xx_dmaqueue *dma_q, in get_next_buf() argument
241 container_of(dma_q, struct cx231xx_video_mode, vidq); in get_next_buf()
246 if (list_empty(&dma_q->active)) { in get_next_buf()
257 *buf = list_entry(dma_q->active.next, struct cx231xx_buffer, vb.queue); in get_next_buf()
276 struct cx231xx_dmaqueue *dma_q = urb->context; in cx231xx_isoc_copy() local
318 if (dma_q->is_partial_line) { in cx231xx_isoc_copy()
320 sav_eav = dma_q->last_sav; in cx231xx_isoc_copy()
326 dma_q->partial_buf, in cx231xx_isoc_copy()
334 bytes_parsed += cx231xx_get_video_line(dev, dma_q, in cx231xx_isoc_copy()
356 dma_q, sav_eav, /* SAV/EAV */ in cx231xx_isoc_copy()
364 memcpy(dma_q->partial_buf, p_buffer + buffer_size - 4, 4); in cx231xx_isoc_copy()
373 struct cx231xx_dmaqueue *dma_q = urb->context; in cx231xx_bulk_copy() local
397 if (dma_q->is_partial_line) { in cx231xx_bulk_copy()
399 sav_eav = dma_q->last_sav; in cx231xx_bulk_copy()
405 dma_q->partial_buf, in cx231xx_bulk_copy()
413 bytes_parsed += cx231xx_get_video_line(dev, dma_q, in cx231xx_bulk_copy()
435 dma_q, sav_eav, /* SAV/EAV */ in cx231xx_bulk_copy()
443 memcpy(dma_q->partial_buf, p_buffer + buffer_size - 4, 4); in cx231xx_bulk_copy()
510 struct cx231xx_dmaqueue *dma_q, u8 sav_eav, in cx231xx_get_video_line() argument
546 dma_q->last_sav = sav_eav; in cx231xx_get_video_line()
548 bytes_copied = cx231xx_copy_video_line(dev, dma_q, p_buffer, in cx231xx_get_video_line()
555 struct cx231xx_dmaqueue *dma_q, u8 *p_line, in cx231xx_copy_video_line() argument
562 if (dma_q->current_field != field_number) in cx231xx_copy_video_line()
563 cx231xx_reset_video_buffer(dev, dma_q); in cx231xx_copy_video_line()
572 dma_q->current_field = field_number; in cx231xx_copy_video_line()
574 bytes_to_copy = dma_q->bytes_left_in_line; in cx231xx_copy_video_line()
578 if (dma_q->lines_completed >= dma_q->lines_per_field) { in cx231xx_copy_video_line()
579 dma_q->bytes_left_in_line -= bytes_to_copy; in cx231xx_copy_video_line()
580 dma_q->is_partial_line = (dma_q->bytes_left_in_line == 0) ? in cx231xx_copy_video_line()
585 dma_q->is_partial_line = 1; in cx231xx_copy_video_line()
590 dma_q->bytes_left_in_line -= bytes_to_copy; in cx231xx_copy_video_line()
591 dma_q->is_partial_line = (dma_q->bytes_left_in_line == 0) in cx231xx_copy_video_line()
597 cx231xx_do_copy(dev, dma_q, p_line, bytes_to_copy); in cx231xx_copy_video_line()
599 dma_q->pos += bytes_to_copy; in cx231xx_copy_video_line()
600 dma_q->bytes_left_in_line -= bytes_to_copy; in cx231xx_copy_video_line()
602 if (dma_q->bytes_left_in_line == 0) { in cx231xx_copy_video_line()
603 dma_q->bytes_left_in_line = _line_size; in cx231xx_copy_video_line()
604 dma_q->lines_completed++; in cx231xx_copy_video_line()
605 dma_q->is_partial_line = 0; in cx231xx_copy_video_line()
607 if (cx231xx_is_buffer_done(dev, dma_q) && buf) { in cx231xx_copy_video_line()
608 buffer_filled(dev, dma_q, buf); in cx231xx_copy_video_line()
610 dma_q->pos = 0; in cx231xx_copy_video_line()
612 dma_q->lines_completed = 0; in cx231xx_copy_video_line()
620 struct cx231xx_dmaqueue *dma_q) in cx231xx_reset_video_buffer() argument
625 if (dma_q->current_field == 1) { in cx231xx_reset_video_buffer()
626 if (dma_q->lines_completed >= dma_q->lines_per_field) in cx231xx_reset_video_buffer()
627 dma_q->field1_done = 1; in cx231xx_reset_video_buffer()
629 dma_q->field1_done = 0; in cx231xx_reset_video_buffer()
639 get_next_buf(dma_q, &buf); in cx231xx_reset_video_buffer()
641 dma_q->pos = 0; in cx231xx_reset_video_buffer()
642 dma_q->field1_done = 0; in cx231xx_reset_video_buffer()
643 dma_q->current_field = -1; in cx231xx_reset_video_buffer()
647 dma_q->bytes_left_in_line = dev->width << 1; in cx231xx_reset_video_buffer()
648 dma_q->lines_completed = 0; in cx231xx_reset_video_buffer()
651 int cx231xx_do_copy(struct cx231xx *dev, struct cx231xx_dmaqueue *dma_q, in cx231xx_do_copy() argument
671 current_line_bytes_copied = _line_size - dma_q->bytes_left_in_line; in cx231xx_do_copy()
674 offset = (dma_q->current_field == 1) ? 0 : _line_size; in cx231xx_do_copy()
680 startwrite += (dma_q->lines_completed * _line_size * 2); in cx231xx_do_copy()
685 lencopy = dma_q->bytes_left_in_line > bytes_to_copy ? in cx231xx_do_copy()
686 bytes_to_copy : dma_q->bytes_left_in_line; in cx231xx_do_copy()
708 u8 cx231xx_is_buffer_done(struct cx231xx *dev, struct cx231xx_dmaqueue *dma_q) in cx231xx_is_buffer_done() argument
713 buffer_complete = ((dma_q->current_field == 2) && in cx231xx_is_buffer_done()
714 (dma_q->lines_completed >= dma_q->lines_per_field) && in cx231xx_is_buffer_done()
715 dma_q->field1_done); in cx231xx_is_buffer_done()