Received: by 2002:ab2:687:0:b0:1f4:6588:b3a7 with SMTP id s7csp56650lqe; Tue, 9 Apr 2024 14:25:17 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXvINkw6CjLjZz0RGAm5KC65ubDm1m43b+EX7XEuYF1DRN6Bg4blo13gJG2yXPFTOnL9vKlFvm5Q3KlFCbGVUJdvrN9yHlvxmoIR3kGHg== X-Google-Smtp-Source: AGHT+IFHi8n/o/fWMnZm3e5FG4tcfNKSe5dBrMSbAZkV70huikk7pVT0u8eIwV4VzxROisp3kHRN X-Received: by 2002:a50:9b58:0:b0:56e:2181:da0d with SMTP id a24-20020a509b58000000b0056e2181da0dmr554871edj.29.1712697917282; Tue, 09 Apr 2024 14:25:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712697917; cv=pass; d=google.com; s=arc-20160816; b=vyBZ/4HL/G5lcXb3oS6jcKUgffFFfAxgIGwxANjnjXYb+/QO6WMJgcTaZg/wWJSj91 FZSQyZOQ6o5CGpLcb/nQRX2oz9LWmKwHfbirnOQt4jUk4UunxiP0qWnfvzjAg0eQiqfL h2wMrs23r+0cGxqGDxdxLGHWVjYVRRgeBpZd0JgWhNzjcp+pO2ikw+7AX5Z217YyupEB Twvvc1tK9UdC+Aq4C/bAeOQPNyTfA4MjscKLLiVHwd4duQ9Qi7czMizEKDZZ9UZDcovm 2IhLJ2nWRBsR6kyFppEuxzrCBBPN6rK9na7YoctQ/3carVaPu7Hru/j5qYciRGv/BxOb 8BrQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:from; bh=+u7cSGuIL5ZcOaezx+PjBEW0s9CERXtMcseIqbtCoyM=; fh=rKrs5iq1RvK7IdAtTGH/dIdPlPgX7+tXIrQymu3i5H4=; b=XaoMGsLBJmeZyKK54xRD/mYCKypg8dLPIj8lqLXFTND+yLlxopcdRHvy7ZhotXIg42 kp8eKoDFU9Z9447AZ/RNrkhrEy1k0it2Eo6PSf0UP/nxU4OFi6kV5ro6DOwQK9hGpIS3 5/9tfV7s6GJ2ONxGM2KcnkKyaiK1Wn4vbbMbOVuSR1oBntdoyHi0c6ebh1cTeCrFqSEh OLSR4MhulBXrDfk1WggvMeGE6iHiCcGe+gBv6PgodOO21+xVajsHkoBN1gQmOFAp8mOI qqTQ5jTwZGAdq03T0o5FmAPcJ7HmedYX0mfyd/+2EsBric2ZT8chVP7hp6HPBH40aSjy UmlA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-137638-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137638-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id b12-20020a50cccc000000b0056de760c649si5075201edj.298.2024.04.09.14.25.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Apr 2024 14:25:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-137638-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-137638-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137638-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id D502B1F22E37 for ; Tue, 9 Apr 2024 21:25:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1E158158A29; Tue, 9 Apr 2024 21:25:06 +0000 (UTC) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C36C158851 for ; Tue, 9 Apr 2024 21:25:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712697905; cv=none; b=aPWdHWnt/rPbP/E16dtNNfZJQ/MZjSVozlz3AYdFDuHTiu9SVPpqk1OrCaBNgOlcc5vqfhFACzbkjKP19WAVc+9SVn4xsQpVymzXRvRxBSy9vYxvIH6EhiANterjIRW8H/0wPgluZz1iGwsQzdUoUkMUnTMIIGyXp3d7hZJoQ3I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712697905; c=relaxed/simple; bh=BXSDolwWzU5tAWjmREDmfTdkudqshVOcwopesXpiiLw=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=uWgvVbxLXMzEZ9rE4YgJaRVymT3fUQhBgi3LfZXiPqpvlxF9rL/6fgBZAs57MSqSd+/jZaz+FK+Eh/k03V9AH766C2UR/PGeL+7Yf2Bs0uQoV5GX3X+xuB8Bk/lJ/4UCy8k85hF8KcbceF7aBp+unP05nKxdXnpmHymDSvJcRqs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ruIxf-00081b-FR; Tue, 09 Apr 2024 23:24:59 +0200 Received: from [2a0a:edc0:0:1101:1d::ac] (helo=dude04.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ruIxe-00BNAf-R4; Tue, 09 Apr 2024 23:24:58 +0200 Received: from localhost ([::1] helo=dude04.red.stw.pengutronix.de) by dude04.red.stw.pengutronix.de with esmtp (Exim 4.96) (envelope-from ) id 1ruIxe-00FQKu-2R; Tue, 09 Apr 2024 23:24:58 +0200 From: Michael Grzeschik Subject: [PATCH 0/3] usb: gadget: uvc: allocate requests based on frame interval length and buffersize Date: Tue, 09 Apr 2024 23:24:56 +0200 Message-Id: <20240403-uvc_request_length_by_interval-v1-0-9436c4716233@pengutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIACiyFWYC/x2NywrCMBAAf6Xs2UBsq1V/RSTksW0XwqqbB0rpv xs8zhxmNkgohAlu3QaClRI9ucHx0IFfLS+oKDSGXvejHvWgSvVG8F0wZRORl7wa9zXEGaXaqOy EczhdpnA9D9AiziZUTiz7tWW4xNjkS3Cmz/96f+z7D/EVBJKFAAAA To: Laurent Pinchart , Daniel Scally , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Grzeschik X-Mailer: b4 0.12.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1061; i=m.grzeschik@pengutronix.de; h=from:subject:message-id; bh=BXSDolwWzU5tAWjmREDmfTdkudqshVOcwopesXpiiLw=; b=owEBbQKS/ZANAwAKAb9pWET5cfSrAcsmYgBmFbIpHaFNod1WQlhnldeCskg5hmmieH2EkxFzp FyRMtNS/2WJAjMEAAEKAB0WIQQV2+2Fpbqd6fvv0Gi/aVhE+XH0qwUCZhWyKQAKCRC/aVhE+XH0 qzIAEADCiH8P3Z9MDcX2+X8cFt7JEd/bYDEkkmp6aDKGKge65CvUKi5XCy/3B3N45610qbSNWlD uAgYUOGeyARI165tSAc61FRS2jyMApjjdh5qPBMOyKFzzLcfk9XwAvysSWUDGc7oGDOxvTANRxW sCZw944vxOd9nMDPIQzioOhhtScIhwyva1m8fqe8HMln5NKUfp9j1yrmGtPXlCfXca0jzgz+fw6 juYtOhpQHv76+2tsVbv7bbs4GuJ0V6n+g0DPIi7U5cdOb9WLvDOlF+KNVvKAFLeoQ0KptpcsQbZ wrGi463NMgH91ikBStP03B5vtmtwB+7OLk+Chm3UNw6dPEkrmxbFHRCcl4JSO2e/+smw+HiCMlQ PO/mErKCtNXCBvxvZDZoQ9TvzIKGfo1XcNrpcDqMZZ3cHpGTdU6QKm1ipmUJjRgdp0O6JVgH+YP 6GgeJe3FASut5Qk04RcKVcGD1h31gImlhDLLBP1CR/44ryG3Mnmx8+/ZkESpx1FEOhxKwYWTUHH qAjRfy4iIl58bMdKqD/dnxBsgBShPwbAw33NEiJrDbSBAoNxTPHT1wwnwFQPSurFPUdCowfUstp WF9tpEyRAI49W4s7SBLsS9jRAVeSTo8HrbqWzAYFyrYPhT68eoL8CsujBM5braGaxY3/+gMBclv nM5Knp1ysIkDPAA== X-Developer-Key: i=m.grzeschik@pengutronix.de; a=openpgp; fpr=957BC452CE953D7EA60CF4FC0BE9E3157A1E2C64 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: m.grzeschik@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org This patch series is improving the size calculation and allocation of the uvc requests. Using the currenlty setup frame duration of the stream it is possible to calculate the number of requests based on the interval length. Signed-off-by: Michael Grzeschik --- Michael Grzeschik (3): usb: gadget: function: uvc: set req_size once when the vb2 queue is calculated usb: gadget: uvc: add g_parm and s_parm for frame interval usb: gadget: uvc: set req_size and n_requests based on the frame interval drivers/usb/gadget/function/uvc.h | 1 + drivers/usb/gadget/function/uvc_queue.c | 30 ++++++++++++++----- drivers/usb/gadget/function/uvc_v4l2.c | 52 +++++++++++++++++++++++++++++++++ drivers/usb/gadget/function/uvc_video.c | 17 ++--------- 4 files changed, 79 insertions(+), 21 deletions(-) --- base-commit: 3295f1b866bfbcabd625511968e8a5c541f9ab32 change-id: 20240403-uvc_request_length_by_interval-a7efd587d963 Best regards, -- Michael Grzeschik