From: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
To: Benjamin Gaignard <benjamin.gaignard@collabora.com>
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 <wens@csie.org>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
Samuel Holland <samuel@sholland.org>,
linux-sunxi@lists.linux.dev
Subject: Re: [PATCH 27/55] media: sun6i-isp: Stop abusing of min_buffers_needed field
Date: Wed, 29 Nov 2023 14:40:27 +0100 [thread overview]
Message-ID: <ZWc_S8CuPyc9zRXz@aptenodytes> (raw)
In-Reply-To: <20231127165454.166373-28-benjamin.gaignard@collabora.com>
[-- Attachment #1: Type: text/plain, Size: 2841 bytes --]
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 buffer
though (which will never be returned to userspace). But I think we should still
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 <benjamin.gaignard@collabora.com>
> CC: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
> CC: Chen-Yu Tsai <wens@csie.org>
> CC: Jernej Skrabec <jernej.skrabec@gmail.com>
> CC: Samuel Holland <samuel@sholland.org>
> 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(-)
>
> 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 = sizeof(struct sun6i_isp_buffer);
> queue->ops = &sun6i_isp_capture_queue_ops;
> queue->mem_ops = &vb2_dma_contig_memops;
> - queue->min_buffers_needed = 2;
> + queue->min_reqbufs_allocation = 2;
> queue->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
> queue->lock = &capture->lock;
> queue->dev = isp_dev->dev;
> diff --git a/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_params.c b/drivers/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 *isp_dev)
> queue->buf_struct_size = sizeof(struct sun6i_isp_buffer);
> queue->ops = &sun6i_isp_params_queue_ops;
> queue->mem_ops = &vb2_vmalloc_memops;
> - queue->min_buffers_needed = 1;
> + queue->min_reqbufs_allocation = 1;
> queue->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
> queue->lock = ¶ms->lock;
> queue->dev = isp_dev->dev;
> --
> 2.39.2
>
--
Paul Kocialkowski, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2023-11-29 13:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20231127165454.166373-1-benjamin.gaignard@collabora.com>
2023-11-27 16:54 ` [PATCH 27/55] media: sun6i-isp: Stop abusing of min_buffers_needed field Benjamin Gaignard
2023-11-29 13:40 ` Paul Kocialkowski [this message]
2023-11-29 14:03 ` Benjamin Gaignard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZWc_S8CuPyc9zRXz@aptenodytes \
--to=paul.kocialkowski@bootlin.com \
--cc=benjamin.gaignard@collabora.com \
--cc=hverkuil@xs4all.nl \
--cc=jernej.skrabec@gmail.com \
--cc=kernel@collabora.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=linux-sunxi@lists.linux.dev \
--cc=m.szyprowski@samsung.com \
--cc=matt.ranostay@konsulko.com \
--cc=mchehab@kernel.org \
--cc=samuel@sholland.org \
--cc=tfiga@chromium.org \
--cc=wens@csie.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox