Lines Matching +full:isoc +full:- +full:in

1 // SPDX-License-Identifier: GPL-2.0+
3 * uvc_video.c -- USB Video Class Gadget driver
5 * Copyright (C) 2009-2010
17 #include <media/v4l2-dev.h>
24 /* --------------------------------------------------------------------------
33 struct usb_composite_dev *cdev = uvc->func.config->cdev; in uvc_video_encode_header()
34 struct timespec64 ts = ns_to_timespec64(buf->buf.vb2_buf.timestamp); in uvc_video_encode_header()
37 data[1] = UVC_STREAM_EOH | video->fid; in uvc_video_encode_header()
39 if (video->queue.flags & UVC_QUEUE_DROP_INCOMPLETE) in uvc_video_encode_header()
42 if (video->queue.buf_used == 0 && ts.tv_sec) { in uvc_video_encode_header()
51 if (cdev->gadget->ops->get_frame) { in uvc_video_encode_header()
54 sof = usb_gadget_frame_number(cdev->gadget); in uvc_video_encode_header()
66 if (buf->bytesused - video->queue.buf_used <= len - pos) in uvc_video_encode_header()
76 struct uvc_video_queue *queue = &video->queue; in uvc_video_encode_data()
81 mem = buf->mem + queue->buf_used; in uvc_video_encode_data()
82 nbytes = min_t(unsigned int, len, buf->bytesused - queue->buf_used); in uvc_video_encode_data()
85 queue->buf_used += nbytes; in uvc_video_encode_data()
94 void *mem = req->buf; in uvc_video_encode_bulk()
95 struct uvc_request *ureq = req->context; in uvc_video_encode_bulk()
96 int len = video->req_size; in uvc_video_encode_bulk()
100 if (video->payload_size == 0) { in uvc_video_encode_bulk()
102 video->payload_size += ret; in uvc_video_encode_bulk()
104 len -= ret; in uvc_video_encode_bulk()
108 len = min_t(int, video->max_payload_size - video->payload_size, len); in uvc_video_encode_bulk()
111 video->payload_size += ret; in uvc_video_encode_bulk()
112 len -= ret; in uvc_video_encode_bulk()
114 req->length = video->req_size - len; in uvc_video_encode_bulk()
115 req->zero = video->payload_size == video->max_payload_size; in uvc_video_encode_bulk()
117 if (buf->bytesused == video->queue.buf_used) { in uvc_video_encode_bulk()
118 video->queue.buf_used = 0; in uvc_video_encode_bulk()
119 buf->state = UVC_BUF_STATE_DONE; in uvc_video_encode_bulk()
120 list_del(&buf->queue); in uvc_video_encode_bulk()
121 video->fid ^= UVC_STREAM_FID; in uvc_video_encode_bulk()
122 ureq->last_buf = buf; in uvc_video_encode_bulk()
124 video->payload_size = 0; in uvc_video_encode_bulk()
127 if (video->payload_size == video->max_payload_size || in uvc_video_encode_bulk()
128 video->queue.flags & UVC_QUEUE_DROP_INCOMPLETE || in uvc_video_encode_bulk()
129 buf->bytesused == video->queue.buf_used) in uvc_video_encode_bulk()
130 video->payload_size = 0; in uvc_video_encode_bulk()
137 unsigned int pending = buf->bytesused - video->queue.buf_used; in uvc_video_encode_isoc_sg()
138 struct uvc_request *ureq = req->context; in uvc_video_encode_isoc_sg()
140 unsigned int len = buf->req_payload_size; in uvc_video_encode_isoc_sg()
145 sg = ureq->sgt.sgl; in uvc_video_encode_isoc_sg()
146 sg_init_table(sg, ureq->sgt.nents); in uvc_video_encode_isoc_sg()
149 header_len = uvc_video_encode_header(video, buf, ureq->header, in uvc_video_encode_isoc_sg()
150 buf->req_payload_size); in uvc_video_encode_isoc_sg()
151 sg_set_buf(sg, ureq->header, header_len); in uvc_video_encode_isoc_sg()
152 len -= header_len; in uvc_video_encode_isoc_sg()
157 req->length = (len == pending) ? len + header_len : in uvc_video_encode_isoc_sg()
158 buf->req_payload_size; in uvc_video_encode_isoc_sg()
163 for_each_sg(sg, iter, ureq->sgt.nents - 1, i) { in uvc_video_encode_isoc_sg()
164 if (!len || !buf->sg || !buf->sg->length) in uvc_video_encode_isoc_sg()
167 sg_left = buf->sg->length - buf->offset; in uvc_video_encode_isoc_sg()
170 sg_set_page(iter, sg_page(buf->sg), part, buf->offset); in uvc_video_encode_isoc_sg()
173 buf->offset = 0; in uvc_video_encode_isoc_sg()
174 buf->sg = sg_next(buf->sg); in uvc_video_encode_isoc_sg()
176 buf->offset += part; in uvc_video_encode_isoc_sg()
178 len -= part; in uvc_video_encode_isoc_sg()
182 req->buf = NULL; in uvc_video_encode_isoc_sg()
183 req->sg = ureq->sgt.sgl; in uvc_video_encode_isoc_sg()
184 req->num_sgs = i + 1; in uvc_video_encode_isoc_sg()
186 req->length -= len; in uvc_video_encode_isoc_sg()
187 video->queue.buf_used += req->length - header_len; in uvc_video_encode_isoc_sg()
189 if (buf->bytesused == video->queue.buf_used || !buf->sg || in uvc_video_encode_isoc_sg()
190 video->queue.flags & UVC_QUEUE_DROP_INCOMPLETE) { in uvc_video_encode_isoc_sg()
191 video->queue.buf_used = 0; in uvc_video_encode_isoc_sg()
192 buf->state = UVC_BUF_STATE_DONE; in uvc_video_encode_isoc_sg()
193 buf->offset = 0; in uvc_video_encode_isoc_sg()
194 list_del(&buf->queue); in uvc_video_encode_isoc_sg()
195 video->fid ^= UVC_STREAM_FID; in uvc_video_encode_isoc_sg()
196 ureq->last_buf = buf; in uvc_video_encode_isoc_sg()
204 void *mem = req->buf; in uvc_video_encode_isoc()
205 struct uvc_request *ureq = req->context; in uvc_video_encode_isoc()
206 int len = buf->req_payload_size; in uvc_video_encode_isoc()
212 len -= ret; in uvc_video_encode_isoc()
216 len -= ret; in uvc_video_encode_isoc()
218 req->length = buf->req_payload_size - len; in uvc_video_encode_isoc()
220 if (buf->bytesused == video->queue.buf_used || in uvc_video_encode_isoc()
221 video->queue.flags & UVC_QUEUE_DROP_INCOMPLETE) { in uvc_video_encode_isoc()
222 video->queue.buf_used = 0; in uvc_video_encode_isoc()
223 buf->state = UVC_BUF_STATE_DONE; in uvc_video_encode_isoc()
224 list_del(&buf->queue); in uvc_video_encode_isoc()
225 video->fid ^= UVC_STREAM_FID; in uvc_video_encode_isoc()
226 ureq->last_buf = buf; in uvc_video_encode_isoc()
230 /* --------------------------------------------------------------------------
241 sg_free_table(&ureq->sgt); in uvc_video_free_request()
242 if (ureq->req && ep) { in uvc_video_free_request()
243 usb_ep_free_request(ep, ureq->req); in uvc_video_free_request()
244 ureq->req = NULL; in uvc_video_free_request()
247 kfree(ureq->req_buffer); in uvc_video_free_request()
248 ureq->req_buffer = NULL; in uvc_video_free_request()
250 if (!list_empty(&ureq->list)) in uvc_video_free_request()
251 list_del_init(&ureq->list); in uvc_video_free_request()
260 ret = usb_ep_queue(video->ep, req, GFP_ATOMIC); in uvcg_video_ep_queue()
262 uvcg_err(&video->uvc->func, "Failed to queue request (%d).\n", in uvcg_video_ep_queue()
266 if (video->ep->desc) { in uvcg_video_ep_queue()
268 if (usb_endpoint_xfer_bulk(video->ep->desc)) in uvcg_video_ep_queue()
269 usb_ep_set_halt(video->ep); in uvcg_video_ep_queue()
273 atomic_inc(&video->queued); in uvcg_video_ep_queue()
275 trace_uvcg_video_queue(req, atomic_read(&video->queued)); in uvcg_video_ep_queue()
280 /* This function must be called with video->req_lock held. */
284 bool is_bulk = video->max_payload_size; in uvcg_video_usb_req_queue()
287 if (!video->is_enabled) in uvcg_video_usb_req_queue()
288 return -ENODEV; in uvcg_video_usb_req_queue()
291 struct uvc_request *ureq = req->context; in uvcg_video_usb_req_queue()
297 * - When no more requests are available in the free queue, as in uvcg_video_usb_req_queue()
301 * - When this is request is the last request for the video in uvcg_video_usb_req_queue()
303 * ASAP in case it doesn't get started already in the next in uvcg_video_usb_req_queue()
306 * - Four times over the length of the requests queue (as in uvcg_video_usb_req_queue()
307 * indicated by video->uvc_num_requests), as a trade-off in uvcg_video_usb_req_queue()
310 if (list_empty(&video->req_free) || ureq->last_buf || in uvcg_video_usb_req_queue()
311 !(video->req_int_count % in uvcg_video_usb_req_queue()
312 min(DIV_ROUND_UP(video->uvc_num_requests, 4), UVCG_REQ_MAX_INT_COUNT))) { in uvcg_video_usb_req_queue()
313 video->req_int_count = 0; in uvcg_video_usb_req_queue()
314 req->no_interrupt = 0; in uvcg_video_usb_req_queue()
316 req->no_interrupt = 1; in uvcg_video_usb_req_queue()
318 video->req_int_count++; in uvcg_video_usb_req_queue()
322 * If we're not queuing to the ep, for isoc we're queuing in uvcg_video_usb_req_queue()
325 list = is_bulk ? &video->req_free : &video->req_ready; in uvcg_video_usb_req_queue()
326 list_add_tail(&req->list, list); in uvcg_video_usb_req_queue()
333 struct uvc_request *ureq = req->context; in uvc_video_complete()
334 struct uvc_video *video = ureq->video; in uvc_video_complete()
335 struct uvc_video_queue *queue = &video->queue; in uvc_video_complete()
339 spin_lock_irqsave(&video->req_lock, flags); in uvc_video_complete()
340 atomic_dec(&video->queued); in uvc_video_complete()
341 if (!video->is_enabled) { in uvc_video_complete()
344 * that in-flight uvc_buffers are returned, so we can in uvc_video_complete()
349 spin_unlock_irqrestore(&video->req_lock, flags); in uvc_video_complete()
353 last_buf = ureq->last_buf; in uvc_video_complete()
354 ureq->last_buf = NULL; in uvc_video_complete()
355 spin_unlock_irqrestore(&video->req_lock, flags); in uvc_video_complete()
357 switch (req->status) { in uvc_video_complete()
361 case -EXDEV: in uvc_video_complete()
362 uvcg_dbg(&video->uvc->func, "VS request missed xfer.\n"); in uvc_video_complete()
363 if (req->length != 0) in uvc_video_complete()
364 queue->flags |= UVC_QUEUE_DROP_INCOMPLETE; in uvc_video_complete()
367 case -ESHUTDOWN: /* disconnect from host. */ in uvc_video_complete()
368 uvcg_dbg(&video->uvc->func, "VS request cancelled.\n"); in uvc_video_complete()
373 uvcg_warn(&video->uvc->func, in uvc_video_complete()
375 req->status); in uvc_video_complete()
380 spin_lock_irqsave(&queue->irqlock, flags); in uvc_video_complete()
382 spin_unlock_irqrestore(&queue->irqlock, flags); in uvc_video_complete()
385 spin_lock_irqsave(&video->req_lock, flags); in uvc_video_complete()
392 if (!video->is_enabled) { in uvc_video_complete()
394 spin_unlock_irqrestore(&video->req_lock, flags); in uvc_video_complete()
400 list_add_tail(&req->list, &video->req_free); in uvc_video_complete()
404 * in-flight usb requests for whih the complete callbacks are in uvc_video_complete()
406 * In that case, if we do not queue work to the worker thread, in uvc_video_complete()
407 * the buffer will never be marked as complete - and therefore in uvc_video_complete()
409 * dequeue -> queue -> dequeue flow of uvc buffers will not in uvc_video_complete()
412 queue_work(video->async_wq, &video->pump); in uvc_video_complete()
414 trace_uvcg_video_complete(req, atomic_read(&video->queued)); in uvc_video_complete()
416 spin_unlock_irqrestore(&video->req_lock, flags); in uvc_video_complete()
418 kthread_queue_work(video->kworker, &video->hw_submit); in uvc_video_complete()
424 bool is_bulk = video->max_payload_size; in uvcg_video_hw_submit()
430 if (!video->ep->enabled) in uvcg_video_hw_submit()
432 spin_lock_irqsave(&video->req_lock, flags); in uvcg_video_hw_submit()
434 * Here we check whether any request is available in the ready in uvcg_video_hw_submit()
436 * usb_request to the req_free list - for video_pump to fill in. in uvcg_video_hw_submit()
443 if (!list_empty(&video->req_ready)) { in uvcg_video_hw_submit()
444 req = list_first_entry(&video->req_ready, in uvcg_video_hw_submit()
447 if (list_empty(&video->req_free) || in uvcg_video_hw_submit()
448 (atomic_read(&video->queued) > UVCG_REQ_MAX_ZERO_COUNT)) { in uvcg_video_hw_submit()
449 spin_unlock_irqrestore(&video->req_lock, flags); in uvcg_video_hw_submit()
453 req = list_first_entry(&video->req_free, struct usb_request, in uvcg_video_hw_submit()
455 req->length = 0; in uvcg_video_hw_submit()
457 list_del(&req->list); in uvcg_video_hw_submit()
461 * only happen on one thread - the async_wq for bulk endpoints in uvcg_video_hw_submit()
462 * and this thread for isoc endpoints. in uvcg_video_hw_submit()
468 * Put request back in req_free for it to be cleaned in uvcg_video_hw_submit()
471 list_add_tail(&req->list, &video->req_free); in uvcg_video_hw_submit()
473 * There is a new free request - wake up the pump. in uvcg_video_hw_submit()
475 queue_work(video->async_wq, &video->pump); in uvcg_video_hw_submit()
479 spin_unlock_irqrestore(&video->req_lock, flags); in uvcg_video_hw_submit()
488 list_for_each_entry_safe(ureq, temp, &video->ureqs, list) in uvc_video_free_requests()
489 uvc_video_free_request(ureq, video->ep); in uvc_video_free_requests()
491 INIT_LIST_HEAD(&video->ureqs); in uvc_video_free_requests()
492 INIT_LIST_HEAD(&video->req_free); in uvc_video_free_requests()
493 INIT_LIST_HEAD(&video->req_ready); in uvc_video_free_requests()
501 struct usb_composite_dev *cdev = uvc->func.config->cdev; in uvc_video_prep_requests()
502 unsigned int interval_duration = video->ep->desc->bInterval * 1250; in uvc_video_prep_requests()
506 max_req_size = video->ep->maxpacket in uvc_video_prep_requests()
507 * max_t(unsigned int, video->ep->maxburst, 1) in uvc_video_prep_requests()
508 * (video->ep->mult); in uvc_video_prep_requests()
510 if (!usb_endpoint_xfer_isoc(video->ep->desc)) { in uvc_video_prep_requests()
511 video->req_size = max_req_size; in uvc_video_prep_requests()
512 video->reqs_per_frame = video->uvc_num_requests = in uvc_video_prep_requests()
513 DIV_ROUND_UP(video->imagesize, max_req_size); in uvc_video_prep_requests()
518 if (cdev->gadget->speed < USB_SPEED_HIGH) in uvc_video_prep_requests()
519 interval_duration = video->ep->desc->bInterval * 10000; in uvc_video_prep_requests()
521 nreq = DIV_ROUND_UP(video->interval, interval_duration); in uvc_video_prep_requests()
525 req_size = DIV_ROUND_UP(video->imagesize + header_size, nreq); in uvc_video_prep_requests()
530 * isoc bandwidth. Fallback to the maximum. in uvc_video_prep_requests()
534 video->req_size = req_size; in uvc_video_prep_requests()
542 video->uvc_num_requests = nreq + UVCG_REQ_MAX_ZERO_COUNT; in uvc_video_prep_requests()
543 video->reqs_per_frame = nreq; in uvc_video_prep_requests()
551 int ret = -ENOMEM; in uvc_video_alloc_requests()
554 * calculate in uvc_video_prep_requests in uvc_video_alloc_requests()
555 * - video->uvc_num_requests in uvc_video_alloc_requests()
556 * - video->req_size in uvc_video_alloc_requests()
560 for (i = 0; i < video->uvc_num_requests; i++) { in uvc_video_alloc_requests()
565 INIT_LIST_HEAD(&ureq->list); in uvc_video_alloc_requests()
567 list_add_tail(&ureq->list, &video->ureqs); in uvc_video_alloc_requests()
569 ureq->req_buffer = kmalloc(video->req_size, GFP_KERNEL); in uvc_video_alloc_requests()
570 if (ureq->req_buffer == NULL) in uvc_video_alloc_requests()
573 ureq->req = usb_ep_alloc_request(video->ep, GFP_KERNEL); in uvc_video_alloc_requests()
574 if (ureq->req == NULL) in uvc_video_alloc_requests()
577 ureq->req->buf = ureq->req_buffer; in uvc_video_alloc_requests()
578 ureq->req->length = 0; in uvc_video_alloc_requests()
579 ureq->req->complete = uvc_video_complete; in uvc_video_alloc_requests()
580 ureq->req->context = ureq; in uvc_video_alloc_requests()
581 ureq->video = video; in uvc_video_alloc_requests()
582 ureq->last_buf = NULL; in uvc_video_alloc_requests()
584 list_add_tail(&ureq->req->list, &video->req_free); in uvc_video_alloc_requests()
586 sg_alloc_table(&ureq->sgt, in uvc_video_alloc_requests()
587 DIV_ROUND_UP(video->req_size - UVCG_REQUEST_HEADER_LEN, in uvc_video_alloc_requests()
598 /* --------------------------------------------------------------------------
603 * uvcg_video_pump - Pump video data into the USB requests
605 * This function fills the available USB requests (listed in req_free) with
611 struct uvc_video_queue *queue = &video->queue; in uvcg_video_pump()
612 /* video->max_payload_size is only set when using bulk transfer */ in uvcg_video_pump()
613 bool is_bulk = video->max_payload_size; in uvcg_video_pump()
620 if (!video->ep->enabled) in uvcg_video_pump()
627 spin_lock_irqsave(&video->req_lock, flags); in uvcg_video_pump()
628 if (!video->is_enabled || list_empty(&video->req_free)) { in uvcg_video_pump()
629 spin_unlock_irqrestore(&video->req_lock, flags); in uvcg_video_pump()
632 req = list_first_entry(&video->req_free, struct usb_request, in uvcg_video_pump()
634 list_del(&req->list); in uvcg_video_pump()
635 spin_unlock_irqrestore(&video->req_lock, flags); in uvcg_video_pump()
641 spin_lock_irqsave(&queue->irqlock, flags); in uvcg_video_pump()
649 spin_unlock_irqrestore(&queue->irqlock, flags); in uvcg_video_pump()
653 video->encode(req, video, buf); in uvcg_video_pump()
655 spin_unlock_irqrestore(&queue->irqlock, flags); in uvcg_video_pump()
657 spin_lock_irqsave(&video->req_lock, flags); in uvcg_video_pump()
660 * to be ready, in the uvcg_video_complete() handler. in uvcg_video_pump()
661 * For isoc endpoints we add the request to the ready list in uvcg_video_pump()
665 spin_unlock_irqrestore(&video->req_lock, flags); in uvcg_video_pump()
672 spin_lock_irqsave(&video->req_lock, flags); in uvcg_video_pump()
673 if (video->is_enabled) in uvcg_video_pump()
674 list_add_tail(&req->list, &video->req_free); in uvcg_video_pump()
676 uvc_video_free_request(req->context, video->ep); in uvcg_video_pump()
677 spin_unlock_irqrestore(&video->req_lock, flags); in uvcg_video_pump()
692 if (video->ep == NULL) { in uvcg_video_disable()
693 uvcg_info(&video->uvc->func, in uvcg_video_disable()
695 return -ENODEV; in uvcg_video_disable()
699 spin_lock_irqsave(&video->req_lock, flags); in uvcg_video_disable()
700 video->is_enabled = false; in uvcg_video_disable()
703 * Remove any in-flight buffers from the uvc_requests in uvcg_video_disable()
709 list_for_each_entry(ureq, &video->ureqs, list) { in uvcg_video_disable()
710 if (ureq->last_buf) { in uvcg_video_disable()
711 list_add_tail(&ureq->last_buf->queue, &inflight_bufs); in uvcg_video_disable()
712 ureq->last_buf = NULL; in uvcg_video_disable()
715 spin_unlock_irqrestore(&video->req_lock, flags); in uvcg_video_disable()
717 cancel_work_sync(&video->pump); in uvcg_video_disable()
718 uvcg_queue_cancel(&video->queue, 0); in uvcg_video_disable()
720 spin_lock_irqsave(&video->req_lock, flags); in uvcg_video_disable()
727 list_for_each_entry_safe(ureq, utemp, &video->ureqs, list) in uvcg_video_disable()
728 list_del_init(&ureq->list); in uvcg_video_disable()
730 list_for_each_entry_safe(req, temp, &video->req_free, list) { in uvcg_video_disable()
731 list_del(&req->list); in uvcg_video_disable()
732 uvc_video_free_request(req->context, video->ep); in uvcg_video_disable()
735 list_for_each_entry_safe(req, temp, &video->req_ready, list) { in uvcg_video_disable()
736 list_del(&req->list); in uvcg_video_disable()
737 uvc_video_free_request(req->context, video->ep); in uvcg_video_disable()
740 INIT_LIST_HEAD(&video->ureqs); in uvcg_video_disable()
741 INIT_LIST_HEAD(&video->req_free); in uvcg_video_disable()
742 INIT_LIST_HEAD(&video->req_ready); in uvcg_video_disable()
743 spin_unlock_irqrestore(&video->req_lock, flags); in uvcg_video_disable()
748 spin_lock_irqsave(&video->queue.irqlock, flags); in uvcg_video_disable()
750 list_del(&buf->queue); in uvcg_video_disable()
751 uvcg_complete_buffer(&video->queue, buf); in uvcg_video_disable()
753 spin_unlock_irqrestore(&video->queue.irqlock, flags); in uvcg_video_disable()
755 uvcg_queue_enable(&video->queue, 0); in uvcg_video_disable()
766 if (video->ep == NULL) { in uvcg_video_enable()
767 uvcg_info(&video->uvc->func, in uvcg_video_enable()
769 return -ENODEV; in uvcg_video_enable()
778 video->is_enabled = true; in uvcg_video_enable()
780 if ((ret = uvcg_queue_enable(&video->queue, 1)) < 0) in uvcg_video_enable()
786 if (video->max_payload_size) { in uvcg_video_enable()
787 video->encode = uvc_video_encode_bulk; in uvcg_video_enable()
788 video->payload_size = 0; in uvcg_video_enable()
790 video->encode = video->queue.use_sg ? in uvcg_video_enable()
793 video->req_int_count = 0; in uvcg_video_enable()
795 atomic_set(&video->queued, 0); in uvcg_video_enable()
797 kthread_queue_work(video->kworker, &video->hw_submit); in uvcg_video_enable()
798 queue_work(video->async_wq, &video->pump); in uvcg_video_enable()
808 video->is_enabled = false; in uvcg_video_init()
809 INIT_LIST_HEAD(&video->ureqs); in uvcg_video_init()
810 INIT_LIST_HEAD(&video->req_free); in uvcg_video_init()
811 INIT_LIST_HEAD(&video->req_ready); in uvcg_video_init()
812 spin_lock_init(&video->req_lock); in uvcg_video_init()
813 INIT_WORK(&video->pump, uvcg_video_pump); in uvcg_video_init()
816 video->async_wq = alloc_workqueue("uvcgadget", WQ_UNBOUND | WQ_HIGHPRI, 0); in uvcg_video_init()
817 if (!video->async_wq) in uvcg_video_init()
818 return -EINVAL; in uvcg_video_init()
821 video->kworker = kthread_run_worker(0, "UVCG"); in uvcg_video_init()
822 if (IS_ERR(video->kworker)) { in uvcg_video_init()
823 uvcg_err(&video->uvc->func, "failed to create UVCG kworker\n"); in uvcg_video_init()
824 return PTR_ERR(video->kworker); in uvcg_video_init()
827 kthread_init_work(&video->hw_submit, uvcg_video_hw_submit); in uvcg_video_init()
829 sched_set_fifo(video->kworker->task); in uvcg_video_init()
831 video->uvc = uvc; in uvcg_video_init()
832 video->fcc = V4L2_PIX_FMT_YUYV; in uvcg_video_init()
833 video->bpp = 16; in uvcg_video_init()
834 video->width = 320; in uvcg_video_init()
835 video->height = 240; in uvcg_video_init()
836 video->imagesize = 320 * 240 * 2; in uvcg_video_init()
837 video->interval = 666666; in uvcg_video_init()
840 uvcg_queue_init(&video->queue, uvc->v4l2_dev.dev->parent, in uvcg_video_init()
841 V4L2_BUF_TYPE_VIDEO_OUTPUT, &video->mutex); in uvcg_video_init()