From patchwork Thu Nov 9 16:35:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 163499 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp560630vqs; Thu, 9 Nov 2023 08:41:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IHQ9PGFpsVlnhwQjXG0QIKloxQipgczNemDaBObsJwJdjgDerybBuU5i/pFcZHu/YB7dLIY X-Received: by 2002:a17:902:da82:b0:1c6:11ca:8861 with SMTP id j2-20020a170902da8200b001c611ca8861mr14682725plx.21.1699548113126; Thu, 09 Nov 2023 08:41:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699548113; cv=none; d=google.com; s=arc-20160816; b=DA6QfqcQV1wpZI6V2kxEySjqWSk6IwYN4eLny1VKGCy0JojPCp8BmtIuhMXDA9LWg+ cxowb0tclcEPthtQV20fS9scwmUhmI0lFd/H/ZwHC6+EPwWY9Rqupn/mvOUwRwv55Joe JoMl/QYqkVtilWOPY64z9RkD4L7f5genutxtVd9rj9UPNe8Ak36rfowkn62+bEkdI4/e 00azo8u61IWLDsjPwqCMC2Y4t0Mo3O4Brj3rhzijeMHXyFz1SXUY1xa9xAfoygQxll9A eBo0L6MP4VhJOU8a06HK8QQeOVGcs7KedHgrzG5UsnLUl4bTLTG1aoDqgqrBI2N5Q9bo bX+A== 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=6E1O1R8M7YTSlG1XbXGV9AwJXYiqbVAyoOPDtFMzn4c=; fh=t4h1l+tS8anPNnwyX0PglXAWKg/D9M9NAbc0AP3vdGI=; b=RS21qyjjXsej0V7lKrblKUQJNlMmCcVVOCQrt+y7RFVHJyUboOZv2lCybPhHcmNFoQ KFNBrzCwM+ni3wvDyOexqYNz20pQfC/4g9pEZ5wFu1OKFkmlhyUp5k5l8Ca1RZw2L7fP kLf43efEsqhdIClAqiXr/nIDQo5erOAjaD7m+r7NPb3Zeo5QfutFno3cEbWbKA5GTxOB 2rLriMfNXSW2tEoZyeeKnH1DgH2eEeiIZEvSG6/siCyDZK9DeRu9MmtNql/FpOAsnGZf Cy/u8d4j7UjV2b6MlC6DXI9yKRpXFdpiaikSlWCIJ2OcDq5ZIOScRHY/K5te509qkO8k bLEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=WoW+KWPG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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. [23.128.96.32]) by mx.google.com with ESMTPS id bk3-20020a056a02028300b0058974d3c296si8241342pgb.815.2023.11.09.08.41.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Nov 2023 08:41:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=WoW+KWPG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 B8F7E8090278; Thu, 9 Nov 2023 08:41:33 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344832AbjKIQk1 (ORCPT + 31 others); Thu, 9 Nov 2023 11:40:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234848AbjKIQjw (ORCPT ); Thu, 9 Nov 2023 11:39:52 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E59CA4693; Thu, 9 Nov 2023 08:38:34 -0800 (PST) Received: from benjamin-XPS-13-9310.. (cola.collaboradmins.com [195.201.22.229]) (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 CD6F266076D0; Thu, 9 Nov 2023 16:38:32 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1699547913; bh=43xinBr2kPIZE8TtRPdS2cjSs0wQVBCzw73zdRmmfY0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WoW+KWPGTwYzK9VZL/9RxbJgCyVQhJDcYpmDGW+3PK2nATjpaqE2hbHzCjZK9rZdR gYZ7KTVrE08gwA3kdn5BDQa4Waxv85DbxD/I0tFsNSqzy+iA4jJz+9f30NPUePMLgL ISLJhLgTL008vDbgSBWdS8g0sv+aRIN8JXYT9SzzpWTbOlEs4gy1fcxavmbghI+4wT 1qEzgF2s8gd7xiLOzln0O2PNKhn+GyO4gcDCnHWRxIy6ABfuhkOZboewmyOscd6ikO mFdgL9ov4ECzPYblv4MQ/PwNqyeDtQdC8kSfLRknYOi33Tusw974Eg9dbx1/YeC6ur kSOz4pbUklITw== 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 , Andrzej Pietrasiewicz Subject: [PATCH v15 45/56] media: test-drivers: vivid: Increase max supported buffers for capture queues Date: Thu, 9 Nov 2023 17:35:01 +0100 Message-Id: <20231109163512.179524-46-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231109163512.179524-14-benjamin.gaignard@collabora.com> References: <20231109163512.179524-14-benjamin.gaignard@collabora.com> MIME-Version: 1.0 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, 09 Nov 2023 08:41:33 -0800 (PST) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782105362120392896 X-GMAIL-MSGID: 1782105362120392896 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 Reviewed-by: Andrzej Pietrasiewicz --- 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;