From patchwork Tue Oct 17 14:47:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 154345 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp4188938vqb; Tue, 17 Oct 2023 07:52:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEgnJVNQAacCukuJhfEtioa9CzngliO4OsJOW8ls+a9+HOG53kt5mn9ZCKa2ZecethPuOeU X-Received: by 2002:a05:6830:e86:b0:6b9:db20:4d25 with SMTP id dp6-20020a0568300e8600b006b9db204d25mr2516044otb.1.1697554353809; Tue, 17 Oct 2023 07:52:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697554353; cv=none; d=google.com; s=arc-20160816; b=TwnwNr/EXMLCcPlTzIzDV6fZeuekNCAu4iK4NBIUAvmWlHrQ0k0UMx96pDCdouTTId pTjPgAf58dXJ3nJHjpDaL+fE4on8f+sCEBaBvGpMtoqVDmTYYCOOUi1PHCY6VWW5+btX tVkWHLwrHGeK4XGPjpZ5RZDDwWixhh7NsJAVJFyBXOyDD51gmda+oqnstZeY0RtfI0pP FaHUkzwDQauBk15jjA7cz+0k6ufWHoODkqYjAhwUePKmmGteEzutmcl90RbB7g/PtI/I Jx+vB8T7sLamfMwSL4MwIBdhpFq1gGgDL/LgsY40vEilhaCyIClcPqB0bc/P7udqgY9m 2xNg== 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=xWWX4KM3CCcwJZEE77Z79QJe31VhVMKmC4laU4Cg6Jk6knd5GYw8qwnILa3o0QldZ9 SwCIS3TPWSSiA4gKdC35a1AYFgkVSAGEeKIWUuOKlvFIoOxhVeqxgkeFKAUCx2gmaEv8 S6krzzYgLjEWJmFDPeXNkbjyEHyKNcfQnmfSeu4CqC0KP//7imDw8fOgYWrjfl+CiTxQ mxLZO4sq9R21ZLDuYnwW/Aa6wyR8xt7kKHMzry/TLwgtOsHJTrNcarVvjRst9tJ/7UIM vnxQlQayJa14TngHc2DfsRI78/4GmEOEuGScbNv/YDt8LsXG+Pw6TFYCHkWKXufeiqVh +iRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Q0dNr0WD; 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 f22-20020a633816000000b0057458518e20si1909751pga.164.2023.10.17.07.52.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 07:52:33 -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=Q0dNr0WD; 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 8165D8082DF4; Tue, 17 Oct 2023 07:52:20 -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 S1344645AbjJQOvP (ORCPT + 20 others); Tue, 17 Oct 2023 10:51:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344282AbjJQOsq (ORCPT ); Tue, 17 Oct 2023 10:48:46 -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 42E60D4B; Tue, 17 Oct 2023 07:48:28 -0700 (PDT) Received: from benjamin-XPS-13-9310.. (unknown [IPv6:2a01:e0a:120:3210:7205:da49:a7e8:59f8]) (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 086216607373; Tue, 17 Oct 2023 15:48:27 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1697554107; bh=E3AWNXfqW3zClMdST89v07/d3n0L7Gb4S89ZZv8t3hk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q0dNr0WDkDZ4NSQAHWCRqjKbD37vAJRF7mbyOhLS9CydzB3HJT6VDFWbntdWZDqP5 AQJgL/FiMjQ5GejYn2AKhhCfBGLCKJ5hSF5i5hqkQnUgk4YqRf6VLQ3iDifacoPvXv 0OdHeIse/k8B+Sn8zXZxmfsEtpoh3/tcwaMBiRAAX7n0tkWCSp21m5tlcZu3Bnrir5 bi5GkoYt84eJh7lPSmOF5n7CLNVB+eLFIJagbXCsexZZ4FAnRrcMyg+M461mLjo7V9 Z0n3kuEdn8LO/rTD0UBjT7Jem6IyIHRiKap4l2rMST0BFT7Jczqb6HHJVyZmPOWIRi Z0qX3gjyF/tLA== 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 v12 45/56] media: test-drivers: vivid: Increase max supported buffers for capture queues Date: Tue, 17 Oct 2023 16:47:45 +0200 Message-Id: <20231017144756.34719-46-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231017144756.34719-1-benjamin.gaignard@collabora.com> References: <20231017144756.34719-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]); Tue, 17 Oct 2023 07:52:20 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780014754229883423 X-GMAIL-MSGID: 1780014754229883423 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;