Message ID | 20231019125222.21370-40-benjamin.gaignard@collabora.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2010:b0:403:3b70:6f57 with SMTP id fe16csp360898vqb; Thu, 19 Oct 2023 05:57:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHp3+qasR5x85RWcwp+bsXHQ0rbb2SmFwywOyDWrecteOlY1wJiAz0YcXOxCrNPIAIqXSbf X-Received: by 2002:a17:90b:1b49:b0:27d:491d:2e40 with SMTP id nv9-20020a17090b1b4900b0027d491d2e40mr1761238pjb.22.1697720236980; Thu, 19 Oct 2023 05:57:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697720236; cv=none; d=google.com; s=arc-20160816; b=xfBiR86/x2kAnpRn+sdaRZ8QI0NP5UDXzNpm1lhxHyI7RTY+GN6UCCnjQIHAz3EERD 08E429+o98xvsD+6ARJy1lPWE8uh5fBdmg67lYMJCZ4cLczBw0zhIOmUgcTPDmmDYmMb 0n6CvW+Qc1ntXB+L8Ikvtl4GDekdame17MjMu7c5uGRnpoW3mTscbN4RRnpkQYYjgmMX NDztR7GrawjzHlSb6JYcLFdd68qhWDJ85fWNldz/v/aa50KWJPjh7U8caHYEu6tngE0n I7jw6PSLNRkdMi9/BX2L3xUQEBYRhV1ezK0HgS/iMrNOP+ahhXpiMb55YPbY2XYLXOp+ N6Kw== 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=RNH8B9gPylxTtM01bKtOlQf9akbpmUzdDHvgh+kzWPw=; fh=ceA81l8d2hZW6pWH7VE5TwJxtgXUzAubfWIMcikPA1M=; b=EqlvMI+DbN2dPdWexOCe4HhO3iCjKTyuER1/MHdaUoivP2i2CR/C5I2t/iknaHCutj yRcffepvLEqyeQeEdIIljAXveZ1oNzzbrpCYk+NkwVMttx/7mGM4XLhquhrrVRrRo+0h TeAHa4HXftO5FnNqveC0F53krTP5XdZYVx1OVyyvWAfzV3LrAay2pQCrt15cRUJ6spLw u0LTUpGMeGY4M3JRmiC4uBq4NBXBYalDYTGd83NamE1DHPECaaV+XaTamOaBVUg/AVpG h6wA7TlJDyoZ8TWmrRF6G1CXD6Fi8r23aMhfVDen8MlxUUIA6G/+MeuJkcJXMvnbtyeG aAJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="kcvKob/9"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id a3-20020a17090abe0300b0027cd01b6cb0si1919293pjs.125.2023.10.19.05.57.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 05:57:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="kcvKob/9"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (Postfix) with ESMTP id AEE0A82990CC; Thu, 19 Oct 2023 05:57:06 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346234AbjJSMzc (ORCPT <rfc822;lkml4gm@gmail.com> + 25 others); Thu, 19 Oct 2023 08:55:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345956AbjJSMxS (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 19 Oct 2023 08:53:18 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1CCCD61; Thu, 19 Oct 2023 05:52:53 -0700 (PDT) Received: from benjamin-XPS-13-9310.. (unknown [IPv6:2a01:e0a:120:3210:ccea:1fb5:34eb:239b]) (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 014CE6607382; Thu, 19 Oct 2023 13:52:50 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1697719971; bh=KjApYJIBwjQar3zDS5eK/9rcHF3+Kx68u3lDScmGVYg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kcvKob/9JBRvVHTLOOOjKxOfUSntTeKcqSHyXPZc/HiO4dW78FIX29uqGvA0KmzQl LhsQBcSzP7OKzT/4x9Z7+av++aoeAbmheKpbgfKo3Kq20IW5cUED7axibzT94EqRnG OCwyhpvfpDNkJhKu5VdjBRfVoOIsJJXwaSEWPo+rZqaURnwb0yJrO128kZetbpPPb6 90dUMSdZ7rLE2kTIMjtEKXqyqCz0sQh13lMemFnrQefzrK4ZwUBtFLYso/WDZNKELL hFTAOOYEJfSEq1p/wThdz8vPKiVggYoZ7af8QOVs/iHHtt5aDndWw3NEHaHdLDPDQ6 YEIirX7J9hpaQ== 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> Subject: [PATCH v13 39/56] media: usb: airspy: Stop direct calls to queue num_buffers field Date: Thu, 19 Oct 2023 14:52:05 +0200 Message-Id: <20231019125222.21370-40-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231019125222.21370-1-benjamin.gaignard@collabora.com> References: <20231019125222.21370-1-benjamin.gaignard@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email 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 (lipwig.vger.email [0.0.0.0]); Thu, 19 Oct 2023 05:57:06 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780188695133964498 X-GMAIL-MSGID: 1780188695133964498 |
Series |
Add DELETE_BUF ioctl
|
|
Commit Message
Benjamin Gaignard
Oct. 19, 2023, 12:52 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>
---
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);