From patchwork Thu Oct 19 12:52:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 155545 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2010:b0:403:3b70:6f57 with SMTP id fe16csp361015vqb; Thu, 19 Oct 2023 05:57:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFhrxaSg8UhKDKk/2G6RU+4EjDF+9vOa8+n8jjdP5rBF5WFBhPlpRTmrDQi9TJKKmbAHkZ9 X-Received: by 2002:a17:902:e807:b0:1ca:bce4:fdd4 with SMTP id u7-20020a170902e80700b001cabce4fdd4mr1157403plg.26.1697720251630; Thu, 19 Oct 2023 05:57:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697720251; cv=none; d=google.com; s=arc-20160816; b=fUay0Hb8dLW2nwuB+tW5yfeEE1Siml8+IpafUUYBB2JTu7e8Nu1wwjK+ZQ8Y2Z2Clc PtpHymVuWDdT39ugP1bdWsetn8kEHouQPPDycQpZzgdvAJK14bFd56YfzcjLXMyXV7pG tAU3PuwA07qRWs7XYRMmLAQ3t3H1z6z327XUqXKagsdYmMQhjCFVqY7QohqB8IdLx91B FTSRgPRjV1QkfbF2jAF7eBEtOZIubKpJZ1AIYaTxTJ3XJ2quj41Aw1+l6iYPEESy74Mb Ct4oI1VpsfuqpMkUEA9D7ltWEYBWIarXcvUJqCHDmdN8WIHzUHfXDc0U4BPFtU55W7pY /sUA== 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=MItFHTI4Se0Okjdyeb5n9vVVB1fx43fYR5gei7a9yCQ=; fh=ceA81l8d2hZW6pWH7VE5TwJxtgXUzAubfWIMcikPA1M=; b=KA+NMNLSyMS6qchGjxZvN37zrAppN+PL8woMkhVlkApDI9qTZiYjv2pMTcIwKNTTGA qqlNNhEEZW5ltMkjFVl/R8y0DmgjpCndGmi0WfwziNz4HRAu3DnoyS7jtNkuH4Y1yPS0 jUqAZEGwUWV5nlSSQQ8g14sNX624BZN8WPOvkpOOlRXm6WG69dN0knit+l71jjRRiDQK 7gKErPZrdTwy5NHBsBEhUXbf++gzfkZc8NuTDbBgl072Xp1c/mdgyQuY6odw9XlYGKos Kck3bkIM3fi891nZkGN3dfL3MncMRXu7mvQ5hc4C2glWHmI79wIbscIrDds7t+LMf3fS lkKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="YWd8Ieh/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id p17-20020a170902ead100b001c370dc4445si2112539pld.210.2023.10.19.05.57.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 05:57:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="YWd8Ieh/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id DBC0F819BB40; Thu, 19 Oct 2023 05:57:18 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345780AbjJSM4L (ORCPT + 25 others); Thu, 19 Oct 2023 08:56:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346077AbjJSMyB (ORCPT ); Thu, 19 Oct 2023 08:54:01 -0400 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 A9D1E10E0; Thu, 19 Oct 2023 05:52:57 -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 0B6B56607340; Thu, 19 Oct 2023 13:52:54 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1697719974; bh=E3AWNXfqW3zClMdST89v07/d3n0L7Gb4S89ZZv8t3hk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YWd8Ieh/PoU2vj6Z21u8Z7NJkcVvlaN2gp5mBFW8vjdxGMCgdCuOPIPGEQ9tE1mTn CdRLX9dLap0lDcUnK9ShLK/FXHgNS0PGPwAk+632eH+/SEKFWwg+57CZHEDzQy8UiE qW/swYZdnLcWsRjJIcNqv38iHmMqBXdt9xlSy88T7qBQzaqTuaKCd+5HCxixLTiBBR iHIGZmQrFya6v2O8IDZHALPB6nul06U01Q7UblqHw7LGKApteMbKtyQPDuCuoorUO+ 3h0il+Owp3W//jrwBbIIIAgm2SplrjDjrLH4oIFXK5wDqui+j1xEyMLnlxgnkIekrS /jcTzbfkIZpFQ== From: Benjamin Gaignard 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 Subject: [PATCH v13 45/56] media: test-drivers: vivid: Increase max supported buffers for capture queues Date: Thu, 19 Oct 2023 14:52:11 +0200 Message-Id: <20231019125222.21370-46-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 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 agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 19 Oct 2023 05:57:19 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780188710323682005 X-GMAIL-MSGID: 1780188710323682005 Change the maximum number of buffers of some capture queues in order to test max_num_buffers field. Allow to allocate up to: - 64 buffers for video capture queue. - 1024 buffers for sdr capture queue. - 32768 buffers for vbi capture queue. Signed-off-by: Benjamin Gaignard --- drivers/media/test-drivers/vivid/vivid-core.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/media/test-drivers/vivid/vivid-core.c b/drivers/media/test-drivers/vivid/vivid-core.c index 394c9f81ea72..353f035fcd19 100644 --- a/drivers/media/test-drivers/vivid/vivid-core.c +++ b/drivers/media/test-drivers/vivid/vivid-core.c @@ -876,6 +876,20 @@ static int vivid_create_queue(struct vivid_dev *dev, q->type = buf_type; q->io_modes = VB2_MMAP | VB2_DMABUF; q->io_modes |= V4L2_TYPE_IS_OUTPUT(buf_type) ? VB2_WRITE : VB2_READ; + + /* + * The maximum number of buffers is 32768 if PAGE_SHIFT == 12, + * see also MAX_BUFFER_INDEX in videobuf2-core.c. It will be less if + * PAGE_SHIFT > 12, but then max_num_buffers will be clamped by + * videobuf2-core.c to MAX_BUFFER_INDEX. + */ + if (buf_type == V4L2_BUF_TYPE_VIDEO_CAPTURE) + q->max_num_buffers = 64; + if (buf_type == V4L2_BUF_TYPE_SDR_CAPTURE) + q->max_num_buffers = 1024; + if (buf_type == V4L2_BUF_TYPE_VBI_CAPTURE) + q->max_num_buffers = 32768; + if (allocators[dev->inst] != 1) q->io_modes |= VB2_USERPTR; q->drv_priv = dev;