[libcamera-devel] [RFC PATCH 3/3] libcamera: pipeline: rkisp1: Make fixed amount of internal buffer allocation more explicit
Jacopo Mondi
jacopo at jmondi.org
Sat Apr 10 10:31:09 CEST 2021
Hi Nicolas,
On Fri, Apr 09, 2021 at 06:38:15PM -0300, Nícolas F. R. A. Prado wrote:
> Now that bufferCount can be increased and there is a lc-compliance test
> in place to check if the pipeline can handle more requests than it has
> internal buffers, we need to be able to test it.
>
> Make the internal buffer allocation always constant, so that by
> increasing bufferCount we can simulate this scenario. Scaling the
> internal buffers amount with bufferCount only hides the issue, that
> should be handled by queueing the overflowing requests.
>
Not a 100% sure I got it: is this patch meant to trigger an error just
for the purpose of testing ?
Thanks
j
> Signed-off-by: Nícolas F. R. A. Prado <nfraprado at collabora.com>
> ---
> src/libcamera/pipeline/rkisp1/rkisp1.cpp | 9 ++-------
> src/libcamera/pipeline/rkisp1/rkisp1_path.h | 4 ++--
> 2 files changed, 4 insertions(+), 9 deletions(-)
>
> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> index c7b93b2804c7..0dc474f343fc 100644
> --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> @@ -685,16 +685,11 @@ int PipelineHandlerRkISP1::allocateBuffers(Camera *camera)
> unsigned int ipaBufferId = 1;
> int ret;
>
> - unsigned int maxCount = std::max({
> - data->mainPathStream_.configuration().bufferCount,
> - data->selfPathStream_.configuration().bufferCount,
> - });
> -
> - ret = param_->allocateBuffers(maxCount, ¶mBuffers_);
> + ret = param_->allocateBuffers(RKISP1_MIN_BUFFER_COUNT, ¶mBuffers_);
> if (ret < 0)
> goto error;
>
> - ret = stat_->allocateBuffers(maxCount, &statBuffers_);
> + ret = stat_->allocateBuffers(RKISP1_MIN_BUFFER_COUNT, &statBuffers_);
> if (ret < 0)
> goto error;
>
> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1_path.h b/src/libcamera/pipeline/rkisp1/rkisp1_path.h
> index 13291da89dc5..4ab4c0516ebc 100644
> --- a/src/libcamera/pipeline/rkisp1/rkisp1_path.h
> +++ b/src/libcamera/pipeline/rkisp1/rkisp1_path.h
> @@ -21,6 +21,8 @@
>
> namespace libcamera {
>
> +static constexpr unsigned int RKISP1_MIN_BUFFER_COUNT = 4;
> +
> class MediaDevice;
> class V4L2Subdevice;
> struct StreamConfiguration;
> @@ -56,8 +58,6 @@ public:
> Signal<FrameBuffer *> &bufferReady() { return video_->bufferReady; }
>
> private:
> - static constexpr unsigned int RKISP1_MIN_BUFFER_COUNT = 4;
> -
> const char *name_;
> bool running_;
>
> --
> 2.31.1
>
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel at lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
More information about the libcamera-devel
mailing list