Message ID | 20230927153558.159278-35-benjamin.gaignard@collabora.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3024846vqu; Wed, 27 Sep 2023 19:19:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGjXgll9KtQSg5s6GJja4yvyYay2udDNZ0vtlcZmG8Nm5xF9+EjDY81hDbtrPYslDdNVsck X-Received: by 2002:a17:90a:8905:b0:274:46cd:5af2 with SMTP id u5-20020a17090a890500b0027446cd5af2mr3395914pjn.34.1695867577473; Wed, 27 Sep 2023 19:19:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695867577; cv=none; d=google.com; s=arc-20160816; b=0TshmshPIaVWFNUnZ66e1KXb8kTs++7V+Ptr+3BapU8axoU7ssPeLtK+/o0atzcYdj ni0ZeyGljmSW5MKmKZqtkUqNSih3MlgbRABiw9uswx1g5vdXJrmCBvATWUtTjtMmASWE oJYlGLuzAvboQAUonPQtwQ0o43ExI3RuELm+0Jp0Xpb/LTlG3gbfe525MZWDOkZxKWto HUmmrEhs49hf1U05qckv0djULKy/0TnjGqqjBBRv2/04Mx0Oy4kKX+wal5K3Mvpak9FE eKzGZOh1LgxeTWtx+Iv2BHcQT77rfMafr+M7rLQ2QC52Buzj95+TKr0wr3GZVNJo5PcV 15Sg== 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=YG8UIc7986tkQFuUMGejFzD4ZJcuIJ8ekFnyind3zrw=; fh=ceA81l8d2hZW6pWH7VE5TwJxtgXUzAubfWIMcikPA1M=; b=O01yPwXRZKTo+kpXdXzOiTQKFHRs5MdszRCkYHzqId00BX7dlJawwnlFq9qOO/Z3x0 G78dQ5miXhHXmnXOr3tqFneuGBBSSg/KzF4pgAEAbVYp8mAX+NjR7k4+NwX4jP9hHqVC MrkncE1I8igjOsI8RZGhq+YashluOlvK6kcLNxvXqcaF/PGd/n/3v+JYMH71/V/8V8PL lZ75//8VhUC4TxRengOxZZ6CTiYHr8lYqnM8S/KsdCpsXc1Tahfn1y7gEE/POBDVxUhy m/c5RerCtGuNhn9iRe7ds7mh9Uyy/UQCqmy4FOuN3DCwgX4p6JhIpHiBBhupgnzup725 a5nQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Uk1tNrOQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id o5-20020a17090ad24500b00277799671aasi6436155pjw.73.2023.09.27.19.19.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Sep 2023 19:19:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Uk1tNrOQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id E9D7781B94F2; Wed, 27 Sep 2023 08:38:05 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232828AbjI0PiB (ORCPT <rfc822;ruipengqi7@gmail.com> + 19 others); Wed, 27 Sep 2023 11:38:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232684AbjI0Pgc (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 27 Sep 2023 11:36:32 -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 B1BBC13A; Wed, 27 Sep 2023 08:36:25 -0700 (PDT) Received: from benjamin-XPS-13-9310.. (unknown [IPv6:2a01:e0a:120:3210:672:46bd:3ec7:6cdf]) (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 133B36607366; Wed, 27 Sep 2023 16:36:24 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1695828984; bh=RTtrEWB+iCCua3F+YDyTtBODpNsAwbuQk2kDkvELWIg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Uk1tNrOQzdkZ4dXxiRhTxcmUD+5OiLEWY+hGF5IX0nM4UkLyDVtPLR7KxaHOB53zT 5hfiYhOAegQ3DLWDQh65dllY2Hsm4QPO0X6eVG8C8k/AXmaQ7qSjyeYbrml1mCOl3K rzINSIGcw2ChfD5ewJJADIpS5awMxZdrr/WCKHRLIVIDfq3NkBG8UuJNse5/2r/cjv n+J2MqTNIv1gV8WigohX8BaxBp6LJzErFx9swIcVTDv+AxFvWCFRij5Iyv1gno9eCI YLPZHHIIe85zniOWZyH9Fayub9jRCinjz6MYaFMw/7pkFFNgcdy+gHfqMIext5Caa+ x/MrZeHRcDOVQ== 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 v8 34/53] media: renesas: Set min_buffers_needed to 16 Date: Wed, 27 Sep 2023 17:35:39 +0200 Message-Id: <20230927153558.159278-35-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230927153558.159278-1-benjamin.gaignard@collabora.com> References: <20230927153558.159278-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 (snail.vger.email [0.0.0.0]); Wed, 27 Sep 2023 08:38:06 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778246040855825849 X-GMAIL-MSGID: 1778246040855825849 |
Series |
Add DELETE_BUF ioctl
|
|
Commit Message
Benjamin Gaignard
Sept. 27, 2023, 3:35 p.m. UTC
vb2 queue_setup checks for a minimum number of buffers so set
min_buffers_needed to 16 and remove the useless check in
rcar_drif_queue_setup().
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
---
drivers/media/platform/renesas/rcar_drif.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/media/platform/renesas/rcar_drif.c b/drivers/media/platform/renesas/rcar_drif.c index 163a4ba61c17..8a9a70565d3f 100644 --- a/drivers/media/platform/renesas/rcar_drif.c +++ b/drivers/media/platform/renesas/rcar_drif.c @@ -425,13 +425,9 @@ static int rcar_drif_queue_setup(struct vb2_queue *vq, { struct rcar_drif_sdr *sdr = vb2_get_drv_priv(vq); - /* Need at least 16 buffers */ - if (vq->num_buffers + *num_buffers < 16) - *num_buffers = 16 - vq->num_buffers; - *num_planes = 1; sizes[0] = PAGE_ALIGN(sdr->fmt->buffersize); - rdrif_dbg(sdr, "num_bufs %d sizes[0] %d\n", *num_buffers, sizes[0]); + rdrif_dbg(sdr, "num_bufs %u sizes[0] %d\n", vb2_get_num_buffers(vq), sizes[0]); return 0; } @@ -1311,6 +1307,8 @@ static int rcar_drif_sdr_probe(struct rcar_drif_sdr *sdr) /* Init videobuf2 queue structure */ sdr->vb_queue.type = V4L2_BUF_TYPE_SDR_CAPTURE; sdr->vb_queue.io_modes = VB2_READ | VB2_MMAP | VB2_DMABUF; + /* Need at least 16 buffers */ + sdr->vb_queue.min_buffers_needed = 16; sdr->vb_queue.drv_priv = sdr; sdr->vb_queue.buf_struct_size = sizeof(struct rcar_drif_frame_buf); sdr->vb_queue.ops = &rcar_drif_vb2_ops;