Received: by 10.223.148.5 with SMTP id 5csp6884240wrq; Wed, 17 Jan 2018 21:01:13 -0800 (PST) X-Google-Smtp-Source: ACJfBovEChwhdR4e8J68IXQa4G6m6If1HRaSKsn/mPYuCjObWjdqn0RK9K/1gMAsl34UPA9eyFFF X-Received: by 10.159.253.71 with SMTP id b7mr24214549plx.300.1516251673673; Wed, 17 Jan 2018 21:01:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516251673; cv=none; d=google.com; s=arc-20160816; b=A2/k/jCiUg5nKlpLlTPsFmajmIC3Kymu9jGFNodJilCPjBuO3E8Iuh4vQk+GGB580u wJFhdAKdOLDr/Y8FypyrBlCG02L4Uj5rH1qtVIktkMgvvi7rcGdEhM4Y8EuDgFIl2Qu1 SLVaJnvVwavtvRU4ruTpHZbaKie98Tscp+y4mPXh3XXDGey0UAXOM7uXMyXRj8ZU4vfL obrGtAnS2iXqGMz2KFjdq7vjJJ76VKGbZRqaKJQJyCnzzLJVvuJCCX24j/PciwgU7L5J v240QGtw65b49QciPODguk6Lw6DCus4Crpze03accFB/phOVeETBWfeezrvyrNNR9Bsi v/+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=D/m3m9d+19B119/QGdnu9jgGfErP+uiryCoyz1I8qvw=; b=FWDb7Tgxc/23slqCMWkbmBe5WS/i5c1jRad7RAiqv83el8T8CTpyx/1A5TJp8ZZjgo bs5mMgJbg7wolsBlg8Sn81PcxVJJfeZufM/yjpCAFwUH0BFu2+iYMHpGmvzdCvIhse1V 22Uh6YXFuoERqvw28eV4MVUAoLrM4HCLUeZMT5Eu//nyHxrJDteECwj/R19b3KNzfkVX 48K7lFnWYxMSwQGY0rGMxmhbh5bTMX/110rFhaJMGk4wK6GDhrMHeiunIrgDQBRwc3gd 61dcG2LoBAgpS/8bZ0hxjTOyppG0ISVOJe20FTYamxHojqJwQuj8Ig5NJbMuTBXhwt0a MUNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=FJ++mlAq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a10si6303024pln.370.2018.01.17.21.00.49; Wed, 17 Jan 2018 21:01:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=FJ++mlAq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750972AbeARFAN (ORCPT + 99 others); Thu, 18 Jan 2018 00:00:13 -0500 Received: from merlin.infradead.org ([205.233.59.134]:41906 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750724AbeARFAM (ORCPT ); Thu, 18 Jan 2018 00:00:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=D/m3m9d+19B119/QGdnu9jgGfErP+uiryCoyz1I8qvw=; b=FJ++mlAqgXZn3PZBcpVEuqJkvu I3GpVer0ncHCFeKTuDW/ZPRNmi9VX50vZgiZ3hbO2iMJMYmpX5n6E4l05btMIcw0HVcKiKK6wzryd whTu21tL2SjIUh9KpQ960sJbRPYAJ+LJ/Fmi9E1FDvHdBsHTV1mBqI6LYuBaVxT4NPyik78kmxGOl oVV82l0jTnz9+zPuDdk8vZkAuiUvaefmAb8VHIppLT5RKu6ATQKWJU3KpihULKo00H3n4Wuz3W4fx 8zAQMNA7l+sVJv3o3vz7JJElM5ZZmwB47XqDYhLjs0qavERNUtrBx4ANpzVWjCJ8muIpHzHJlWhz7 +VbIaeTQ==; Received: from static-50-53-52-16.bvtn.or.frontiernet.net ([50.53.52.16] helo=dragon.site) by merlin.infradead.org with esmtpsa (Exim 4.89 #1 (Red Hat Linux)) id 1ec2Iu-0006OR-57; Thu, 18 Jan 2018 04:59:56 +0000 Subject: Re: [RFT PATCH v3 0/6] Asynchronous UVC To: Kieran Bingham , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Guennadi Liakhovetski , Laurent Pinchart , Olivier BRAUN , Troy Kisky References: From: Randy Dunlap Message-ID: Date: Wed, 17 Jan 2018 20:59:54 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/12/2018 01:19 AM, Kieran Bingham wrote: > 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 Hi, Tested on x86_64, Linux 4.15-rc8 + these 9 patches, with 3 UVC webcams. 1. usb 1-1.3: Product: Dynex 1.3MP Webcam usb 1-1.3: Manufacturer: Dynex uvcvideo: Found UVC 1.00 device Dynex 1.3MP Webcam (19ff:0102) 2. uvcvideo: Found UVC 1.00 device 2SF001 (0bda:58f5) (builtin on Toshiba laptop) 3. usb 1-1.3: New USB device found, idVendor=0c45, idProduct=62c0 usb 1-1.3: New USB device strings: Mfr=2, Product=1, SerialNumber=3 usb 1-1.3: Product: USB 2.0 Camera usb 1-1.3: Manufacturer: Sonix Technology Co., Ltd. usb 1-1.3: SerialNumber: SN0001 uvcvideo: Found UVC 1.00 device USB 2.0 Camera (0c45:62c0) BTW, qv4l2 was very useful for this. Thanks, Hans. Tested-by: Randy Dunlap -- ~Randy