Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4583251rdh; Wed, 29 Nov 2023 05:41:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IHr0MnAIgbAIJp3YcsJlfovxlIl3UDIrmKGS187BFmXaazlSuKWKRwoTQNy4fqucaWqhsjF X-Received: by 2002:a05:6808:319b:b0:3b8:9ad8:3842 with SMTP id cd27-20020a056808319b00b003b89ad83842mr1207446oib.48.1701265276399; Wed, 29 Nov 2023 05:41:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701265276; cv=none; d=google.com; s=arc-20160816; b=iqT8eY/GRPKZ8OhK+CxerrczUs6abRWooR56HtIogQar8EEoPnWZJvI5mmGiaMtDpw +55rbYj3gqFgDAW+rV29zMjNy7qvszapvI9jEx6gD6EE9TS5pZRRgYdoBX5tN2nZChmX mGuwZyldss9DWlDAnYZN4cRRIMVUwglwZQgjisDse6B8TfoygmcC5jS3dY/Uh5ouVQXg y8Lq8pJ0ewijKDCOig6gpyAxlE+Sld0Mth5k0v9ZLOUa7DLoDqaFcX//1l43IiyAmMMj ekL0rpycGD56Euu0+pz+Grtwryh86v2x02RqmUKMkyTUrmBbGCk+65tvV7+uHx4MwX9W 2NPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Mg87daM6N7IwtDqh3Oxpi+m/n/+fVFbpa0PC/b0XCNw=; fh=3huagH6+FnASDucWXzDwt9c4YI5bTbQfZC7JIZYHM84=; b=dGGfjOmkUd5s8jb7q6k5+USe3Pv/c8xbSUhMKEgrPcprhB14Cm9DC7sATrC8eFQfJ5 Jz2eC+AXD2HPodTjOKYDAyAIS58X3IB2UthqglFjKLCG+69bfbLgBPJrr6ST4xhENFpl zOQkqtrV/SplIasB/5zzi86VsO388J4GbNvq2Q1fCygJ0NtXoFpIsmUS3jk7ERfh7gs3 +m8A9jLFozKvsvmrIQeEg7cKZSocVQu6jUV29LVYefXcqqXCmmL8Z5Ad5Kx50pUHBcCn YoiQmmWXr9oUvl9gH8u8yftvL2IDvLz2t3qUw5DYjKZURkyzemrfAupWBmbuHcTDefaa APGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=A9eW5feD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id cf2-20020a056a02084200b005c278e32054si13329970pgb.677.2023.11.29.05.41.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 05:41:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=A9eW5feD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 9ABAE8081CDC; Wed, 29 Nov 2023 05:40:49 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233723AbjK2Nk1 (ORCPT + 99 others); Wed, 29 Nov 2023 08:40:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232882AbjK2NkZ (ORCPT ); Wed, 29 Nov 2023 08:40:25 -0500 Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::224]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61AFAC1; Wed, 29 Nov 2023 05:40:31 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 1D83EE0004; Wed, 29 Nov 2023 13:40:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1701265230; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Mg87daM6N7IwtDqh3Oxpi+m/n/+fVFbpa0PC/b0XCNw=; b=A9eW5feD3zpSW8TWW4yzTnNDWulTByW0ZWSm1zltBwCeC3kcfyH884hQIwXujL+XagYVWA mOs5XTj+TFJW4r0lIw3KJW40SqmLwdy76RbMH7R9JIyguD1kYevWXNF/iDN0I0HRyCgm+C 8XTzS8lGdFntp5LKRBbXw9TO61Iy5z0UMveBvSuToTxW1jUX5jH1p572nV3jM91TjppV/8 Mxrv3mnP9aT/pvrc8QkvGuiIzQ47ZEK51nGifzmtX/fHse1ZZttg4i/Eg+gTSQPIbrVcMh /sUQiLULUs5Ldof6h9RD2/3+wrBAZc7SxUefJ1QMaHnaLUAwb53J+MdGLotJ3w== Date: Wed, 29 Nov 2023 14:40:27 +0100 From: Paul Kocialkowski To: Benjamin Gaignard Cc: hverkuil@xs4all.nl, mchehab@kernel.org, tfiga@chromium.org, m.szyprowski@samsung.com, matt.ranostay@konsulko.com, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, kernel@collabora.com, Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , linux-sunxi@lists.linux.dev Subject: Re: [PATCH 27/55] media: sun6i-isp: Stop abusing of min_buffers_needed field Message-ID: References: <20231127165454.166373-1-benjamin.gaignard@collabora.com> <20231127165454.166373-28-benjamin.gaignard@collabora.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="mU8YCCCm68AE0htG" Content-Disposition: inline In-Reply-To: <20231127165454.166373-28-benjamin.gaignard@collabora.com> X-GND-Sasl: paul.kocialkowski@bootlin.com 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 pete.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 (pete.vger.email [0.0.0.0]); Wed, 29 Nov 2023 05:40:50 -0800 (PST) --mU8YCCCm68AE0htG Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Benjamin, On Mon 27 Nov 23, 17:54, Benjamin Gaignard wrote: > 'min_buffers_needed' is suppose to be used to indicate the number > of buffers needed by DMA engine to start streaming. > sun6i-isp driver doesn't use DMA engine and just want to specify > the minimum number of buffers to allocate when calling VIDIOC_REQBUFS. > That 'min_reqbufs_allocation' field purpose so use it. The hardware actually has its own DMA engine. It can work with just one buf= fer though (which will never be returned to userspace). But I think we should s= till require at least two buffers allocated, otherwise the driver will be of no = use at all. So I don't think the commit message here is correct. Cheers, Paul > Signed-off-by: Benjamin Gaignard > CC: Paul Kocialkowski > CC: Chen-Yu Tsai > CC: Jernej Skrabec > CC: Samuel Holland > CC: linux-sunxi@lists.linux.dev > --- > drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_capture.c | 2 +- > drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_params.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_capture.c b/= drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_capture.c > index 1595a9607775..f47f9946c19f 100644 > --- a/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_capture.c > +++ b/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_capture.c > @@ -660,7 +660,7 @@ int sun6i_isp_capture_setup(struct sun6i_isp_device *= isp_dev) > queue->buf_struct_size =3D sizeof(struct sun6i_isp_buffer); > queue->ops =3D &sun6i_isp_capture_queue_ops; > queue->mem_ops =3D &vb2_dma_contig_memops; > - queue->min_buffers_needed =3D 2; > + queue->min_reqbufs_allocation =3D 2; > queue->timestamp_flags =3D V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; > queue->lock =3D &capture->lock; > queue->dev =3D isp_dev->dev; > diff --git a/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_params.c b/d= rivers/staging/media/sunxi/sun6i-isp/sun6i_isp_params.c > index e28be895b486..259f6bfcb620 100644 > --- a/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_params.c > +++ b/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_params.c > @@ -489,7 +489,7 @@ int sun6i_isp_params_setup(struct sun6i_isp_device *i= sp_dev) > queue->buf_struct_size =3D sizeof(struct sun6i_isp_buffer); > queue->ops =3D &sun6i_isp_params_queue_ops; > queue->mem_ops =3D &vb2_vmalloc_memops; > - queue->min_buffers_needed =3D 1; > + queue->min_reqbufs_allocation =3D 1; > queue->timestamp_flags =3D V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; > queue->lock =3D ¶ms->lock; > queue->dev =3D isp_dev->dev; > --=20 > 2.39.2 >=20 --=20 Paul Kocialkowski, Bootlin Embedded Linux and kernel engineering https://bootlin.com --mU8YCCCm68AE0htG Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEJZpWjZeIetVBefti3cLmz3+fv9EFAmVnP0sACgkQ3cLmz3+f v9F5uwf9HEjUyWv7gu/wFi6nn9TZDZ93ao3xKo/mZikju6pBUS74UzOuzCPOcSGX GZ3YLIKmAeF/EDAbivvsp7a5coFBr93y9abkPMRfhWQww/uijQ4E9gqe/EWlHw3O Xm1g1YnLDqTjVETR4fb6iiGPK9EaKDmr4dhYadoz6ILO3WNZq1+lRTaxEc+H8FpS C62ybRSaHm1TbbMr04szpPrLWT7AAuTFNIsj/hhAA4+ukdUKgc0vMOCH5C/H049l AIOOQZNS4SfqOIt1kBpD7/KchD4frUJOaJUAfbpKbNv8uV7HAal3+0A1I5TvzWy6 nBKgOMp2YyEeY0n0x1XG5ndCKWVGGA== =C4Ap -----END PGP SIGNATURE----- --mU8YCCCm68AE0htG--