[{"id":25959,"web_url":"https://patchwork.libcamera.org/comment/25959/","msgid":"<Y4iSB4eLWh0GsjHs@pyrite.rasen.tech>","date":"2022-12-01T11:37:43","subject":"Re: [libcamera-devel] [PATCH v8 09/17] libcamera: stream: Remove\n\tbufferCount","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"On Tue, Aug 24, 2021 at 04:56:28PM -0300, Nícolas F. R. A. Prado wrote:\n> Now that the number of buffers allocated by the FrameBufferAllocator\n> helper is passed through FrameBufferAllocator::allocate() and the\n> pipelines no longer use bufferCount for internal buffer or V4L2 buffer\n> slots allocation, we no longer need to have bufferCount in the\n> StreamConfiguration, so remove it.\n> \n> Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>\n\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n\n> \n> ---\n> \n> Changes in v8:\n> - Updated the pipeline-handler guide to use MinimumRequests instead of\n>   bufferCount\n> - Removed kNumInternalBuffers as it was unused\n> \n> Changes in v6:\n> - Removed IPU3_BUFFER_COUNT as it was unused\n> \n>  Documentation/guides/pipeline-handler.rst         | 15 +++++++++------\n>  include/libcamera/stream.h                        |  2 --\n>  src/android/camera_stream.cpp                     |  2 +-\n>  src/libcamera/pipeline/ipu3/cio2.cpp              |  1 -\n>  src/libcamera/pipeline/ipu3/cio2.h                |  2 --\n>  src/libcamera/pipeline/ipu3/ipu3.cpp              |  8 --------\n>  .../pipeline/raspberrypi/raspberrypi.cpp          |  6 ------\n>  src/libcamera/pipeline/rkisp1/rkisp1_path.cpp     |  2 --\n>  src/libcamera/pipeline/rkisp1/rkisp1_path.h       |  2 --\n>  src/libcamera/pipeline/simple/converter.cpp       |  3 ---\n>  src/libcamera/pipeline/simple/converter.h         |  3 ---\n>  src/libcamera/pipeline/simple/simple.cpp          |  6 +-----\n>  src/libcamera/pipeline/uvcvideo/uvcvideo.cpp      |  3 ---\n>  src/libcamera/pipeline/vimc/vimc.cpp              |  3 ---\n>  src/libcamera/stream.cpp                          | 12 +++---------\n>  test/camera/buffer_import.cpp                     | 10 +++++++---\n>  test/libtest/buffer_source.cpp                    |  4 ++--\n>  test/libtest/buffer_source.h                      |  2 +-\n>  test/v4l2_videodevice/buffer_cache.cpp            |  3 +--\n>  19 files changed, 25 insertions(+), 64 deletions(-)\n> \n> diff --git a/Documentation/guides/pipeline-handler.rst b/Documentation/guides/pipeline-handler.rst\n> index 2a69ef7d7461..3ee79b98c4dc 100644\n> --- a/Documentation/guides/pipeline-handler.rst\n> +++ b/Documentation/guides/pipeline-handler.rst\n> @@ -826,14 +826,12 @@ As well as a list of supported StreamFormats, the StreamConfiguration is also\n>  expected to provide an initialsed default configuration. This may be arbitrary,\n>  but depending on use case you may which to select an output that matches the\n>  Sensor output, or prefer a pixelformat which might provide higher performance on\n> -the hardware. The bufferCount represents the number of buffers required to\n> -support functional continuous processing on this stream.\n> +the hardware.\n>  \n>  .. code-block:: cpp\n>  \n>     cfg.pixelFormat = formats::BGR888;\n>     cfg.size = { 1280, 720 };\n> -   cfg.bufferCount = 4;\n>  \n>  Finally add each ``StreamConfiguration`` generated to the\n>  ``CameraConfiguration``, and ensure that it has been validated before returning\n> @@ -899,8 +897,6 @@ Add the following function implementation to your file:\n>                    status = Adjusted;\n>             }\n>  \n> -           cfg.bufferCount = 4;\n> -\n>             return status;\n>     }\n>  \n> @@ -1144,13 +1140,20 @@ is performed by using the ``V4L2VideoDevice`` API, which provides an\n>  \n>  .. _FrameBuffer: http://libcamera.org/api-html/classlibcamera_1_1FrameBuffer.html\n>  \n> +The number passed to ``importBuffers()`` should be at least equal to the value\n> +of the ``MinimumRequests`` property in order to be possible to queue enough\n> +buffers to the video device that frames won't be dropped during capture. A\n> +bigger value can be advantageous to reduce the thrashing of dma-buf file\n> +descriptor mappings in case the application queues more requests and therefore\n> +improve performance, but for simplicity we'll just use ``MinimumRequests``.\n> +\n>  Implement the pipeline handler ``start()`` function by replacing the stub\n>  version with the following code:\n>  \n>  .. code-block:: c++\n>  \n>     VividCameraData *data = cameraData(camera);\n> -   unsigned int count = data->stream_.configuration().bufferCount;\n> +   unsigned int count = camera->properties().get(properties::MinimumRequests);\n>  \n>     int ret = data->video_->importBuffers(count);\n>     if (ret < 0)\n> diff --git a/include/libcamera/stream.h b/include/libcamera/stream.h\n> index 0c55e7164592..b25f0059f2f1 100644\n> --- a/include/libcamera/stream.h\n> +++ b/include/libcamera/stream.h\n> @@ -45,8 +45,6 @@ struct StreamConfiguration {\n>  \tunsigned int stride;\n>  \tunsigned int frameSize;\n>  \n> -\tunsigned int bufferCount;\n> -\n>  \tStream *stream() const { return stream_; }\n>  \tvoid setStream(Stream *stream) { stream_ = stream; }\n>  \tconst StreamFormats &formats() const { return formats_; }\n> diff --git a/src/android/camera_stream.cpp b/src/android/camera_stream.cpp\n> index 29be1ac5ca4f..d9ee8842938f 100644\n> --- a/src/android/camera_stream.cpp\n> +++ b/src/android/camera_stream.cpp\n> @@ -96,7 +96,7 @@ int CameraStream::configure()\n>  \t\t\tbuffers_.push_back(frameBuffer.get());\n>  \t}\n>  \n> -\tcamera3Stream_->max_buffers = configuration().bufferCount;\n> +\tcamera3Stream_->max_buffers = bufferCount;\n>  \n>  \treturn 0;\n>  }\n> diff --git a/src/libcamera/pipeline/ipu3/cio2.cpp b/src/libcamera/pipeline/ipu3/cio2.cpp\n> index b940a0f6d7d6..c555ef5ffd27 100644\n> --- a/src/libcamera/pipeline/ipu3/cio2.cpp\n> +++ b/src/libcamera/pipeline/ipu3/cio2.cpp\n> @@ -214,7 +214,6 @@ StreamConfiguration CIO2Device::generateConfiguration(Size size) const\n>  \n>  \tcfg.size = sensorFormat.size;\n>  \tcfg.pixelFormat = mbusCodesToPixelFormat.at(sensorFormat.mbus_code);\n> -\tcfg.bufferCount = CIO2_BUFFER_COUNT;\n>  \n>  \treturn cfg;\n>  }\n> diff --git a/src/libcamera/pipeline/ipu3/cio2.h b/src/libcamera/pipeline/ipu3/cio2.h\n> index ab915b6a16fa..50ccb20765d3 100644\n> --- a/src/libcamera/pipeline/ipu3/cio2.h\n> +++ b/src/libcamera/pipeline/ipu3/cio2.h\n> @@ -30,8 +30,6 @@ struct StreamConfiguration;\n>  class CIO2Device\n>  {\n>  public:\n> -\tstatic constexpr unsigned int CIO2_BUFFER_COUNT = 4;\n> -\n>  \tCIO2Device();\n>  \n>  \tstd::vector<PixelFormat> formats() const;\n> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> index cc519ae6adbe..4a60f00ecf8b 100644\n> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> @@ -39,7 +39,6 @@ namespace libcamera {\n>  \n>  LOG_DEFINE_CATEGORY(IPU3)\n>  \n> -static constexpr unsigned int IPU3_BUFFER_COUNT = 4;\n>  static constexpr unsigned int IPU3_MAX_STREAMS = 3;\n>  static const Size IMGU_OUTPUT_MIN_SIZE = { 2, 2 };\n>  static const Size IMGU_OUTPUT_MAX_SIZE = { 4480, 34004 };\n> @@ -313,7 +312,6 @@ CameraConfiguration::Status IPU3CameraConfiguration::validate()\n>  \t\t\t/* Initialize the RAW stream with the CIO2 configuration. */\n>  \t\t\tcfg->size = cio2Configuration_.size;\n>  \t\t\tcfg->pixelFormat = cio2Configuration_.pixelFormat;\n> -\t\t\tcfg->bufferCount = cio2Configuration_.bufferCount;\n>  \t\t\tcfg->stride = info.stride(cfg->size.width, 0, 64);\n>  \t\t\tcfg->frameSize = info.frameSize(cfg->size, 64);\n>  \t\t\tcfg->setStream(const_cast<Stream *>(&data_->rawStream_));\n> @@ -357,7 +355,6 @@ CameraConfiguration::Status IPU3CameraConfiguration::validate()\n>  \t\t\t\t\t      IMGU_OUTPUT_HEIGHT_ALIGN);\n>  \n>  \t\t\tcfg->pixelFormat = formats::NV12;\n> -\t\t\tcfg->bufferCount = IPU3_BUFFER_COUNT;\n>  \t\t\tcfg->stride = info.stride(cfg->size.width, 0, 1);\n>  \t\t\tcfg->frameSize = info.frameSize(cfg->size, 1);\n>  \n> @@ -425,7 +422,6 @@ CameraConfiguration *PipelineHandlerIPU3::generateConfiguration(Camera *camera,\n>  \tSize sensorResolution = data->cio2_.sensor()->resolution();\n>  \tfor (const StreamRole role : roles) {\n>  \t\tstd::map<PixelFormat, std::vector<SizeRange>> streamFormats;\n> -\t\tunsigned int bufferCount;\n>  \t\tPixelFormat pixelFormat;\n>  \t\tSize size;\n>  \n> @@ -446,7 +442,6 @@ CameraConfiguration *PipelineHandlerIPU3::generateConfiguration(Camera *camera,\n>  \t\t\tsize.height = utils::alignDown(size.height - 1,\n>  \t\t\t\t\t\t       IMGU_OUTPUT_HEIGHT_MARGIN);\n>  \t\t\tpixelFormat = formats::NV12;\n> -\t\t\tbufferCount = IPU3_BUFFER_COUNT;\n>  \t\t\tstreamFormats[pixelFormat] = { { IMGU_OUTPUT_MIN_SIZE, size } };\n>  \n>  \t\t\tbreak;\n> @@ -456,7 +451,6 @@ CameraConfiguration *PipelineHandlerIPU3::generateConfiguration(Camera *camera,\n>  \t\t\t\tdata->cio2_.generateConfiguration(sensorResolution);\n>  \t\t\tpixelFormat = cio2Config.pixelFormat;\n>  \t\t\tsize = cio2Config.size;\n> -\t\t\tbufferCount = cio2Config.bufferCount;\n>  \n>  \t\t\tfor (const PixelFormat &format : data->cio2_.formats())\n>  \t\t\t\tstreamFormats[format] = data->cio2_.sizes();\n> @@ -475,7 +469,6 @@ CameraConfiguration *PipelineHandlerIPU3::generateConfiguration(Camera *camera,\n>  \t\t\t\t\t       .alignedDownTo(IMGU_OUTPUT_WIDTH_ALIGN,\n>  \t\t\t\t\t\t\t      IMGU_OUTPUT_HEIGHT_ALIGN);\n>  \t\t\tpixelFormat = formats::NV12;\n> -\t\t\tbufferCount = IPU3_BUFFER_COUNT;\n>  \t\t\tstreamFormats[pixelFormat] = { { IMGU_OUTPUT_MIN_SIZE, size } };\n>  \n>  \t\t\tbreak;\n> @@ -492,7 +485,6 @@ CameraConfiguration *PipelineHandlerIPU3::generateConfiguration(Camera *camera,\n>  \t\tStreamConfiguration cfg(formats);\n>  \t\tcfg.size = size;\n>  \t\tcfg.pixelFormat = pixelFormat;\n> -\t\tcfg.bufferCount = bufferCount;\n>  \t\tconfig->addConfiguration(cfg);\n>  \t}\n>  \n> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> index a7c1cc1d5001..12d6729044e6 100644\n> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> @@ -492,7 +492,6 @@ CameraConfiguration *PipelineHandlerRPi::generateConfiguration(Camera *camera,\n>  \tRPiCameraData *data = cameraData(camera);\n>  \tCameraConfiguration *config = new RPiCameraConfiguration(data);\n>  \tV4L2DeviceFormat sensorFormat;\n> -\tunsigned int bufferCount;\n>  \tPixelFormat pixelFormat;\n>  \tV4L2VideoDevice::Formats fmts;\n>  \tSize size;\n> @@ -510,7 +509,6 @@ CameraConfiguration *PipelineHandlerRPi::generateConfiguration(Camera *camera,\n>  \t\t\tsensorFormat = findBestMode(fmts, size);\n>  \t\t\tpixelFormat = sensorFormat.fourcc.toPixelFormat();\n>  \t\t\tASSERT(pixelFormat.isValid());\n> -\t\t\tbufferCount = 2;\n>  \t\t\trawCount++;\n>  \t\t\tbreak;\n>  \n> @@ -519,7 +517,6 @@ CameraConfiguration *PipelineHandlerRPi::generateConfiguration(Camera *camera,\n>  \t\t\tpixelFormat = formats::NV12;\n>  \t\t\t/* Return the largest sensor resolution. */\n>  \t\t\tsize = data->sensor_->resolution();\n> -\t\t\tbufferCount = 1;\n>  \t\t\toutCount++;\n>  \t\t\tbreak;\n>  \n> @@ -535,7 +532,6 @@ CameraConfiguration *PipelineHandlerRPi::generateConfiguration(Camera *camera,\n>  \t\t\tfmts = data->isp_[Isp::Output0].dev()->formats();\n>  \t\t\tpixelFormat = formats::YUV420;\n>  \t\t\tsize = { 1920, 1080 };\n> -\t\t\tbufferCount = 4;\n>  \t\t\toutCount++;\n>  \t\t\tbreak;\n>  \n> @@ -543,7 +539,6 @@ CameraConfiguration *PipelineHandlerRPi::generateConfiguration(Camera *camera,\n>  \t\t\tfmts = data->isp_[Isp::Output0].dev()->formats();\n>  \t\t\tpixelFormat = formats::ARGB8888;\n>  \t\t\tsize = { 800, 600 };\n> -\t\t\tbufferCount = 4;\n>  \t\t\toutCount++;\n>  \t\t\tbreak;\n>  \n> @@ -573,7 +568,6 @@ CameraConfiguration *PipelineHandlerRPi::generateConfiguration(Camera *camera,\n>  \t\tStreamConfiguration cfg(formats);\n>  \t\tcfg.size = size;\n>  \t\tcfg.pixelFormat = pixelFormat;\n> -\t\tcfg.bufferCount = bufferCount;\n>  \t\tconfig->addConfiguration(cfg);\n>  \t}\n>  \n> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp\n> index 515f4be16d7e..9bbdf951d9b6 100644\n> --- a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp\n> +++ b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp\n> @@ -61,7 +61,6 @@ StreamConfiguration RkISP1Path::generateConfiguration(const Size &resolution)\n>  \tStreamConfiguration cfg(formats);\n>  \tcfg.pixelFormat = formats::NV12;\n>  \tcfg.size = maxResolution;\n> -\tcfg.bufferCount = RKISP1_BUFFER_COUNT;\n>  \n>  \treturn cfg;\n>  }\n> @@ -77,7 +76,6 @@ CameraConfiguration::Status RkISP1Path::validate(StreamConfiguration *cfg)\n>  \n>  \tcfg->size.boundTo(maxResolution_);\n>  \tcfg->size.expandTo(minResolution_);\n> -\tcfg->bufferCount = RKISP1_BUFFER_COUNT;\n>  \n>  \tV4L2DeviceFormat format;\n>  \tformat.fourcc = video_->toV4L2PixelFormat(cfg->pixelFormat);\n> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1_path.h b/src/libcamera/pipeline/rkisp1/rkisp1_path.h\n> index 267d8f988ace..dd54fc609da6 100644\n> --- a/src/libcamera/pipeline/rkisp1/rkisp1_path.h\n> +++ b/src/libcamera/pipeline/rkisp1/rkisp1_path.h\n> @@ -57,8 +57,6 @@ public:\n>  \tSignal<FrameBuffer *> &bufferReady() { return video_->bufferReady; }\n>  \n>  private:\n> -\tstatic constexpr unsigned int RKISP1_BUFFER_COUNT = 4;\n> -\n>  \tconst char *name_;\n>  \tbool running_;\n>  \n> diff --git a/src/libcamera/pipeline/simple/converter.cpp b/src/libcamera/pipeline/simple/converter.cpp\n> index 3133b3dbda07..46ab503b7c38 100644\n> --- a/src/libcamera/pipeline/simple/converter.cpp\n> +++ b/src/libcamera/pipeline/simple/converter.cpp\n> @@ -89,9 +89,6 @@ int SimpleConverter::Stream::configure(const StreamConfiguration &inputCfg,\n>  \t\treturn -EINVAL;\n>  \t}\n>  \n> -\tinputBufferCount_ = inputCfg.bufferCount;\n> -\toutputBufferCount_ = outputCfg.bufferCount;\n> -\n>  \treturn 0;\n>  }\n>  \n> diff --git a/src/libcamera/pipeline/simple/converter.h b/src/libcamera/pipeline/simple/converter.h\n> index deb3df0d08df..365b99e9853e 100644\n> --- a/src/libcamera/pipeline/simple/converter.h\n> +++ b/src/libcamera/pipeline/simple/converter.h\n> @@ -86,9 +86,6 @@ private:\n>  \t\tSimpleConverter *converter_;\n>  \t\tunsigned int index_;\n>  \t\tstd::unique_ptr<V4L2M2MDevice> m2m_;\n> -\n> -\t\tunsigned int inputBufferCount_;\n> -\t\tunsigned int outputBufferCount_;\n>  \t};\n>  \n>  \tstd::string deviceNode_;\n> diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\n> index d0a658a23be8..6deba5d7dd61 100644\n> --- a/src/libcamera/pipeline/simple/simple.cpp\n> +++ b/src/libcamera/pipeline/simple/simple.cpp\n> @@ -252,7 +252,6 @@ protected:\n>  \tint queueRequestDevice(Camera *camera, Request *request) override;\n>  \n>  private:\n> -\tstatic constexpr unsigned int kNumInternalBuffers = 3;\n>  \tstatic constexpr unsigned int kSimpleBufferSlotCount = 16;\n>  \n>  \tSimpleCameraData *cameraData(Camera *camera)\n> @@ -638,7 +637,7 @@ CameraConfiguration::Status SimpleCameraConfiguration::validate()\n>  \t\t    cfg.size != pipeConfig_->captureSize)\n>  \t\t\tneedConversion_ = true;\n>  \n> -\t\t/* Set the stride, frameSize and bufferCount. */\n> +\t\t/* Set the stride and frameSize. */\n>  \t\tif (needConversion_) {\n>  \t\t\tstd::tie(cfg.stride, cfg.frameSize) =\n>  \t\t\t\tconverter->strideAndFrameSize(cfg.pixelFormat, cfg.size);\n> @@ -656,8 +655,6 @@ CameraConfiguration::Status SimpleCameraConfiguration::validate()\n>  \t\t\tcfg.stride = format.planes[0].bpl;\n>  \t\t\tcfg.frameSize = format.planes[0].size;\n>  \t\t}\n> -\n> -\t\tcfg.bufferCount = 3;\n>  \t}\n>  \n>  \treturn status;\n> @@ -780,7 +777,6 @@ int SimplePipelineHandler::configure(Camera *camera, CameraConfiguration *c)\n>  \tinputCfg.pixelFormat = pipeConfig->captureFormat;\n>  \tinputCfg.size = pipeConfig->captureSize;\n>  \tinputCfg.stride = captureFormat.planes[0].bpl;\n> -\tinputCfg.bufferCount = kNumInternalBuffers;\n>  \n>  \t/* Set the MinimumRequests property. */\n>  \tunsigned int minimumRequests;\n> diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> index c210cf57750f..5977312a795d 100644\n> --- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> +++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> @@ -150,8 +150,6 @@ CameraConfiguration::Status UVCCameraConfiguration::validate()\n>  \t\tstatus = Adjusted;\n>  \t}\n>  \n> -\tcfg.bufferCount = 4;\n> -\n>  \tV4L2DeviceFormat format;\n>  \tformat.fourcc = data_->video_->toV4L2PixelFormat(cfg.pixelFormat);\n>  \tformat.size = cfg.size;\n> @@ -193,7 +191,6 @@ CameraConfiguration *PipelineHandlerUVC::generateConfiguration(Camera *camera,\n>  \n>  \tcfg.pixelFormat = formats.pixelformats().front();\n>  \tcfg.size = formats.sizes(cfg.pixelFormat).back();\n> -\tcfg.bufferCount = 4;\n>  \n>  \tconfig->addConfiguration(cfg);\n>  \n> diff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp\n> index d2943f61a745..ad71bfc67228 100644\n> --- a/src/libcamera/pipeline/vimc/vimc.cpp\n> +++ b/src/libcamera/pipeline/vimc/vimc.cpp\n> @@ -170,8 +170,6 @@ CameraConfiguration::Status VimcCameraConfiguration::validate()\n>  \t\tstatus = Adjusted;\n>  \t}\n>  \n> -\tcfg.bufferCount = 4;\n> -\n>  \tV4L2DeviceFormat format;\n>  \tformat.fourcc = data_->video_->toV4L2PixelFormat(cfg.pixelFormat);\n>  \tformat.size = cfg.size;\n> @@ -227,7 +225,6 @@ CameraConfiguration *PipelineHandlerVimc::generateConfiguration(Camera *camera,\n>  \n>  \tcfg.pixelFormat = formats::BGR888;\n>  \tcfg.size = { 1920, 1080 };\n> -\tcfg.bufferCount = 4;\n>  \n>  \tconfig->addConfiguration(cfg);\n>  \n> diff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp\n> index b421e17ecb36..d4cc0fafb76f 100644\n> --- a/src/libcamera/stream.cpp\n> +++ b/src/libcamera/stream.cpp\n> @@ -280,8 +280,7 @@ SizeRange StreamFormats::range(const PixelFormat &pixelformat) const\n>   * handlers provide StreamFormats.\n>   */\n>  StreamConfiguration::StreamConfiguration()\n> -\t: pixelFormat(0), stride(0), frameSize(0), bufferCount(0),\n> -\t  stream_(nullptr)\n> +\t: pixelFormat(0), stride(0), frameSize(0), stream_(nullptr)\n>  {\n>  }\n>  \n> @@ -289,8 +288,8 @@ StreamConfiguration::StreamConfiguration()\n>   * \\brief Construct a configuration with stream formats\n>   */\n>  StreamConfiguration::StreamConfiguration(const StreamFormats &formats)\n> -\t: pixelFormat(0), stride(0), frameSize(0), bufferCount(0),\n> -\t  stream_(nullptr), formats_(formats)\n> +\t: pixelFormat(0), stride(0), frameSize(0), stream_(nullptr),\n> +\t  formats_(formats)\n>  {\n>  }\n>  \n> @@ -324,11 +323,6 @@ StreamConfiguration::StreamConfiguration(const StreamFormats &formats)\n>   * validating the configuration with a call to CameraConfiguration::validate().\n>   */\n>  \n> -/**\n> - * \\var StreamConfiguration::bufferCount\n> - * \\brief Requested number of buffers to allocate for the stream\n> - */\n> -\n>  /**\n>   * \\fn StreamConfiguration::stream()\n>   * \\brief Retrieve the stream associated with the configuration\n> diff --git a/test/camera/buffer_import.cpp b/test/camera/buffer_import.cpp\n> index c504ea09e64b..67ac0ad20e15 100644\n> --- a/test/camera/buffer_import.cpp\n> +++ b/test/camera/buffer_import.cpp\n> @@ -16,6 +16,8 @@\n>  #include <libcamera/base/thread.h>\n>  #include <libcamera/base/timer.h>\n>  \n> +#include <libcamera/property_ids.h>\n> +\n>  #include \"libcamera/internal/device_enumerator.h\"\n>  #include \"libcamera/internal/media_device.h\"\n>  #include \"libcamera/internal/v4l2_videodevice.h\"\n> @@ -92,10 +94,12 @@ protected:\n>  \t\t\treturn TestFail;\n>  \t\t}\n>  \n> +\t\tunsigned int bufferCount = camera_->properties().get(properties::MinimumRequests);\n> +\n>  \t\tStream *stream = cfg.stream();\n>  \n>  \t\tBufferSource source;\n> -\t\tint ret = source.allocate(cfg);\n> +\t\tint ret = source.allocate(cfg, bufferCount);\n>  \t\tif (ret != TestPass)\n>  \t\t\treturn ret;\n>  \n> @@ -139,10 +143,10 @@ protected:\n>  \t\twhile (timer.isRunning())\n>  \t\t\tdispatcher->processEvents();\n>  \n> -\t\tif (completeRequestsCount_ < cfg.bufferCount * 2) {\n> +\t\tif (completeRequestsCount_ < bufferCount * 2) {\n>  \t\t\tstd::cout << \"Failed to capture enough frames (got \"\n>  \t\t\t\t  << completeRequestsCount_ << \" expected at least \"\n> -\t\t\t\t  << cfg.bufferCount * 2 << \")\" << std::endl;\n> +\t\t\t\t  << bufferCount * 2 << \")\" << std::endl;\n>  \t\t\treturn TestFail;\n>  \t\t}\n>  \n> diff --git a/test/libtest/buffer_source.cpp b/test/libtest/buffer_source.cpp\n> index 73563f2fc39d..c3d5286a2462 100644\n> --- a/test/libtest/buffer_source.cpp\n> +++ b/test/libtest/buffer_source.cpp\n> @@ -24,7 +24,7 @@ BufferSource::~BufferSource()\n>  \t\tmedia_->release();\n>  }\n>  \n> -int BufferSource::allocate(const StreamConfiguration &config)\n> +int BufferSource::allocate(const StreamConfiguration &config, unsigned int count)\n>  {\n>  \t/* Locate and open the video device. */\n>  \tstd::string videoDeviceName = \"vivid-000-vid-out\";\n> @@ -77,7 +77,7 @@ int BufferSource::allocate(const StreamConfiguration &config)\n>  \t\treturn TestFail;\n>  \t}\n>  \n> -\tif (video->allocateBuffers(config.bufferCount, &buffers_) < 0) {\n> +\tif (video->allocateBuffers(count, &buffers_) < 0) {\n>  \t\tstd::cout << \"Failed to allocate buffers\" << std::endl;\n>  \t\treturn TestFail;\n>  \t}\n> diff --git a/test/libtest/buffer_source.h b/test/libtest/buffer_source.h\n> index 14b4770e8d8a..6a18e269a575 100644\n> --- a/test/libtest/buffer_source.h\n> +++ b/test/libtest/buffer_source.h\n> @@ -20,7 +20,7 @@ public:\n>  \tBufferSource();\n>  \t~BufferSource();\n>  \n> -\tint allocate(const StreamConfiguration &config);\n> +\tint allocate(const StreamConfiguration &config, unsigned int count);\n>  \tconst std::vector<std::unique_ptr<FrameBuffer>> &buffers();\n>  \n>  private:\n> diff --git a/test/v4l2_videodevice/buffer_cache.cpp b/test/v4l2_videodevice/buffer_cache.cpp\n> index b3f2bec11783..6c8183800d0b 100644\n> --- a/test/v4l2_videodevice/buffer_cache.cpp\n> +++ b/test/v4l2_videodevice/buffer_cache.cpp\n> @@ -145,10 +145,9 @@ public:\n>  \t\tStreamConfiguration cfg;\n>  \t\tcfg.pixelFormat = formats::YUYV;\n>  \t\tcfg.size = Size(600, 800);\n> -\t\tcfg.bufferCount = numBuffers;\n>  \n>  \t\tBufferSource source;\n> -\t\tint ret = source.allocate(cfg);\n> +\t\tint ret = source.allocate(cfg, numBuffers);\n>  \t\tif (ret != TestPass)\n>  \t\t\treturn ret;\n>  \n> -- \n> 2.33.0\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 6189ABDE6B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  1 Dec 2022 11:37:52 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id BA30B6333F;\n\tThu,  1 Dec 2022 12:37:51 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 249DE63335\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  1 Dec 2022 12:37:50 +0100 (CET)","from pyrite.rasen.tech (h175-177-042-159.catv02.itscom.jp\n\t[175.177.42.159])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 3D4C933F;\n\tThu,  1 Dec 2022 12:37:48 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1669894671;\n\tbh=3UXEiiLWKPMnDXNnJNFFaE1PbgFp4com39oTMpnuvjs=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=HI8LpiBVLjfb9y42FqX+LTDvGPJEzwavArBT5wDHweMCj1Dr7Kl1evpC0SK4JtuRm\n\t94lHyIZIP+7CezY/VI4fQ34D3Ax3WMpywuI5Td2zrzqp/wojwiqE17DGOkoFn0rr+5\n\tnm+4JZkPHKQ6an04ju5XXCS24wdQGWiYaF7ezOAa4xYo4qItIAoeLbB3mXbguChbaX\n\ttBkBuCsXgiHz9NNblx/osWN/GHJrxY5P1apIF48zYFC00U+LaPZT3hWLl4TrNCq6k0\n\tb/xlFHsRxQ6u/bW5cmZkT2E2SWZ1YPLre83nZPdfmJr2dTincIxc+26VawmFOlrPrV\n\tKOkV9BoAuFYhg==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1669894669;\n\tbh=3UXEiiLWKPMnDXNnJNFFaE1PbgFp4com39oTMpnuvjs=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=ftq8xnVlobcjz84xnqMIMZa+iFR8ZvEOXIzzLQT/yVFPWtgCh2e7Txp3uqOJfgolZ\n\tz2o1+c5DLu7Qs4743SEMT5CDyuWZF5KZNfZO3Qv31BGuyf3zE9DhRe4rLXDFAtYno6\n\tury87Y+hkW2/YtPVdrwUuZ4suegiZE/DaUdwF7ZM="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"ftq8xnVl\"; dkim-atps=neutral","Date":"Thu, 1 Dec 2022 20:37:43 +0900","To":"=?iso-8859-1?q?N=EDcolas_F=2E_R=2E_A=2E?= Prado <nfraprado@collabora.com>","Message-ID":"<Y4iSB4eLWh0GsjHs@pyrite.rasen.tech>","References":"<20210824195636.1110845-1-nfraprado@collabora.com>\n\t<20210824195636.1110845-10-nfraprado@collabora.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20210824195636.1110845-10-nfraprado@collabora.com>","Subject":"Re: [libcamera-devel] [PATCH v8 09/17] libcamera: stream: Remove\n\tbufferCount","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Paul Elder via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Paul Elder <paul.elder@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org, kernel@collabora.com,\n\t=?iso-8859-1?q?Andr=E9?= Almeida <andrealmeid@collabora.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":25964,"web_url":"https://patchwork.libcamera.org/comment/25964/","msgid":"<CAEmqJPqHfiNczEFiiXdJ2t6Gu=9NT78s=XD0kAmBRU6ZctzPug@mail.gmail.com>","date":"2022-12-01T12:58:48","subject":"Re: [libcamera-devel] [PATCH v8 09/17] libcamera: stream: Remove\n\tbufferCount","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"content":"HI Nicolas,\n\nThank you for your work.\n\nOn Tue, 24 Aug 2021 at 20:57, Nícolas F. R. A. Prado <\nnfraprado@collabora.com> wrote:\n\n> Now that the number of buffers allocated by the FrameBufferAllocator\n> helper is passed through FrameBufferAllocator::allocate() and the\n> pipelines no longer use bufferCount for internal buffer or V4L2 buffer\n> slots allocation, we no longer need to have bufferCount in the\n> StreamConfiguration, so remove it.\n>\n\nI've tried to pull this series into my tree to have a closer look, but\nthere are many\nmerge conflicts.  Am I missing some patches on-top of master that this\nseries needs?\n\nRegarding the change, It looks like this will fail compilation with the\nRaspberry Pi\npipeline handler.  We use bufferCount\nin PipelineHandlerRPi::prepareBuffers() and\nit does not seem to be removed.  I'm curious how we can update that logic,\nas our\ninternal buffer allocation routine needs to know the external buffer count\nfor the steram.\n\nThanks,\nNaush\n\n\n\n> Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>\n>\n> ---\n>\n> Changes in v8:\n> - Updated the pipeline-handler guide to use MinimumRequests instead of\n>   bufferCount\n> - Removed kNumInternalBuffers as it was unused\n>\n> Changes in v6:\n> - Removed IPU3_BUFFER_COUNT as it was unused\n>\n>  Documentation/guides/pipeline-handler.rst         | 15 +++++++++------\n>  include/libcamera/stream.h                        |  2 --\n>  src/android/camera_stream.cpp                     |  2 +-\n>  src/libcamera/pipeline/ipu3/cio2.cpp              |  1 -\n>  src/libcamera/pipeline/ipu3/cio2.h                |  2 --\n>  src/libcamera/pipeline/ipu3/ipu3.cpp              |  8 --------\n>  .../pipeline/raspberrypi/raspberrypi.cpp          |  6 ------\n>  src/libcamera/pipeline/rkisp1/rkisp1_path.cpp     |  2 --\n>  src/libcamera/pipeline/rkisp1/rkisp1_path.h       |  2 --\n>  src/libcamera/pipeline/simple/converter.cpp       |  3 ---\n>  src/libcamera/pipeline/simple/converter.h         |  3 ---\n>  src/libcamera/pipeline/simple/simple.cpp          |  6 +-----\n>  src/libcamera/pipeline/uvcvideo/uvcvideo.cpp      |  3 ---\n>  src/libcamera/pipeline/vimc/vimc.cpp              |  3 ---\n>  src/libcamera/stream.cpp                          | 12 +++---------\n>  test/camera/buffer_import.cpp                     | 10 +++++++---\n>  test/libtest/buffer_source.cpp                    |  4 ++--\n>  test/libtest/buffer_source.h                      |  2 +-\n>  test/v4l2_videodevice/buffer_cache.cpp            |  3 +--\n>  19 files changed, 25 insertions(+), 64 deletions(-)\n>\n> diff --git a/Documentation/guides/pipeline-handler.rst\n> b/Documentation/guides/pipeline-handler.rst\n> index 2a69ef7d7461..3ee79b98c4dc 100644\n> --- a/Documentation/guides/pipeline-handler.rst\n> +++ b/Documentation/guides/pipeline-handler.rst\n> @@ -826,14 +826,12 @@ As well as a list of supported StreamFormats, the\n> StreamConfiguration is also\n>  expected to provide an initialsed default configuration. This may be\n> arbitrary,\n>  but depending on use case you may which to select an output that matches\n> the\n>  Sensor output, or prefer a pixelformat which might provide higher\n> performance on\n> -the hardware. The bufferCount represents the number of buffers required to\n> -support functional continuous processing on this stream.\n> +the hardware.\n>\n>  .. code-block:: cpp\n>\n>     cfg.pixelFormat = formats::BGR888;\n>     cfg.size = { 1280, 720 };\n> -   cfg.bufferCount = 4;\n>\n>  Finally add each ``StreamConfiguration`` generated to the\n>  ``CameraConfiguration``, and ensure that it has been validated before\n> returning\n> @@ -899,8 +897,6 @@ Add the following function implementation to your file:\n>                    status = Adjusted;\n>             }\n>\n> -           cfg.bufferCount = 4;\n> -\n>             return status;\n>     }\n>\n> @@ -1144,13 +1140,20 @@ is performed by using the ``V4L2VideoDevice`` API,\n> which provides an\n>\n>  .. _FrameBuffer:\n> http://libcamera.org/api-html/classlibcamera_1_1FrameBuffer.html\n>\n> +The number passed to ``importBuffers()`` should be at least equal to the\n> value\n> +of the ``MinimumRequests`` property in order to be possible to queue\n> enough\n> +buffers to the video device that frames won't be dropped during capture. A\n> +bigger value can be advantageous to reduce the thrashing of dma-buf file\n> +descriptor mappings in case the application queues more requests and\n> therefore\n> +improve performance, but for simplicity we'll just use\n> ``MinimumRequests``.\n> +\n>  Implement the pipeline handler ``start()`` function by replacing the stub\n>  version with the following code:\n>\n>  .. code-block:: c++\n>\n>     VividCameraData *data = cameraData(camera);\n> -   unsigned int count = data->stream_.configuration().bufferCount;\n> +   unsigned int count =\n> camera->properties().get(properties::MinimumRequests);\n>\n>     int ret = data->video_->importBuffers(count);\n>     if (ret < 0)\n> diff --git a/include/libcamera/stream.h b/include/libcamera/stream.h\n> index 0c55e7164592..b25f0059f2f1 100644\n> --- a/include/libcamera/stream.h\n> +++ b/include/libcamera/stream.h\n> @@ -45,8 +45,6 @@ struct StreamConfiguration {\n>         unsigned int stride;\n>         unsigned int frameSize;\n>\n> -       unsigned int bufferCount;\n> -\n>         Stream *stream() const { return stream_; }\n>         void setStream(Stream *stream) { stream_ = stream; }\n>         const StreamFormats &formats() const { return formats_; }\n> diff --git a/src/android/camera_stream.cpp b/src/android/camera_stream.cpp\n> index 29be1ac5ca4f..d9ee8842938f 100644\n> --- a/src/android/camera_stream.cpp\n> +++ b/src/android/camera_stream.cpp\n> @@ -96,7 +96,7 @@ int CameraStream::configure()\n>                         buffers_.push_back(frameBuffer.get());\n>         }\n>\n> -       camera3Stream_->max_buffers = configuration().bufferCount;\n> +       camera3Stream_->max_buffers = bufferCount;\n>\n>         return 0;\n>  }\n> diff --git a/src/libcamera/pipeline/ipu3/cio2.cpp\n> b/src/libcamera/pipeline/ipu3/cio2.cpp\n> index b940a0f6d7d6..c555ef5ffd27 100644\n> --- a/src/libcamera/pipeline/ipu3/cio2.cpp\n> +++ b/src/libcamera/pipeline/ipu3/cio2.cpp\n> @@ -214,7 +214,6 @@ StreamConfiguration\n> CIO2Device::generateConfiguration(Size size) const\n>\n>         cfg.size = sensorFormat.size;\n>         cfg.pixelFormat =\n> mbusCodesToPixelFormat.at(sensorFormat.mbus_code);\n> -       cfg.bufferCount = CIO2_BUFFER_COUNT;\n>\n>         return cfg;\n>  }\n> diff --git a/src/libcamera/pipeline/ipu3/cio2.h\n> b/src/libcamera/pipeline/ipu3/cio2.h\n> index ab915b6a16fa..50ccb20765d3 100644\n> --- a/src/libcamera/pipeline/ipu3/cio2.h\n> +++ b/src/libcamera/pipeline/ipu3/cio2.h\n> @@ -30,8 +30,6 @@ struct StreamConfiguration;\n>  class CIO2Device\n>  {\n>  public:\n> -       static constexpr unsigned int CIO2_BUFFER_COUNT = 4;\n> -\n>         CIO2Device();\n>\n>         std::vector<PixelFormat> formats() const;\n> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> index cc519ae6adbe..4a60f00ecf8b 100644\n> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> @@ -39,7 +39,6 @@ namespace libcamera {\n>\n>  LOG_DEFINE_CATEGORY(IPU3)\n>\n> -static constexpr unsigned int IPU3_BUFFER_COUNT = 4;\n>  static constexpr unsigned int IPU3_MAX_STREAMS = 3;\n>  static const Size IMGU_OUTPUT_MIN_SIZE = { 2, 2 };\n>  static const Size IMGU_OUTPUT_MAX_SIZE = { 4480, 34004 };\n> @@ -313,7 +312,6 @@ CameraConfiguration::Status\n> IPU3CameraConfiguration::validate()\n>                         /* Initialize the RAW stream with the CIO2\n> configuration. */\n>                         cfg->size = cio2Configuration_.size;\n>                         cfg->pixelFormat = cio2Configuration_.pixelFormat;\n> -                       cfg->bufferCount = cio2Configuration_.bufferCount;\n>                         cfg->stride = info.stride(cfg->size.width, 0, 64);\n>                         cfg->frameSize = info.frameSize(cfg->size, 64);\n>                         cfg->setStream(const_cast<Stream\n> *>(&data_->rawStream_));\n> @@ -357,7 +355,6 @@ CameraConfiguration::Status\n> IPU3CameraConfiguration::validate()\n>                                               IMGU_OUTPUT_HEIGHT_ALIGN);\n>\n>                         cfg->pixelFormat = formats::NV12;\n> -                       cfg->bufferCount = IPU3_BUFFER_COUNT;\n>                         cfg->stride = info.stride(cfg->size.width, 0, 1);\n>                         cfg->frameSize = info.frameSize(cfg->size, 1);\n>\n> @@ -425,7 +422,6 @@ CameraConfiguration\n> *PipelineHandlerIPU3::generateConfiguration(Camera *camera,\n>         Size sensorResolution = data->cio2_.sensor()->resolution();\n>         for (const StreamRole role : roles) {\n>                 std::map<PixelFormat, std::vector<SizeRange>>\n> streamFormats;\n> -               unsigned int bufferCount;\n>                 PixelFormat pixelFormat;\n>                 Size size;\n>\n> @@ -446,7 +442,6 @@ CameraConfiguration\n> *PipelineHandlerIPU3::generateConfiguration(Camera *camera,\n>                         size.height = utils::alignDown(size.height - 1,\n>\n>  IMGU_OUTPUT_HEIGHT_MARGIN);\n>                         pixelFormat = formats::NV12;\n> -                       bufferCount = IPU3_BUFFER_COUNT;\n>                         streamFormats[pixelFormat] = { {\n> IMGU_OUTPUT_MIN_SIZE, size } };\n>\n>                         break;\n> @@ -456,7 +451,6 @@ CameraConfiguration\n> *PipelineHandlerIPU3::generateConfiguration(Camera *camera,\n>\n> data->cio2_.generateConfiguration(sensorResolution);\n>                         pixelFormat = cio2Config.pixelFormat;\n>                         size = cio2Config.size;\n> -                       bufferCount = cio2Config.bufferCount;\n>\n>                         for (const PixelFormat &format :\n> data->cio2_.formats())\n>                                 streamFormats[format] =\n> data->cio2_.sizes();\n> @@ -475,7 +469,6 @@ CameraConfiguration\n> *PipelineHandlerIPU3::generateConfiguration(Camera *camera,\n>\n>  .alignedDownTo(IMGU_OUTPUT_WIDTH_ALIGN,\n>\n> IMGU_OUTPUT_HEIGHT_ALIGN);\n>                         pixelFormat = formats::NV12;\n> -                       bufferCount = IPU3_BUFFER_COUNT;\n>                         streamFormats[pixelFormat] = { {\n> IMGU_OUTPUT_MIN_SIZE, size } };\n>\n>                         break;\n> @@ -492,7 +485,6 @@ CameraConfiguration\n> *PipelineHandlerIPU3::generateConfiguration(Camera *camera,\n>                 StreamConfiguration cfg(formats);\n>                 cfg.size = size;\n>                 cfg.pixelFormat = pixelFormat;\n> -               cfg.bufferCount = bufferCount;\n>                 config->addConfiguration(cfg);\n>         }\n>\n> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> index a7c1cc1d5001..12d6729044e6 100644\n> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> @@ -492,7 +492,6 @@ CameraConfiguration\n> *PipelineHandlerRPi::generateConfiguration(Camera *camera,\n>         RPiCameraData *data = cameraData(camera);\n>         CameraConfiguration *config = new RPiCameraConfiguration(data);\n>         V4L2DeviceFormat sensorFormat;\n> -       unsigned int bufferCount;\n>         PixelFormat pixelFormat;\n>         V4L2VideoDevice::Formats fmts;\n>         Size size;\n> @@ -510,7 +509,6 @@ CameraConfiguration\n> *PipelineHandlerRPi::generateConfiguration(Camera *camera,\n>                         sensorFormat = findBestMode(fmts, size);\n>                         pixelFormat = sensorFormat.fourcc.toPixelFormat();\n>                         ASSERT(pixelFormat.isValid());\n> -                       bufferCount = 2;\n>                         rawCount++;\n>                         break;\n>\n> @@ -519,7 +517,6 @@ CameraConfiguration\n> *PipelineHandlerRPi::generateConfiguration(Camera *camera,\n>                         pixelFormat = formats::NV12;\n>                         /* Return the largest sensor resolution. */\n>                         size = data->sensor_->resolution();\n> -                       bufferCount = 1;\n>                         outCount++;\n>                         break;\n>\n> @@ -535,7 +532,6 @@ CameraConfiguration\n> *PipelineHandlerRPi::generateConfiguration(Camera *camera,\n>                         fmts = data->isp_[Isp::Output0].dev()->formats();\n>                         pixelFormat = formats::YUV420;\n>                         size = { 1920, 1080 };\n> -                       bufferCount = 4;\n>                         outCount++;\n>                         break;\n>\n> @@ -543,7 +539,6 @@ CameraConfiguration\n> *PipelineHandlerRPi::generateConfiguration(Camera *camera,\n>                         fmts = data->isp_[Isp::Output0].dev()->formats();\n>                         pixelFormat = formats::ARGB8888;\n>                         size = { 800, 600 };\n> -                       bufferCount = 4;\n>                         outCount++;\n>                         break;\n>\n> @@ -573,7 +568,6 @@ CameraConfiguration\n> *PipelineHandlerRPi::generateConfiguration(Camera *camera,\n>                 StreamConfiguration cfg(formats);\n>                 cfg.size = size;\n>                 cfg.pixelFormat = pixelFormat;\n> -               cfg.bufferCount = bufferCount;\n>                 config->addConfiguration(cfg);\n>         }\n>\n> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp\n> b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp\n> index 515f4be16d7e..9bbdf951d9b6 100644\n> --- a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp\n> +++ b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp\n> @@ -61,7 +61,6 @@ StreamConfiguration\n> RkISP1Path::generateConfiguration(const Size &resolution)\n>         StreamConfiguration cfg(formats);\n>         cfg.pixelFormat = formats::NV12;\n>         cfg.size = maxResolution;\n> -       cfg.bufferCount = RKISP1_BUFFER_COUNT;\n>\n>         return cfg;\n>  }\n> @@ -77,7 +76,6 @@ CameraConfiguration::Status\n> RkISP1Path::validate(StreamConfiguration *cfg)\n>\n>         cfg->size.boundTo(maxResolution_);\n>         cfg->size.expandTo(minResolution_);\n> -       cfg->bufferCount = RKISP1_BUFFER_COUNT;\n>\n>         V4L2DeviceFormat format;\n>         format.fourcc = video_->toV4L2PixelFormat(cfg->pixelFormat);\n> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1_path.h\n> b/src/libcamera/pipeline/rkisp1/rkisp1_path.h\n> index 267d8f988ace..dd54fc609da6 100644\n> --- a/src/libcamera/pipeline/rkisp1/rkisp1_path.h\n> +++ b/src/libcamera/pipeline/rkisp1/rkisp1_path.h\n> @@ -57,8 +57,6 @@ public:\n>         Signal<FrameBuffer *> &bufferReady() { return video_->bufferReady;\n> }\n>\n>  private:\n> -       static constexpr unsigned int RKISP1_BUFFER_COUNT = 4;\n> -\n>         const char *name_;\n>         bool running_;\n>\n> diff --git a/src/libcamera/pipeline/simple/converter.cpp\n> b/src/libcamera/pipeline/simple/converter.cpp\n> index 3133b3dbda07..46ab503b7c38 100644\n> --- a/src/libcamera/pipeline/simple/converter.cpp\n> +++ b/src/libcamera/pipeline/simple/converter.cpp\n> @@ -89,9 +89,6 @@ int SimpleConverter::Stream::configure(const\n> StreamConfiguration &inputCfg,\n>                 return -EINVAL;\n>         }\n>\n> -       inputBufferCount_ = inputCfg.bufferCount;\n> -       outputBufferCount_ = outputCfg.bufferCount;\n> -\n>         return 0;\n>  }\n>\n> diff --git a/src/libcamera/pipeline/simple/converter.h\n> b/src/libcamera/pipeline/simple/converter.h\n> index deb3df0d08df..365b99e9853e 100644\n> --- a/src/libcamera/pipeline/simple/converter.h\n> +++ b/src/libcamera/pipeline/simple/converter.h\n> @@ -86,9 +86,6 @@ private:\n>                 SimpleConverter *converter_;\n>                 unsigned int index_;\n>                 std::unique_ptr<V4L2M2MDevice> m2m_;\n> -\n> -               unsigned int inputBufferCount_;\n> -               unsigned int outputBufferCount_;\n>         };\n>\n>         std::string deviceNode_;\n> diff --git a/src/libcamera/pipeline/simple/simple.cpp\n> b/src/libcamera/pipeline/simple/simple.cpp\n> index d0a658a23be8..6deba5d7dd61 100644\n> --- a/src/libcamera/pipeline/simple/simple.cpp\n> +++ b/src/libcamera/pipeline/simple/simple.cpp\n> @@ -252,7 +252,6 @@ protected:\n>         int queueRequestDevice(Camera *camera, Request *request) override;\n>\n>  private:\n> -       static constexpr unsigned int kNumInternalBuffers = 3;\n>         static constexpr unsigned int kSimpleBufferSlotCount = 16;\n>\n>         SimpleCameraData *cameraData(Camera *camera)\n> @@ -638,7 +637,7 @@ CameraConfiguration::Status\n> SimpleCameraConfiguration::validate()\n>                     cfg.size != pipeConfig_->captureSize)\n>                         needConversion_ = true;\n>\n> -               /* Set the stride, frameSize and bufferCount. */\n> +               /* Set the stride and frameSize. */\n>                 if (needConversion_) {\n>                         std::tie(cfg.stride, cfg.frameSize) =\n>\n> converter->strideAndFrameSize(cfg.pixelFormat, cfg.size);\n> @@ -656,8 +655,6 @@ CameraConfiguration::Status\n> SimpleCameraConfiguration::validate()\n>                         cfg.stride = format.planes[0].bpl;\n>                         cfg.frameSize = format.planes[0].size;\n>                 }\n> -\n> -               cfg.bufferCount = 3;\n>         }\n>\n>         return status;\n> @@ -780,7 +777,6 @@ int SimplePipelineHandler::configure(Camera *camera,\n> CameraConfiguration *c)\n>         inputCfg.pixelFormat = pipeConfig->captureFormat;\n>         inputCfg.size = pipeConfig->captureSize;\n>         inputCfg.stride = captureFormat.planes[0].bpl;\n> -       inputCfg.bufferCount = kNumInternalBuffers;\n>\n>         /* Set the MinimumRequests property. */\n>         unsigned int minimumRequests;\n> diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> index c210cf57750f..5977312a795d 100644\n> --- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> +++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> @@ -150,8 +150,6 @@ CameraConfiguration::Status\n> UVCCameraConfiguration::validate()\n>                 status = Adjusted;\n>         }\n>\n> -       cfg.bufferCount = 4;\n> -\n>         V4L2DeviceFormat format;\n>         format.fourcc = data_->video_->toV4L2PixelFormat(cfg.pixelFormat);\n>         format.size = cfg.size;\n> @@ -193,7 +191,6 @@ CameraConfiguration\n> *PipelineHandlerUVC::generateConfiguration(Camera *camera,\n>\n>         cfg.pixelFormat = formats.pixelformats().front();\n>         cfg.size = formats.sizes(cfg.pixelFormat).back();\n> -       cfg.bufferCount = 4;\n>\n>         config->addConfiguration(cfg);\n>\n> diff --git a/src/libcamera/pipeline/vimc/vimc.cpp\n> b/src/libcamera/pipeline/vimc/vimc.cpp\n> index d2943f61a745..ad71bfc67228 100644\n> --- a/src/libcamera/pipeline/vimc/vimc.cpp\n> +++ b/src/libcamera/pipeline/vimc/vimc.cpp\n> @@ -170,8 +170,6 @@ CameraConfiguration::Status\n> VimcCameraConfiguration::validate()\n>                 status = Adjusted;\n>         }\n>\n> -       cfg.bufferCount = 4;\n> -\n>         V4L2DeviceFormat format;\n>         format.fourcc = data_->video_->toV4L2PixelFormat(cfg.pixelFormat);\n>         format.size = cfg.size;\n> @@ -227,7 +225,6 @@ CameraConfiguration\n> *PipelineHandlerVimc::generateConfiguration(Camera *camera,\n>\n>         cfg.pixelFormat = formats::BGR888;\n>         cfg.size = { 1920, 1080 };\n> -       cfg.bufferCount = 4;\n>\n>         config->addConfiguration(cfg);\n>\n> diff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp\n> index b421e17ecb36..d4cc0fafb76f 100644\n> --- a/src/libcamera/stream.cpp\n> +++ b/src/libcamera/stream.cpp\n> @@ -280,8 +280,7 @@ SizeRange StreamFormats::range(const PixelFormat\n> &pixelformat) const\n>   * handlers provide StreamFormats.\n>   */\n>  StreamConfiguration::StreamConfiguration()\n> -       : pixelFormat(0), stride(0), frameSize(0), bufferCount(0),\n> -         stream_(nullptr)\n> +       : pixelFormat(0), stride(0), frameSize(0), stream_(nullptr)\n>  {\n>  }\n>\n> @@ -289,8 +288,8 @@ StreamConfiguration::StreamConfiguration()\n>   * \\brief Construct a configuration with stream formats\n>   */\n>  StreamConfiguration::StreamConfiguration(const StreamFormats &formats)\n> -       : pixelFormat(0), stride(0), frameSize(0), bufferCount(0),\n> -         stream_(nullptr), formats_(formats)\n> +       : pixelFormat(0), stride(0), frameSize(0), stream_(nullptr),\n> +         formats_(formats)\n>  {\n>  }\n>\n> @@ -324,11 +323,6 @@ StreamConfiguration::StreamConfiguration(const\n> StreamFormats &formats)\n>   * validating the configuration with a call to\n> CameraConfiguration::validate().\n>   */\n>\n> -/**\n> - * \\var StreamConfiguration::bufferCount\n> - * \\brief Requested number of buffers to allocate for the stream\n> - */\n> -\n>  /**\n>   * \\fn StreamConfiguration::stream()\n>   * \\brief Retrieve the stream associated with the configuration\n> diff --git a/test/camera/buffer_import.cpp b/test/camera/buffer_import.cpp\n> index c504ea09e64b..67ac0ad20e15 100644\n> --- a/test/camera/buffer_import.cpp\n> +++ b/test/camera/buffer_import.cpp\n> @@ -16,6 +16,8 @@\n>  #include <libcamera/base/thread.h>\n>  #include <libcamera/base/timer.h>\n>\n> +#include <libcamera/property_ids.h>\n> +\n>  #include \"libcamera/internal/device_enumerator.h\"\n>  #include \"libcamera/internal/media_device.h\"\n>  #include \"libcamera/internal/v4l2_videodevice.h\"\n> @@ -92,10 +94,12 @@ protected:\n>                         return TestFail;\n>                 }\n>\n> +               unsigned int bufferCount =\n> camera_->properties().get(properties::MinimumRequests);\n> +\n>                 Stream *stream = cfg.stream();\n>\n>                 BufferSource source;\n> -               int ret = source.allocate(cfg);\n> +               int ret = source.allocate(cfg, bufferCount);\n>                 if (ret != TestPass)\n>                         return ret;\n>\n> @@ -139,10 +143,10 @@ protected:\n>                 while (timer.isRunning())\n>                         dispatcher->processEvents();\n>\n> -               if (completeRequestsCount_ < cfg.bufferCount * 2) {\n> +               if (completeRequestsCount_ < bufferCount * 2) {\n>                         std::cout << \"Failed to capture enough frames (got\n> \"\n>                                   << completeRequestsCount_ << \" expected\n> at least \"\n> -                                 << cfg.bufferCount * 2 << \")\" <<\n> std::endl;\n> +                                 << bufferCount * 2 << \")\" << std::endl;\n>                         return TestFail;\n>                 }\n>\n> diff --git a/test/libtest/buffer_source.cpp\n> b/test/libtest/buffer_source.cpp\n> index 73563f2fc39d..c3d5286a2462 100644\n> --- a/test/libtest/buffer_source.cpp\n> +++ b/test/libtest/buffer_source.cpp\n> @@ -24,7 +24,7 @@ BufferSource::~BufferSource()\n>                 media_->release();\n>  }\n>\n> -int BufferSource::allocate(const StreamConfiguration &config)\n> +int BufferSource::allocate(const StreamConfiguration &config, unsigned\n> int count)\n>  {\n>         /* Locate and open the video device. */\n>         std::string videoDeviceName = \"vivid-000-vid-out\";\n> @@ -77,7 +77,7 @@ int BufferSource::allocate(const StreamConfiguration\n> &config)\n>                 return TestFail;\n>         }\n>\n> -       if (video->allocateBuffers(config.bufferCount, &buffers_) < 0) {\n> +       if (video->allocateBuffers(count, &buffers_) < 0) {\n>                 std::cout << \"Failed to allocate buffers\" << std::endl;\n>                 return TestFail;\n>         }\n> diff --git a/test/libtest/buffer_source.h b/test/libtest/buffer_source.h\n> index 14b4770e8d8a..6a18e269a575 100644\n> --- a/test/libtest/buffer_source.h\n> +++ b/test/libtest/buffer_source.h\n> @@ -20,7 +20,7 @@ public:\n>         BufferSource();\n>         ~BufferSource();\n>\n> -       int allocate(const StreamConfiguration &config);\n> +       int allocate(const StreamConfiguration &config, unsigned int\n> count);\n>         const std::vector<std::unique_ptr<FrameBuffer>> &buffers();\n>\n>  private:\n> diff --git a/test/v4l2_videodevice/buffer_cache.cpp\n> b/test/v4l2_videodevice/buffer_cache.cpp\n> index b3f2bec11783..6c8183800d0b 100644\n> --- a/test/v4l2_videodevice/buffer_cache.cpp\n> +++ b/test/v4l2_videodevice/buffer_cache.cpp\n> @@ -145,10 +145,9 @@ public:\n>                 StreamConfiguration cfg;\n>                 cfg.pixelFormat = formats::YUYV;\n>                 cfg.size = Size(600, 800);\n> -               cfg.bufferCount = numBuffers;\n>\n>                 BufferSource source;\n> -               int ret = source.allocate(cfg);\n> +               int ret = source.allocate(cfg, numBuffers);\n>                 if (ret != TestPass)\n>                         return ret;\n>\n> --\n> 2.33.0\n>\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id F074CBE08B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  1 Dec 2022 12:59:06 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 215416333F;\n\tThu,  1 Dec 2022 13:59:06 +0100 (CET)","from mail-io1-xd32.google.com (mail-io1-xd32.google.com\n\t[IPv6:2607:f8b0:4864:20::d32])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C98A663335\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  1 Dec 2022 13:59:03 +0100 (CET)","by mail-io1-xd32.google.com with SMTP id p83so967222iod.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 01 Dec 2022 04:59:03 -0800 (PST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1669899546;\n\tbh=fOffUt97TzwHG1rMiIsko+gZtjkZwHlQ9S2UQts7xro=;\n\th=References:In-Reply-To:Date:To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=CRh13j7/bI2pXgRRpIZKf+M4S7qoWuhF9KQLVMQAvW34uvnFJwQZqfSSok9dyJA4B\n\tbMFvdlhn1qpvI/uqqgPvyfXBnJ+LXN+/aKIa4PB/w+IDeFKVzUL/+L7ZRimi+qXK5u\n\tzbmaGIALnSeBLZ1kYAQlTmE8ftb3CKWiTJdPg6BFfxjE8EKrtldcm9NNb4U3GAC7zi\n\tWOA6pWIAsN63/1gGdCje6rJpAiK+sE97z5N+4G7sLxglJcfTnhldlQz/dVc55pQOov\n\tleVeTzmnzwq0588is0BfCXr9ZZOyXZ5ICjJ6m7mbIbtB1Ph1BV1EALOpRm6V40wzPp\n\talE9zm6lP5UYw==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:from:to:cc:subject:date:message-id:reply-to;\n\tbh=oCjjTm2uP+t1dYmQq/zF4FYH9asNEgOS6K0L40QrKGg=;\n\tb=RWU/fRuhEUmRkAl94rF58+B/6lQqaZzZL71KcO/fsJty7RXDbgZNjMMB7rL19+5Vk2\n\t8U5S0GDIQZDJBa5Jc7xLU4Ww+OOJi14ThERm9vABfcKJ1nqSrLz7FOXWGoyrBwV32dPb\n\tz2qqragnlRvJvHE65T+ae4wkvnOUAEpVoy9+YYAE+zgqTvdZIqDHAX+dBHPM6HGOi/SC\n\tUIvvroGQPRAuSTM1JZCYDL6fxKghOpUd00pizqJEw8YEavH0PrMwmFHt+zRkccErKspF\n\t5c9JbwDZrlnqryyrhcmSfOknmEXM8AzCVyD63qGa9YN4LH8HUaMikyBN/GlbeTNAIDzL\n\tm9rg=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"RWU/fRuh\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=oCjjTm2uP+t1dYmQq/zF4FYH9asNEgOS6K0L40QrKGg=;\n\tb=PCILCnSY8SA7p40vKvHtPgnd9mVuun2jAeXs4IbfLhOQAsC7IeW1YPfH4Jv1bXlLD6\n\thM0ib9VvNIkowJTla/im64Yl9HRJ8NAWX8NUjFqGl92fmK2Gs1Ap6vA4n8DJmCfJn1OS\n\tO869Nc8lxlXezYMtt1AZ/3gIkAOocQLnOtoijVazezoSyiEcHtSgSlhsy4HSZgJzgw8R\n\tMMCnsDb2rNhFkBny5eh76kO6Neva7L2roDM+7sqKGgQ3mwfubhBbGPUrrEfwcmfn962Q\n\tXBQsKgukbpL3LUjkaG5H31NineEeo81ab8bDpMFjpllEhjseE0DXGcrXqnvqP4xAxEzb\n\tMqMg==","X-Gm-Message-State":"ANoB5pl37fyxNdRlJfP6BSBznrMvdNq0LafL/PJkwGRqzNEVMfbkoFwX\n\tShcHPH0CU3YhZ/XLN2/a5IDGASZeay88FdFu2I6PFw==","X-Google-Smtp-Source":"AA0mqf7N3pC6e/Qc3UPgKy0kmWd/7MTYhZn1fDBPl2AACHdMRuJIrBfnSj6PCAxstEaoElCE03MRlLYdAQWeiWIT68s=","X-Received":"by 2002:a05:6638:3a15:b0:389:4219:c44f with SMTP id\n\tcn21-20020a0566383a1500b003894219c44fmr15871209jab.134.1669899542379;\n\tThu, 01 Dec 2022 04:59:02 -0800 (PST)","MIME-Version":"1.0","References":"<20210824195636.1110845-1-nfraprado@collabora.com>\n\t<20210824195636.1110845-10-nfraprado@collabora.com>","In-Reply-To":"<20210824195636.1110845-10-nfraprado@collabora.com>","Date":"Thu, 1 Dec 2022 12:58:48 +0000","Message-ID":"<CAEmqJPqHfiNczEFiiXdJ2t6Gu=9NT78s=XD0kAmBRU6ZctzPug@mail.gmail.com>","To":"=?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= <nfraprado@collabora.com>","Content-Type":"multipart/alternative; boundary=\"00000000000008db0b05eec3c94c\"","Subject":"Re: [libcamera-devel] [PATCH v8 09/17] libcamera: stream: Remove\n\tbufferCount","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Naushir Patuck via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Naushir Patuck <naush@raspberrypi.com>","Cc":"libcamera-devel@lists.libcamera.org, kernel@collabora.com, =?utf-8?q?A?=\n\t=?utf-8?q?ndr=C3=A9_Almeida?= <andrealmeid@collabora.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":25967,"web_url":"https://patchwork.libcamera.org/comment/25967/","msgid":"<20221201153535.ctlhe4fmgmt7qy22@notapiano>","date":"2022-12-01T15:35:35","subject":"Re: [libcamera-devel] [PATCH v8 09/17] libcamera: stream: Remove\n\tbufferCount","submitter":{"id":84,"url":"https://patchwork.libcamera.org/api/people/84/","name":"Nícolas F. R. A. Prado","email":"nfraprado@collabora.com"},"content":"On Thu, Dec 01, 2022 at 12:58:48PM +0000, Naushir Patuck wrote:\n> HI Nicolas,\n> \n> Thank you for your work.\n> \n> On Tue, 24 Aug 2021 at 20:57, Nícolas F. R. A. Prado <\n> nfraprado@collabora.com> wrote:\n> \n> > Now that the number of buffers allocated by the FrameBufferAllocator\n> > helper is passed through FrameBufferAllocator::allocate() and the\n> > pipelines no longer use bufferCount for internal buffer or V4L2 buffer\n> > slots allocation, we no longer need to have bufferCount in the\n> > StreamConfiguration, so remove it.\n> >\n> \n> I've tried to pull this series into my tree to have a closer look, but\n> there are many\n> merge conflicts.  Am I missing some patches on-top of master that this\n> series needs?\n\nHi,\n\nThis series is one year old by this point, so it probably needs some tweaking to\ncleanly apply. I don't really have the time right now to work further on this\nseries, but it looks like Paul Elder might carry on with it if I understood it\nright. (See reply on the cover letter)\n\nThanks,\nNícolas","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 34871BE08B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  1 Dec 2022 15:35:43 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 847656333F;\n\tThu,  1 Dec 2022 16:35:42 +0100 (CET)","from madras.collabora.co.uk (madras.collabora.co.uk\n\t[46.235.227.172])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id F096D63335\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  1 Dec 2022 16:35:40 +0100 (CET)","from notapiano (unknown\n\t[IPv6:2600:4041:5b1a:cd00:524d:e95d:1a9c:492a])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\tkey-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits)\n\tserver-digest SHA256) (No client certificate requested)\n\t(Authenticated sender: nfraprado)\n\tby madras.collabora.co.uk (Postfix) with ESMTPSA id 259366602A81;\n\tThu,  1 Dec 2022 15:35:40 +0000 (GMT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1669908942;\n\tbh=UhbbS1tifkgd6kSTBonmPxWxCw+EFKiA7qMBgSwd/4Y=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=cSOheMWz0jgxN8qzrfirG7MCquYrGR7Z7ly4blTSq39FStHpE5EXaH23dwCbnou/4\n\t3sfZ9dLC2P9tF4eJyXbt/UrhKi/n0/AIwAVlx52V5uqHousDChAjdruLrIVZuA6xYJ\n\tIpPQqXySnhusouIVaoGpYjAQfpBZqIeEDSIaK41NxhIzN+iuEOtNG+bGhO6pyb94HH\n\tZaoRvucnjdLvnU12ZFdMFwc5y9AxVhrif1gDTmiki4MHEUiL5lnIkrC1AXhQ9ecFmQ\n\tjDRysPeXTysbLLxjc5NtIdLF/BntNeuwBwrY06Ndf4LNeWVEWmoIXKUcdaGv6oOk3C\n\t2C3hpfQZtJW6w==","v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com;\n\ts=mail; t=1669908940;\n\tbh=UhbbS1tifkgd6kSTBonmPxWxCw+EFKiA7qMBgSwd/4Y=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=c/WRVyNu1r4Eqk5KxenPyDnyVvaOaICc39UVf61P4UHjoX3jEjIzXAUNZUVDUared\n\t2bN/g6SJQmKzwwYD3U1URVS732W3rxvr4y9n/U8y2oMs56u8Z9P1JwA4KoqvQB6DtR\n\ttT7BRX96HMfCI+VXxsIplwUf6dQmLe6PqRPXwjNtwDRBGeAoK344ovya1aSjQ/n8sz\n\tCwiqw1WAxQgnDIxx7b9AykmMZqpfKCVeu/wuDvlznUW2Y45Dw71CEhEW6RdApHQknn\n\tJUu9NbpJyfc/AZ/pTaaMf3xCvNpmn+/YBDOG9OiArQj5ozUZ/GTQLd/FTR1Q+SfiEZ\n\tk9utiQPFX7e8A=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=collabora.com\n\theader.i=@collabora.com\n\theader.b=\"c/WRVyNu\"; dkim-atps=neutral","Date":"Thu, 1 Dec 2022 10:35:35 -0500","To":"Naushir Patuck <naush@raspberrypi.com>","Message-ID":"<20221201153535.ctlhe4fmgmt7qy22@notapiano>","References":"<20210824195636.1110845-1-nfraprado@collabora.com>\n\t<20210824195636.1110845-10-nfraprado@collabora.com>\n\t<CAEmqJPqHfiNczEFiiXdJ2t6Gu=9NT78s=XD0kAmBRU6ZctzPug@mail.gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<CAEmqJPqHfiNczEFiiXdJ2t6Gu=9NT78s=XD0kAmBRU6ZctzPug@mail.gmail.com>","Subject":"Re: [libcamera-devel] [PATCH v8 09/17] libcamera: stream: Remove\n\tbufferCount","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"=?utf-8?q?N=C3=ADcolas_F=2E_R=2E_A=2E_Prado_via_libcamera-devel?=\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"=?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4=?= Prado\n\t<nfraprado@collabora.com>","Cc":"libcamera-devel@lists.libcamera.org, kernel@collabora.com","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]