Message ID | 20231109163512.179524-40-benjamin.gaignard@collabora.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp559534vqs; Thu, 9 Nov 2023 08:40:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IH4NFlufooksxuOq31blnwTdNyzVzHtsjz7y6wcuMofxqi/fewvj/NdJDA7blcFwgmag4yK X-Received: by 2002:a05:6a20:3d04:b0:15e:e0fd:98e7 with SMTP id y4-20020a056a203d0400b0015ee0fd98e7mr7094908pzi.20.1699547999874; Thu, 09 Nov 2023 08:39:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699547999; cv=none; d=google.com; s=arc-20160816; b=gydH59fzef341jnsbB9RmDS3Uh9LvEel3X6klKCzAO+2viWqoQ1lel3kXk7BMNuCmC 3RHuPh2zd10w8D4xKt8SFco1pWXfQPK1VCHYn4JfwP039r/W+XcCEbe/NxWYIklcqscz N/noaFILGMFnmDn4rDSgZg9IUes+Y7PeS7POWD1AMmTBeLX0A7/Huv3chf0L23sIqJqi ikc3byd/jFOd6z2Hm6kaiCEaixuYylPujZyzqJPgu5p3t0B6QDyo+vmqsyUFHj0h6GV6 JdewggjF0epcl5S24wuOiMj1+jM9uknirGz2jORpuaDS/zhgvvi/fgpI4NwAxLndmOBd AF3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=paFQ/5P8Qsma7s2Kye0Qvb4O7Vbrlr3Cwxvq0ffIpYM=; fh=t4h1l+tS8anPNnwyX0PglXAWKg/D9M9NAbc0AP3vdGI=; b=FSGcvBQD+ouQFoTgKfXfhlmj2UIopeaxzYxNHXN803DN1deVNm82jyjbCb15r/MKOP YBGuSPlWY5npgzj7sPfnSwktmQvIGTNxtc2nbNCLER4+q7GmM4Lh+TsgqTsmDhpULnDB GI2p1rb4zg5tWvB345RWKrcPgCHES6HlrXyADbCMxZJs4mfpEIr1HH/PtNb103Ix1PWK z/JIVRHCV6BuVQW81BmJug+J0ragA3LiDZNYy+MKWA2Dk6CC9fyXzSQa8cWsEEkdoyrv lzVho9mVwDcsIg9XTEaADoW9vp0hu1qFNjf/8ECpVJYqOUbQxwh3ubmmdsAqm4zJfd1N bing== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=OBKs9u4b; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id fn20-20020a056a002fd400b006c320b98b74si15130931pfb.369.2023.11.09.08.39.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Nov 2023 08:39:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=OBKs9u4b; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 21603837C49E; Thu, 9 Nov 2023 08:39:59 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344873AbjKIQjz (ORCPT <rfc822;lhua1029@gmail.com> + 31 others); Thu, 9 Nov 2023 11:39:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344940AbjKIQjH (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 9 Nov 2023 11:39:07 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 039633A8E; Thu, 9 Nov 2023 08:38:25 -0800 (PST) Received: from benjamin-XPS-13-9310.. (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: benjamin.gaignard) by madras.collabora.co.uk (Postfix) with ESMTPSA id D952366076AC; Thu, 9 Nov 2023 16:38:22 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1699547903; bh=erTwggNtL1fF4WX3Qq/WC0lVUOpK1yc8/4MWqZppdB8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OBKs9u4b1fxRKsrcAIC3488DWZjLLAYhQQNiv7sk7hhAf8aaGywMWrK8W2P9N0Zhk 2WxHrpAAoI01qmRHt2S6s+KeqM31hynBhdQLRzzdZvfYTaNfImjyY9Uo0ViNyvsDMJ bafeUD+8SVOyyeyeL+L/2zEiKDbyeFMge8sD2ky33i0nsx4jwNMehb6NlZ079fhE/S zoNY1OTtg3cWWa6FgyDNS0ayzoqzybMgsKBUScrF+QR9F1n1ZWIdimBWTc1HzGbUSX eIlqdYk7sQnpY0siWJllFQINNbNCvayxZdJXoeGesfcYxgZYXuLdmtvqJzKQisMPkT h659vfnHtHpaQ== From: Benjamin Gaignard <benjamin.gaignard@collabora.com> To: mchehab@kernel.org, tfiga@chromium.org, m.szyprowski@samsung.com, ming.qian@nxp.com, ezequiel@vanguardiasur.com.ar, p.zabel@pengutronix.de, gregkh@linuxfoundation.org, hverkuil-cisco@xs4all.nl, nicolas.dufresne@collabora.com Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-staging@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard <benjamin.gaignard@collabora.com>, Andrzej Pietrasiewicz <andrzej.p@collabora.com> Subject: [PATCH v15 39/56] media: usb: airspy: Stop direct calls to queue num_buffers field Date: Thu, 9 Nov 2023 17:34:55 +0100 Message-Id: <20231109163512.179524-40-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231109163512.179524-14-benjamin.gaignard@collabora.com> References: <20231109163512.179524-14-benjamin.gaignard@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 09 Nov 2023 08:39:59 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782105243824328659 X-GMAIL-MSGID: 1782105243824328659 |
Series |
Add DELETE_BUF ioctl
|
|
Commit Message
Benjamin Gaignard
Nov. 9, 2023, 4:34 p.m. UTC
Use vb2_get_num_buffers() to avoid using queue num_buffers field directly. This allows us to change how the number of buffers is computed in the future. Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com> Reviewed-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com> --- drivers/media/usb/airspy/airspy.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/media/usb/airspy/airspy.c b/drivers/media/usb/airspy/airspy.c index 462eb8423506..e24e655fb1db 100644 --- a/drivers/media/usb/airspy/airspy.c +++ b/drivers/media/usb/airspy/airspy.c @@ -482,12 +482,13 @@ static int airspy_queue_setup(struct vb2_queue *vq, unsigned int *nplanes, unsigned int sizes[], struct device *alloc_devs[]) { struct airspy *s = vb2_get_drv_priv(vq); + unsigned int q_num_bufs = vb2_get_num_buffers(vq); dev_dbg(s->dev, "nbuffers=%d\n", *nbuffers); /* Need at least 8 buffers */ - if (vq->num_buffers + *nbuffers < 8) - *nbuffers = 8 - vq->num_buffers; + if (q_num_bufs + *nbuffers < 8) + *nbuffers = 8 - q_num_bufs; *nplanes = 1; sizes[0] = PAGE_ALIGN(s->buffersize);