@@ -101,6 +101,8 @@ struct uvc_video {
struct list_head req_free;
spinlock_t req_lock;
+ unsigned int req_int_count;
+
void (*encode) (struct usb_request *req, struct uvc_video *video,
struct uvc_buffer *buf);
@@ -362,6 +362,19 @@ static void uvcg_video_pump(struct work_struct *work)
video->encode(req, video, buf);
+ /* With usb3 we have more requests. This will decrease the
+ * interrupt load to a quarter but also catches the corner
+ * cases, which needs to be handled */
+ if (list_empty(&video->req_free) ||
+ buf->state == UVC_BUF_STATE_DONE ||
+ !(video->req_int_count %
+ DIV_ROUND_UP(video->uvc_num_requests, 4))) {
+ video->req_int_count = 0;
+ req->no_interrupt = 0;
+ } else {
+ req->no_interrupt = 1;
+ }
+
/* Queue the USB request */
ret = uvcg_video_ep_queue(video, req);
spin_unlock_irqrestore(&queue->irqlock, flags);
@@ -370,6 +383,7 @@ static void uvcg_video_pump(struct work_struct *work)
uvcg_queue_cancel(queue, 0);
break;
}
+ video->req_int_count++;
}
spin_lock_irqsave(&video->req_lock, flags);
@@ -418,6 +432,8 @@ int uvcg_video_enable(struct uvc_video *video, int enable)
video->encode = video->queue.use_sg ?
uvc_video_encode_isoc_sg : uvc_video_encode_isoc;
+ video->req_int_count = 0;
+
schedule_work(&video->pump);
return ret;