[{"id":37370,"web_url":"https://patchwork.libcamera.org/comment/37370/","msgid":"<e2bde041-fac4-4807-88e3-6da40b6386f4@ideasonboard.com>","date":"2025-12-15T10:38:14","subject":"Re: [PATCH v1 1/2] pipeline: rpi: Rename Stream::prepareBuffers to\n\tStream::allocateBuffers","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"Hi\n\n2025. 12. 10. 14:09 keltezéssel, Naushir Patuck írta:\n> This rename is in preparation for a subsequent change where only\n> buffer allocations happen in this function.\n> \n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> ---\n>   src/libcamera/pipeline/rpi/common/pipeline_base.cpp | 2 +-\n>   src/libcamera/pipeline/rpi/common/pipeline_base.h   | 2 +-\n>   src/libcamera/pipeline/rpi/common/rpi_stream.cpp    | 2 +-\n>   src/libcamera/pipeline/rpi/common/rpi_stream.h      | 2 +-\n>   src/libcamera/pipeline/rpi/pisp/pisp.cpp            | 6 +++---\n>   src/libcamera/pipeline/rpi/vc4/vc4.cpp              | 6 +++---\n>   6 files changed, 10 insertions(+), 10 deletions(-)\n> \n> diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n> index 9d65dc83573b..2b61b5d241c5 100644\n> --- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n> +++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n> @@ -668,7 +668,7 @@ int PipelineHandlerBase::start(Camera *camera, const ControlList *controls)\n>   \n>   \tif (!data->buffersAllocated_) {\n>   \t\t/* Allocate buffers for internal pipeline usage. */\n> -\t\tret = prepareBuffers(camera);\n> +\t\tret = allocateBuffers(camera);\n>   \t\tif (ret) {\n>   \t\t\tLOG(RPI, Error) << \"Failed to allocate buffers\";\n>   \t\t\tdata->freeBuffers();\n> diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.h b/src/libcamera/pipeline/rpi/common/pipeline_base.h\n> index 15628259afc6..0c6354493548 100644\n> --- a/src/libcamera/pipeline/rpi/common/pipeline_base.h\n> +++ b/src/libcamera/pipeline/rpi/common/pipeline_base.h\n> @@ -242,7 +242,7 @@ private:\n>   \t}\n>   \n>   \tint queueAllBuffers(Camera *camera);\n> -\tvirtual int prepareBuffers(Camera *camera) = 0;\n> +\tvirtual int allocateBuffers(Camera *camera) = 0;\n\nThese also \"map\" the buffers not just allocate as far as I can see.\nIn any case,  I think the name is fine. And the change looks OK to me.\n\n\nReviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n\n\n>   };\n>   \n>   class RPiCameraConfiguration final : public CameraConfiguration\n> diff --git a/src/libcamera/pipeline/rpi/common/rpi_stream.cpp b/src/libcamera/pipeline/rpi/common/rpi_stream.cpp\n> index accf59eb424e..e73f4b7d31af 100644\n> --- a/src/libcamera/pipeline/rpi/common/rpi_stream.cpp\n> +++ b/src/libcamera/pipeline/rpi/common/rpi_stream.cpp\n> @@ -106,7 +106,7 @@ void Stream::setExportedBuffer(FrameBuffer *buffer)\n>   \tbufferEmplace(++id_, buffer);\n>   }\n>   \n> -int Stream::prepareBuffers(unsigned int count)\n> +int Stream::allocateBuffers(unsigned int count)\n>   {\n>   \tint ret;\n>   \n> diff --git a/src/libcamera/pipeline/rpi/common/rpi_stream.h b/src/libcamera/pipeline/rpi/common/rpi_stream.h\n> index 0dba12961743..c267447e5ab5 100644\n> --- a/src/libcamera/pipeline/rpi/common/rpi_stream.h\n> +++ b/src/libcamera/pipeline/rpi/common/rpi_stream.h\n> @@ -125,7 +125,7 @@ public:\n>   \n>   \tvoid setExportedBuffer(FrameBuffer *buffer);\n>   \n> -\tint prepareBuffers(unsigned int count);\n> +\tint allocateBuffers(unsigned int count);\n>   \tint queueBuffer(FrameBuffer *buffer);\n>   \tvoid returnBuffer(FrameBuffer *buffer);\n>   \n> diff --git a/src/libcamera/pipeline/rpi/pisp/pisp.cpp b/src/libcamera/pipeline/rpi/pisp/pisp.cpp\n> index 77acd2f64092..7bcba32b9b58 100644\n> --- a/src/libcamera/pipeline/rpi/pisp/pisp.cpp\n> +++ b/src/libcamera/pipeline/rpi/pisp/pisp.cpp\n> @@ -864,7 +864,7 @@ private:\n>   \t\treturn static_cast<PiSPCameraData *>(camera->_d());\n>   \t}\n>   \n> -\tint prepareBuffers(Camera *camera) override;\n> +\tint allocateBuffers(Camera *camera) override;\n>   \tint platformRegister(std::unique_ptr<RPi::CameraData> &cameraData,\n>   \t\t\t     std::shared_ptr<MediaDevice> cfe,\n>   \t\t\t     std::shared_ptr<MediaDevice> isp) override;\n> @@ -958,7 +958,7 @@ bool PipelineHandlerPiSP::match(DeviceEnumerator *enumerator)\n>   \treturn false;\n>   }\n>   \n> -int PipelineHandlerPiSP::prepareBuffers(Camera *camera)\n> +int PipelineHandlerPiSP::allocateBuffers(Camera *camera)\n>   {\n>   \tPiSPCameraData *data = cameraData(camera);\n>   \tunsigned int numRawBuffers = 0;\n> @@ -1021,7 +1021,7 @@ int PipelineHandlerPiSP::prepareBuffers(Camera *camera)\n>   \t\tLOG(RPI, Debug) << \"Preparing \" << numBuffers\n>   \t\t\t\t<< \" buffers for stream \" << stream->name();\n>   \n> -\t\tret = stream->prepareBuffers(numBuffers);\n> +\t\tret = stream->allocateBuffers(numBuffers);\n>   \t\tif (ret < 0)\n>   \t\t\treturn ret;\n>   \t}\n> diff --git a/src/libcamera/pipeline/rpi/vc4/vc4.cpp b/src/libcamera/pipeline/rpi/vc4/vc4.cpp\n> index f0cb99d59e74..8a80439e9082 100644\n> --- a/src/libcamera/pipeline/rpi/vc4/vc4.cpp\n> +++ b/src/libcamera/pipeline/rpi/vc4/vc4.cpp\n> @@ -158,7 +158,7 @@ private:\n>   \t\treturn static_cast<Vc4CameraData *>(camera->_d());\n>   \t}\n>   \n> -\tint prepareBuffers(Camera *camera) override;\n> +\tint allocateBuffers(Camera *camera) override;\n>   \tint platformRegister(std::unique_ptr<RPi::CameraData> &cameraData,\n>   \t\t\t     std::shared_ptr<MediaDevice> unicam,\n>   \t\t\t     std::shared_ptr<MediaDevice> isp) override;\n> @@ -219,7 +219,7 @@ bool PipelineHandlerVc4::match(DeviceEnumerator *enumerator)\n>   \treturn false;\n>   }\n>   \n> -int PipelineHandlerVc4::prepareBuffers(Camera *camera)\n> +int PipelineHandlerVc4::allocateBuffers(Camera *camera)\n>   {\n>   \tVc4CameraData *data = cameraData(camera);\n>   \tunsigned int numRawBuffers = 0;\n> @@ -289,7 +289,7 @@ int PipelineHandlerVc4::prepareBuffers(Camera *camera)\n>   \t\tLOG(RPI, Debug) << \"Preparing \" << numBuffers\n>   \t\t\t\t<< \" buffers for stream \" << stream->name();\n>   \n> -\t\tret = stream->prepareBuffers(numBuffers);\n> +\t\tret = stream->allocateBuffers(numBuffers);\n>   \t\tif (ret < 0)\n>   \t\t\treturn ret;\n>   \t}","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 44B7FC3257\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 15 Dec 2025 10:38:20 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C569661965;\n\tMon, 15 Dec 2025 11:38:19 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 12187606D5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 15 Dec 2025 11:38:18 +0100 (CET)","from [192.168.33.22] (185.221.143.114.nat.pool.zt.hu\n\t[185.221.143.114])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 437E5ED;\n\tMon, 15 Dec 2025 11:38:13 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"b1itvf+c\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1765795093;\n\tbh=ZAZ/yhMZAjguIpixKLeqxdwGeBYb0U1ep89mdOfjz3E=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=b1itvf+c2DmkdTcJI4ATG+4gzaSZcSRhsJ43z0IsMhpzw/CxH8H4e8W6ydndZhzT0\n\t8RFBrtyb3siijRAnmaFG0160cslZ5ZQBiqWSTDJrFwarakjfGIFYHvTeB9nh8Ld/Ug\n\tCvIZLGeYEcbANmkDIxsCm/k7R5SEvWpUDTsISIdM=","Message-ID":"<e2bde041-fac4-4807-88e3-6da40b6386f4@ideasonboard.com>","Date":"Mon, 15 Dec 2025 11:38:14 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v1 1/2] pipeline: rpi: Rename Stream::prepareBuffers to\n\tStream::allocateBuffers","To":"Naushir Patuck <naush@raspberrypi.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20251210131302.81887-1-naush@raspberrypi.com>\n\t<20251210131302.81887-2-naush@raspberrypi.com>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<20251210131302.81887-2-naush@raspberrypi.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]