Message ID | 20231012114642.19040-36-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:2908:b0:403:3b70:6f57 with SMTP id ib8csp1166557vqb; Thu, 12 Oct 2023 04:51:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHzetRzu218HAF4zVtEqhEi7d5GDbl/ujBEwAdLIPUUoZiZLIe9BecKZ7Mh8gzfh7AOdF7a X-Received: by 2002:a17:902:d4c9:b0:1b8:9fc4:2733 with SMTP id o9-20020a170902d4c900b001b89fc42733mr26663385plg.3.1697111479430; Thu, 12 Oct 2023 04:51:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697111479; cv=none; d=google.com; s=arc-20160816; b=vlOBuTbjbgeNDq3nPjd0GrZiCt0V4ZOiv66YcLnw3dVo9Aa7UFTBtat4ZcNbhsBc7w j70NEKRdh0LnE93JGQ2Du3i/zBfctujWgJCJ/ZGMetA/30D0A37DduIp2hDCSiqQW0D3 UCyMbURKb+99vpf21ZJJz+O4OmYM3VLguLyQeoc5fG3XEKh7kDYc+9MF1nPOkraDTB5K pUPmd/ZHx9cDRmZqr1OibSWtLJ57hSM1j41vq075DmMc4QGxa8trIUQXEuYk+5uHweNV lTSoETnl6jonnU+oL2lLWFPvB5iCJB2aoGGv7fSzUljNv3wbQHx6cMDG0pfgAorrJTv2 9DcQ== 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=880OYilSR3s/ka6XPIa3CAbS09woXqMQeX/b/wUiKAQ=; fh=p0AH8hgimiy85Lh1cXLIqpi5zFbeLa4s8fsQNMmUBzM=; b=oB04VUupAB2wb1GUwbHIIKKr1HcYoId8UV6tIZSETX6HTtiAmOHigNLxDpAD0oX9JN Xcyf7eHy24cThMp0Pq/pFgWzYKoeJbNLAVVwqs5PQeHRfgmvngh0VVI/vzmrA9ZmXVXz HQHAgwIsBPQTN1eyiCMkomffOEYMidPCTaf/9vaeU98AryuPrnWkwQlxyFuh+jJpnVr5 aTakkDdfsjCOEjo/t9zf7veLrnoUSDrBmcKnNFmPax1mzkaU+gpOstYh07S3C6XOXOoG PwrC3BLJZgfdTqu16vtY9nQx8yJ+powSYOB5hhBMQ3YEW5z1MARAQ09zBS0CR1XGnXA0 rH0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Gf62AcjP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id ja2-20020a170902efc200b001b5589848absi1961668plb.234.2023.10.12.04.51.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 04:51:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Gf62AcjP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id 47E2A822F8E6; Thu, 12 Oct 2023 04:50:00 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378732AbjJLLtG (ORCPT <rfc822;rua109.linux@gmail.com> + 19 others); Thu, 12 Oct 2023 07:49:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378811AbjJLLrT (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 12 Oct 2023 07:47:19 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C28519E; Thu, 12 Oct 2023 04:47:09 -0700 (PDT) Received: from benjamin-XPS-13-9310.. (unknown [IPv6:2a01:e0a:120:3210:7ae7:b86d:c19a:877e]) (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 04BCE660738E; Thu, 12 Oct 2023 12:47:08 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1697111228; bh=Zne8+1+gt7T5bArgwI34aDgBwx9md9yjRlThQEon5Pk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Gf62AcjPOWvhMdRnJLmE7bGshcMQ4KNh+hthHIVDXid8l3MkgBetP/26Xjn2KSMtb H8EIQSwmX8n+aIhWpFXtdiS3F+VD8K0qfKNtKDWURVfH22H2dLYAxvb+SWUBXxslQB 7fhI0AoGLYmOPsk2AfDcf2O9hPNloqPwd89JElrVskjwHUhCpOGFyyeJdn6VboNJhP Ac99fN6a8lkBmEnmkgSvKIVnNUyJSXkvto5CExml7BtvuC4Nx1w5XdmzPPb7C8Qi3b 342KiEz+CMwVHJEKp5FmaLjASvSoTU+TKexyrkuS7nQqQLVOR5ZPbF8Gs3IfcZmZDz wauoulmDnt5fw== 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>, Antti Palosaari <crope@iki.fi> Subject: [PATCH v11 35/56] media: usb: hackrf: Set min_buffers_needed to 8 Date: Thu, 12 Oct 2023 13:46:21 +0200 Message-Id: <20231012114642.19040-36-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231012114642.19040-1-benjamin.gaignard@collabora.com> References: <20231012114642.19040-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 howler.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 (howler.vger.email [0.0.0.0]); Thu, 12 Oct 2023 04:50:00 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779550366710553656 X-GMAIL-MSGID: 1779550366710553656 |
Series |
Add DELETE_BUF ioctl
|
|
Commit Message
Benjamin Gaignard
Oct. 12, 2023, 11:46 a.m. UTC
vb2 queue_setup checks for a minimum number of buffers so set
min_buffers_needed to 8 and remove the useless check in
hackrf_queue_setup().
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
CC: Antti Palosaari <crope@iki.fi>
---
drivers/media/usb/hackrf/hackrf.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/media/usb/hackrf/hackrf.c b/drivers/media/usb/hackrf/hackrf.c index 3e535be2c520..2e856b20aa21 100644 --- a/drivers/media/usb/hackrf/hackrf.c +++ b/drivers/media/usb/hackrf/hackrf.c @@ -754,15 +754,10 @@ static int hackrf_queue_setup(struct vb2_queue *vq, { struct hackrf_dev *dev = vb2_get_drv_priv(vq); - dev_dbg(dev->dev, "nbuffers=%d\n", *nbuffers); - - /* Need at least 8 buffers */ - if (vq->num_buffers + *nbuffers < 8) - *nbuffers = 8 - vq->num_buffers; *nplanes = 1; sizes[0] = PAGE_ALIGN(dev->buffersize); - dev_dbg(dev->dev, "nbuffers=%d sizes[0]=%d\n", *nbuffers, sizes[0]); + dev_dbg(dev->dev, "nbuffers=%u sizes[0]=%d\n", vb2_get_num_buffers(vq), sizes[0]); return 0; } @@ -1392,6 +1387,8 @@ static int hackrf_probe(struct usb_interface *intf, dev->rx_vb2_queue.type = V4L2_BUF_TYPE_SDR_CAPTURE; dev->rx_vb2_queue.io_modes = VB2_MMAP | VB2_USERPTR | VB2_DMABUF | VB2_READ; + /* Need at least 8 buffers */ + dev->rx_vb2_queue.min_buffers_needed = 8; dev->rx_vb2_queue.ops = &hackrf_vb2_ops; dev->rx_vb2_queue.mem_ops = &vb2_vmalloc_memops; dev->rx_vb2_queue.drv_priv = dev;