Message ID | 20231003080704.43911-42-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:2a8e:b0:403:3b70:6f57 with SMTP id in14csp1929322vqb; Tue, 3 Oct 2023 01:10:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFj2rpgXBUGBoQATENzW4RESLr6e2JPKHKOeoN+yPhRoWU+gHXiItMOH9dQWwDYX/C0NzjM X-Received: by 2002:a17:903:32c2:b0:1c2:193e:1126 with SMTP id i2-20020a17090332c200b001c2193e1126mr2787338plr.28.1696320616332; Tue, 03 Oct 2023 01:10:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696320616; cv=none; d=google.com; s=arc-20160816; b=MOr8VO7tYLLJCAOoXiCyjzc7teEShxPub+xmgyaTche/F4DDu8H+ycf6OEWT4Mrf99 mysX0Iho8iUJl4yauJzSHq+RzcNwf8SGeQE9tAOLm6h5tk5RBePRvj4XD8la/LHQjqm0 DDHN4cltrMau5Vd0ZGHQ08nfc/5RKvmNndC02xFo9d3mG2JuY8463V0mj4tNcDJktt3L rq6Z13eXowoKueo8PVNTLZT39crAOYX68P7iytSnM0koZ/58J+oPIodFVjLBjhaUIDmJ vtaVxAnxJiqgM2xURB9R8ls+bxG34TSfkAGOrsZJdf/SYPrUb6aV0GJKHCMGQVrq/Otk TlwQ== 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=qTuPHPU4Io44nAdkQT6nBOAqUL8jchiAXtKAUc5aY3c=; fh=ceA81l8d2hZW6pWH7VE5TwJxtgXUzAubfWIMcikPA1M=; b=f+EUXFgQDAAMUOlAc/ZuJnlTcnSzJZHW87uKbXAqyvyXusDJvPB4puC9cdRooGhyax brBO4fpq0SExqJL3Aez74C/xO2ewJXvJZLotZQpgT7aebN4vhfDki/x5SbyhU7VmktaW bviQUQA0Y5UeXvsf4ePwhF/TA7khsRDgK0dj3L1h553eyX5gV42TEPUBYHUaVy/wsy+Y iaStwRw5yDhSdcvk6ArY55slNHsiGjFPmsTPmV8yZCfu+BxHRRyCF8mxxCTy/GGpopvO HL+vI6HKmnmohp0X+nhF1mq33icSPk4c07m2vxvKVYhhi9dKPLiGvgzkcl7Tm58zvd8V rePw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=KnnXCWtd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id e6-20020a170902b78600b001c5bb1f0cccsi879074pls.275.2023.10.03.01.10.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 01:10:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=KnnXCWtd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 49C2E824E780; Tue, 3 Oct 2023 01:10:15 -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 S239313AbjJCIKI (ORCPT <rfc822;pusanteemu@gmail.com> + 18 others); Tue, 3 Oct 2023 04:10:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239528AbjJCIHl (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 3 Oct 2023 04:07:41 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 690FAF1; Tue, 3 Oct 2023 01:07:35 -0700 (PDT) Received: from benjamin-XPS-13-9310.. (unknown [IPv6:2a01:e0a:120:3210:b6df:b784:6a0f:8451]) (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 476FD660737E; Tue, 3 Oct 2023 09:07:34 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1696320454; bh=nwepyznt8z6pxABzkpFHR6clGV59kYVToyX8aj6cN+w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KnnXCWtdllxU0DZMzzl8fzfEhbINPZZ/1/qStYUhK+64H4TVNwrNaNjNIhxLenM4y T5oTB8rImornc1k7g+Aa7oYLBOKapEiLJ163Tytr9r8P63uQAWm1LnP/EmoMxzdZlB F20gY/g6bsnpgewMb7z89Xxu/LA9fS6SG/NexwCK4sOHhxBgpoaD9baHBJKYDX6C9E L9lz0WUCsVxzX9epta9uooCYqnE3g3+Gk8egnveVyePCFj43lIQ25VRgl7s5RMAL4o oJJNafBHbp1d8v3w4AQ++aa2V/fHHFdLSogLnvOE5Kq8VurHTpa04W7VjzTieIwhRG HyxISeXk0z+KA== 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 v10 41/54] media: usb: usbtv: Set min_buffers_needed to 2 Date: Tue, 3 Oct 2023 10:06:50 +0200 Message-Id: <20231003080704.43911-42-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231003080704.43911-1-benjamin.gaignard@collabora.com> References: <20231003080704.43911-1-benjamin.gaignard@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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]); Tue, 03 Oct 2023 01:10:15 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778721086246648374 X-GMAIL-MSGID: 1778721086246648374 |
Series |
Add DELETE_BUF ioctl
|
|
Commit Message
Benjamin Gaignard
Oct. 3, 2023, 8:06 a.m. UTC
vb2 queue_setup checks for a minimum number of buffers so set
min_buffers_needed to 2 and remove the useless check in
usbtv_queue_setup().
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
---
drivers/media/usb/usbtv/usbtv-video.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/media/usb/usbtv/usbtv-video.c b/drivers/media/usb/usbtv/usbtv-video.c index 1e30e05953dc..0e9e860be47f 100644 --- a/drivers/media/usb/usbtv/usbtv-video.c +++ b/drivers/media/usb/usbtv/usbtv-video.c @@ -727,8 +727,6 @@ static int usbtv_queue_setup(struct vb2_queue *vq, struct usbtv *usbtv = vb2_get_drv_priv(vq); unsigned size = USBTV_CHUNK * usbtv->n_chunks * 2 * sizeof(u32); - if (vq->num_buffers + *nbuffers < 2) - *nbuffers = 2 - vq->num_buffers; if (*nplanes) return sizes[0] < size ? -EINVAL : 0; *nplanes = 1; @@ -892,6 +890,7 @@ int usbtv_video_init(struct usbtv *usbtv) /* videobuf2 structure */ usbtv->vb2q.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; usbtv->vb2q.io_modes = VB2_MMAP | VB2_USERPTR | VB2_READ; + usbtv->vb2q.min_buffers_needed = 2; usbtv->vb2q.drv_priv = usbtv; usbtv->vb2q.buf_struct_size = sizeof(struct usbtv_buf); usbtv->vb2q.ops = &usbtv_vb2_ops;