Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933425AbeALJUK (ORCPT + 1 other); Fri, 12 Jan 2018 04:20:10 -0500 Received: from o1682455182.outbound-mail.sendgrid.net ([168.245.5.182]:37900 "EHLO o1682455182.outbound-mail.sendgrid.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933113AbeALJUB (ORCPT ); Fri, 12 Jan 2018 04:20:01 -0500 From: Kieran Bingham To: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Guennadi Liakhovetski , Laurent Pinchart , Olivier BRAUN , Troy Kisky , Kieran Bingham Subject: [RFT PATCH v3 0/6] Asynchronous UVC Date: Fri, 12 Jan 2018 09:19:25 +0000 (UTC) Message-Id: X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 content-transfer-encoding: 8BIT X-SG-EID: UsLXQ589HNP4HLBydmD9pgHURQozLYm9XliudupI8YsSdLq8fz6KpEhfPL4xbhVrKzYD+ENt51//Tm 3HPuXe7UiJ+UlSBj/1wJaxtZHW5NFqsPjXu9UyGZf0tE+V+q4pseLeWmBXRNjPREvFtL2b2JA8Kirq hYt5wMtFt2++fCNETD5XO8/16YYxCwS2B6LqecivrDkcwO4VwvWV+8QWSQ20Y3pVOsVUcPrdkk/rAt Ex7rULetcCsQSdiU80k7Gv Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: The Linux UVC driver has long provided adequate performance capabilities for web-cams and low data rate video devices in Linux while resolutions were low. Modern USB cameras are now capable of high data rates thanks to USB3 with 1080p, and even 4k capture resolutions supported. Cameras such as the Stereolabs ZED (bulk transfers) or the Logitech BRIO (isochronous transfers) can generate more data than an embedded ARM core is able to process on a single core, resulting in frame loss. A large part of this performance impact is from the requirement to ‘memcpy’ frames out from URB packets to destination frames. This unfortunate requirement is due to the UVC protocol allowing a variable length header, and thus it is not possible to provide the target frame buffers directly. Extra throughput is possible by moving the actual memcpy actions to a work queue, and moving the memcpy out of interrupt context thus allowing work tasks to be scheduled across multiple cores. This series has been tested on both the ZED and BRIO cameras on arm64 platforms, however due to the intrinsic changes in the driver I would like to see it tested with other devices and other platforms, so I'd appreciate if anyone can test this on a range of USB cameras. In particular, any iSight devices, or devices which use UVC to encode data (output device) would certainly be great to be tested with these patches. v2: - Fix race reported by Guennadi v3: - Fix similar race reported by Laurent - Only queue work if required (encode/isight do not queue work) - Refactor/Rename variables for clarity Kieran Bingham (6): uvcvideo: Refactor URB descriptors uvcvideo: Convert decode functions to use new context structure uvcvideo: Protect queue internals with helper uvcvideo: queue: Simplify spin-lock usage uvcvideo: queue: Support asynchronous buffer handling uvcvideo: Move decode processing to process context drivers/media/usb/uvc/uvc_isight.c | 4 +- drivers/media/usb/uvc/uvc_queue.c | 114 +++++++++++++---- drivers/media/usb/uvc/uvc_video.c | 198 ++++++++++++++++++++++-------- drivers/media/usb/uvc/uvcvideo.h | 56 +++++++- 4 files changed, 296 insertions(+), 76 deletions(-) base-commit: 6f0e5fd39143a59c22d60e7befc4f33f22aeed2f -- git-series 0.9.1