[{"id":15229,"web_url":"https://patchwork.libcamera.org/comment/15229/","msgid":"<20210219023137.GC1826@pyrite.rasen.tech>","date":"2021-02-19T02:31:37","subject":"Re: [libcamera-devel] [PATCH v3 3/4] pipeline: ipa: raspberrypi:\n\tRename IPA Interface namespace to ipa::RPi","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"Hi Naush,\n\nOn Thu, Feb 18, 2021 at 12:48:23PM +0000, Naushir Patuck wrote:\n> Rename the IPA interface namespace to ipa::RPi for consistency with\n> the libcamera::RPi namespace label.\n> \n> There is no functional change in this commit.\n> \n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n\n> ---\n>  include/libcamera/ipa/raspberrypi.mojom       |  2 +-\n>  src/ipa/raspberrypi/raspberrypi.cpp           | 38 +++++++++----------\n>  .../pipeline/raspberrypi/raspberrypi.cpp      | 30 +++++++--------\n>  .../pipeline/raspberrypi/rpi_stream.cpp       |  4 +-\n>  .../pipeline/raspberrypi/rpi_stream.h         |  4 +-\n>  5 files changed, 39 insertions(+), 39 deletions(-)\n> \n> diff --git a/include/libcamera/ipa/raspberrypi.mojom b/include/libcamera/ipa/raspberrypi.mojom\n> index 9c05cc68cceb..5a27b1e4fc2d 100644\n> --- a/include/libcamera/ipa/raspberrypi.mojom\n> +++ b/include/libcamera/ipa/raspberrypi.mojom\n> @@ -1,6 +1,6 @@\n>  /* SPDX-License-Identifier: LGPL-2.1-or-later */\n>  \n> -module ipa.rpi;\n> +module ipa.RPi;\n>  \n>  import \"include/libcamera/ipa/core.mojom\";\n>  \n> diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp\n> index 974f4ec63058..1226ea514521 100644\n> --- a/src/ipa/raspberrypi/raspberrypi.cpp\n> +++ b/src/ipa/raspberrypi/raspberrypi.cpp\n> @@ -63,7 +63,7 @@ constexpr double defaultMaxFrameDuration = 1e6 / 0.01;\n>  \n>  LOG_DEFINE_CATEGORY(IPARPI)\n>  \n> -class IPARPi : public ipa::rpi::IPARPiInterface\n> +class IPARPi : public ipa::RPi::IPARPiInterface\n>  {\n>  public:\n>  \tIPARPi()\n> @@ -76,24 +76,24 @@ public:\n>  \t~IPARPi()\n>  \t{\n>  \t\tif (lsTable_)\n> -\t\t\tmunmap(lsTable_, ipa::rpi::MaxLsGridSize);\n> +\t\t\tmunmap(lsTable_, ipa::RPi::MaxLsGridSize);\n>  \t}\n>  \n>  \tint init(const IPASettings &settings) override;\n> -\tvoid start(const ipa::rpi::StartControls &data,\n> -\t\t   ipa::rpi::StartControls *result) override;\n> +\tvoid start(const ipa::RPi::StartControls &data,\n> +\t\t   ipa::RPi::StartControls *result) override;\n>  \tvoid stop() override {}\n>  \n>  \tvoid configure(const CameraSensorInfo &sensorInfo,\n>  \t\t       const std::map<unsigned int, IPAStream> &streamConfig,\n>  \t\t       const std::map<unsigned int, ControlInfoMap> &entityControls,\n> -\t\t       const ipa::rpi::ConfigInput &data,\n> -\t\t       ipa::rpi::ConfigOutput *response, int32_t *ret) override;\n> +\t\t       const ipa::RPi::ConfigInput &data,\n> +\t\t       ipa::RPi::ConfigOutput *response, int32_t *ret) override;\n>  \tvoid mapBuffers(const std::vector<IPABuffer> &buffers) override;\n>  \tvoid unmapBuffers(const std::vector<unsigned int> &ids) override;\n>  \tvoid signalStatReady(const uint32_t bufferId) override;\n>  \tvoid signalQueueRequest(const ControlList &controls) override;\n> -\tvoid signalIspPrepare(const ipa::rpi::ISPConfig &data) override;\n> +\tvoid signalIspPrepare(const ipa::RPi::ISPConfig &data) override;\n>  \n>  private:\n>  \tvoid setMode(const CameraSensorInfo &sensorInfo);\n> @@ -168,8 +168,8 @@ int IPARPi::init(const IPASettings &settings)\n>  \treturn 0;\n>  }\n>  \n> -void IPARPi::start(const ipa::rpi::StartControls &data,\n> -\t\t   ipa::rpi::StartControls *result)\n> +void IPARPi::start(const ipa::RPi::StartControls &data,\n> +\t\t   ipa::RPi::StartControls *result)\n>  {\n>  \tRPiController::Metadata metadata;\n>  \n> @@ -291,8 +291,8 @@ void IPARPi::setMode(const CameraSensorInfo &sensorInfo)\n>  void IPARPi::configure(const CameraSensorInfo &sensorInfo,\n>  \t\t       [[maybe_unused]] const std::map<unsigned int, IPAStream> &streamConfig,\n>  \t\t       const std::map<unsigned int, ControlInfoMap> &entityControls,\n> -\t\t       const ipa::rpi::ConfigInput &ipaConfig,\n> -\t\t       ipa::rpi::ConfigOutput *result, int32_t *ret)\n> +\t\t       const ipa::RPi::ConfigInput &ipaConfig,\n> +\t\t       ipa::RPi::ConfigOutput *result, int32_t *ret)\n>  {\n>  \tif (entityControls.size() != 2) {\n>  \t\tLOG(IPARPI, Error) << \"No ISP or sensor controls found.\";\n> @@ -344,7 +344,7 @@ void IPARPi::configure(const CameraSensorInfo &sensorInfo,\n>  \t\thelper_->GetDelays(exposureDelay, gainDelay);\n>  \t\tsensorMetadata = helper_->SensorEmbeddedDataPresent();\n>  \n> -\t\tresult->params |= ipa::rpi::ConfigSensorParams;\n> +\t\tresult->params |= ipa::RPi::ConfigSensorParams;\n>  \t\tresult->sensorConfig.gainDelay = gainDelay;\n>  \t\tresult->sensorConfig.exposureDelay = exposureDelay;\n>  \t\tresult->sensorConfig.vblank = exposureDelay;\n> @@ -360,14 +360,14 @@ void IPARPi::configure(const CameraSensorInfo &sensorInfo,\n>  \tif (ipaConfig.lsTableHandle.isValid()) {\n>  \t\t/* Remove any previous table, if there was one. */\n>  \t\tif (lsTable_) {\n> -\t\t\tmunmap(lsTable_, ipa::rpi::MaxLsGridSize);\n> +\t\t\tmunmap(lsTable_, ipa::RPi::MaxLsGridSize);\n>  \t\t\tlsTable_ = nullptr;\n>  \t\t}\n>  \n>  \t\t/* Map the LS table buffer into user space. */\n>  \t\tlsTableHandle_ = std::move(ipaConfig.lsTableHandle);\n>  \t\tif (lsTableHandle_.isValid()) {\n> -\t\t\tlsTable_ = mmap(nullptr, ipa::rpi::MaxLsGridSize, PROT_READ | PROT_WRITE,\n> +\t\t\tlsTable_ = mmap(nullptr, ipa::RPi::MaxLsGridSize, PROT_READ | PROT_WRITE,\n>  \t\t\t\t\tMAP_SHARED, lsTableHandle_.fd(), 0);\n>  \n>  \t\t\tif (lsTable_ == MAP_FAILED) {\n> @@ -432,7 +432,7 @@ void IPARPi::signalStatReady(uint32_t bufferId)\n>  \n>  \treportMetadata();\n>  \n> -\tstatsMetadataComplete.emit(bufferId & ipa::rpi::MaskID, libcameraMetadata_);\n> +\tstatsMetadataComplete.emit(bufferId & ipa::RPi::MaskID, libcameraMetadata_);\n>  }\n>  \n>  void IPARPi::signalQueueRequest(const ControlList &controls)\n> @@ -440,7 +440,7 @@ void IPARPi::signalQueueRequest(const ControlList &controls)\n>  \tqueueRequest(controls);\n>  }\n>  \n> -void IPARPi::signalIspPrepare(const ipa::rpi::ISPConfig &data)\n> +void IPARPi::signalIspPrepare(const ipa::RPi::ISPConfig &data)\n>  {\n>  \t/*\n>  \t * At start-up, or after a mode-switch, we may want to\n> @@ -451,7 +451,7 @@ void IPARPi::signalIspPrepare(const ipa::rpi::ISPConfig &data)\n>  \tframeCount_++;\n>  \n>  \t/* Ready to push the input buffer into the ISP. */\n> -\trunIsp.emit(data.bayerBufferId & ipa::rpi::MaskID);\n> +\trunIsp.emit(data.bayerBufferId & ipa::RPi::MaskID);\n>  }\n>  \n>  void IPARPi::reportMetadata()\n> @@ -906,7 +906,7 @@ void IPARPi::queueRequest(const ControlList &controls)\n>  \n>  void IPARPi::returnEmbeddedBuffer(unsigned int bufferId)\n>  {\n> -\tembeddedComplete.emit(bufferId & ipa::rpi::MaskID);\n> +\tembeddedComplete.emit(bufferId & ipa::RPi::MaskID);\n>  }\n>  \n>  void IPARPi::prepareISP(unsigned int bufferId)\n> @@ -1271,7 +1271,7 @@ void IPARPi::applyLS(const struct AlscStatus *lsStatus, ControlList &ctrls)\n>  \t\t.gain_format = GAIN_FORMAT_U4P10\n>  \t};\n>  \n> -\tif (!lsTable_ || w * h * 4 * sizeof(uint16_t) > ipa::rpi::MaxLsGridSize) {\n> +\tif (!lsTable_ || w * h * 4 * sizeof(uint16_t) > ipa::RPi::MaxLsGridSize) {\n>  \t\tLOG(IPARPI, Error) << \"Do not have a correctly allocate lens shading table!\";\n>  \t\treturn;\n>  \t}\n> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> index aac285b44748..acf2d56cddb2 100644\n> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> @@ -166,7 +166,7 @@ public:\n>  \tvoid handleState();\n>  \tvoid applyScalerCrop(const ControlList &controls);\n>  \n> -\tstd::unique_ptr<ipa::rpi::IPAProxyRPi> ipa_;\n> +\tstd::unique_ptr<ipa::RPi::IPAProxyRPi> ipa_;\n>  \n>  \tstd::unique_ptr<CameraSensor> sensor_;\n>  \t/* Array of Unicam and ISP device streams and associated buffers/streams. */\n> @@ -778,8 +778,8 @@ int PipelineHandlerRPi::start(Camera *camera, ControlList *controls)\n>  \t\tdata->applyScalerCrop(*controls);\n>  \n>  \t/* Start the IPA. */\n> -\tipa::rpi::StartControls ipaData;\n> -\tipa::rpi::StartControls result;\n> +\tipa::RPi::StartControls ipaData;\n> +\tipa::RPi::StartControls result;\n>  \tif (controls)\n>  \t\tipaData.controls = *controls;\n>  \tdata->ipa_->start(ipaData, &result);\n> @@ -1114,8 +1114,8 @@ int PipelineHandlerRPi::prepareBuffers(Camera *camera)\n>  \t * Pass the stats and embedded data buffers to the IPA. No other\n>  \t * buffers need to be passed.\n>  \t */\n> -\tmapBuffers(camera, data->isp_[Isp::Stats].getBuffers(), ipa::rpi::MaskStats);\n> -\tmapBuffers(camera, data->unicam_[Unicam::Embedded].getBuffers(), ipa::rpi::MaskEmbeddedData);\n> +\tmapBuffers(camera, data->isp_[Isp::Stats].getBuffers(), ipa::RPi::MaskStats);\n> +\tmapBuffers(camera, data->unicam_[Unicam::Embedded].getBuffers(), ipa::RPi::MaskEmbeddedData);\n>  \n>  \treturn 0;\n>  }\n> @@ -1164,7 +1164,7 @@ void RPiCameraData::frameStarted(uint32_t sequence)\n>  \n>  int RPiCameraData::loadIPA()\n>  {\n> -\tipa_ = IPAManager::createIPA<ipa::rpi::IPAProxyRPi>(pipe_, 1, 1);\n> +\tipa_ = IPAManager::createIPA<ipa::RPi::IPAProxyRPi>(pipe_, 1, 1);\n>  \n>  \tif (!ipa_)\n>  \t\treturn -ENOENT;\n> @@ -1188,7 +1188,7 @@ int RPiCameraData::configureIPA(const CameraConfiguration *config)\n>  \n>  \tstd::map<unsigned int, IPAStream> streamConfig;\n>  \tstd::map<unsigned int, ControlInfoMap> entityControls;\n> -\tipa::rpi::ConfigInput ipaConfig;\n> +\tipa::RPi::ConfigInput ipaConfig;\n>  \n>  \t/* Get the device format to pass to the IPA. */\n>  \tV4L2DeviceFormat sensorFormat;\n> @@ -1211,7 +1211,7 @@ int RPiCameraData::configureIPA(const CameraConfiguration *config)\n>  \n>  \t/* Allocate the lens shading table via dmaHeap and pass to the IPA. */\n>  \tif (!lsTable_.isValid()) {\n> -\t\tlsTable_ = dmaHeap_.alloc(\"ls_grid\", ipa::rpi::MaxLsGridSize);\n> +\t\tlsTable_ = dmaHeap_.alloc(\"ls_grid\", ipa::RPi::MaxLsGridSize);\n>  \t\tif (!lsTable_.isValid())\n>  \t\t\treturn -ENOMEM;\n>  \n> @@ -1231,7 +1231,7 @@ int RPiCameraData::configureIPA(const CameraConfiguration *config)\n>  \t}\n>  \n>  \t/* Ready the IPA - it must know about the sensor resolution. */\n> -\tipa::rpi::ConfigOutput result;\n> +\tipa::RPi::ConfigOutput result;\n>  \n>  \tipa_->configure(sensorInfo_, streamConfig, entityControls, ipaConfig,\n>  \t\t\t&result, &ret);\n> @@ -1241,7 +1241,7 @@ int RPiCameraData::configureIPA(const CameraConfiguration *config)\n>  \t\treturn -EPIPE;\n>  \t}\n>  \n> -\tif (result.params & ipa::rpi::ConfigSensorParams) {\n> +\tif (result.params & ipa::RPi::ConfigSensorParams) {\n>  \t\t/*\n>  \t\t * Setup our delayed control writer with the sensor default\n>  \t\t * gain and exposure delays.\n> @@ -1455,7 +1455,7 @@ void RPiCameraData::ispOutputDequeue(FrameBuffer *buffer)\n>  \t * application until after the IPA signals so.\n>  \t */\n>  \tif (stream == &isp_[Isp::Stats]) {\n> -\t\tipa_->signalStatReady(ipa::rpi::MaskStats | static_cast<unsigned int>(index));\n> +\t\tipa_->signalStatReady(ipa::RPi::MaskStats | static_cast<unsigned int>(index));\n>  \t} else {\n>  \t\t/* Any other ISP output can be handed back to the application now. */\n>  \t\thandleStreamBuffer(buffer, stream);\n> @@ -1559,7 +1559,7 @@ void RPiCameraData::handleExternalBuffer(FrameBuffer *buffer, RPi::Stream *strea\n>  {\n>  \tunsigned int id = stream->getBufferId(buffer);\n>  \n> -\tif (!(id & ipa::rpi::MaskExternalBuffer))\n> +\tif (!(id & ipa::RPi::MaskExternalBuffer))\n>  \t\treturn;\n>  \n>  \t/* Stop the Stream object from tracking the buffer. */\n> @@ -1691,9 +1691,9 @@ void RPiCameraData::tryRunPipeline()\n>  \t\t\t<< \" Bayer buffer id: \" << bayerId\n>  \t\t\t<< \" Embedded buffer id: \" << embeddedId;\n>  \n> -\tipa::rpi::ISPConfig ispPrepare;\n> -\tispPrepare.embeddedBufferId = ipa::rpi::MaskEmbeddedData | embeddedId;\n> -\tispPrepare.bayerBufferId = ipa::rpi::MaskBayerData | bayerId;\n> +\tipa::RPi::ISPConfig ispPrepare;\n> +\tispPrepare.embeddedBufferId = ipa::RPi::MaskEmbeddedData | embeddedId;\n> +\tispPrepare.bayerBufferId = ipa::RPi::MaskBayerData | bayerId;\n>  \tipa_->signalIspPrepare(ispPrepare);\n>  }\n>  \n> diff --git a/src/libcamera/pipeline/raspberrypi/rpi_stream.cpp b/src/libcamera/pipeline/raspberrypi/rpi_stream.cpp\n> index 496dd36fabbc..f2430415d32d 100644\n> --- a/src/libcamera/pipeline/raspberrypi/rpi_stream.cpp\n> +++ b/src/libcamera/pipeline/raspberrypi/rpi_stream.cpp\n> @@ -72,7 +72,7 @@ int Stream::getBufferId(FrameBuffer *buffer) const\n>  \n>  void Stream::setExternalBuffer(FrameBuffer *buffer)\n>  {\n> -\tbufferMap_.emplace(ipa::rpi::MaskExternalBuffer | id_.get(), buffer);\n> +\tbufferMap_.emplace(ipa::RPi::MaskExternalBuffer | id_.get(), buffer);\n>  }\n>  \n>  void Stream::removeExternalBuffer(FrameBuffer *buffer)\n> @@ -80,7 +80,7 @@ void Stream::removeExternalBuffer(FrameBuffer *buffer)\n>  \tint id = getBufferId(buffer);\n>  \n>  \t/* Ensure we have this buffer in the stream, and it is marked external. */\n> -\tASSERT(id != -1 && (id & ipa::rpi::MaskExternalBuffer));\n> +\tASSERT(id != -1 && (id & ipa::RPi::MaskExternalBuffer));\n>  \tbufferMap_.erase(id);\n>  }\n>  \n> diff --git a/src/libcamera/pipeline/raspberrypi/rpi_stream.h b/src/libcamera/pipeline/raspberrypi/rpi_stream.h\n> index 701110d04bdb..f1ac715f4221 100644\n> --- a/src/libcamera/pipeline/raspberrypi/rpi_stream.h\n> +++ b/src/libcamera/pipeline/raspberrypi/rpi_stream.h\n> @@ -32,13 +32,13 @@ class Stream : public libcamera::Stream\n>  {\n>  public:\n>  \tStream()\n> -\t\t: id_(ipa::rpi::MaskID)\n> +\t\t: id_(ipa::RPi::MaskID)\n>  \t{\n>  \t}\n>  \n>  \tStream(const char *name, MediaEntity *dev, bool importOnly = false)\n>  \t\t: external_(false), importOnly_(importOnly), name_(name),\n> -\t\t  dev_(std::make_unique<V4L2VideoDevice>(dev)), id_(ipa::rpi::MaskID)\n> +\t\t  dev_(std::make_unique<V4L2VideoDevice>(dev)), id_(ipa::RPi::MaskID)\n>  \t{\n>  \t}\n>  \n> -- \n> 2.25.1\n> \n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","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 0DFA2BD1F1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 19 Feb 2021 02:31:48 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 61FF168414;\n\tFri, 19 Feb 2021 03:31:47 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 86CB3602F5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 19 Feb 2021 03:31:45 +0100 (CET)","from pyrite.rasen.tech (unknown\n\t[IPv6:2400:4051:61:600:2c71:1b79:d06d:5032])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id E9240596;\n\tFri, 19 Feb 2021 03:31:43 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"FHJqeHbS\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1613701905;\n\tbh=1n3OQZC9Q0E+7vW5VwCrwP91Pf9WGgLREPol5wxInh4=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=FHJqeHbSqwsWMMtkUR1aORLGiyHaWP5/4wQ22w9nAChTlWe1q9bfh8A7BullT09/Q\n\t6fDuMdUtmK94p+aF+sbl+psuhNxQ86OIt55vKfT1ecyLwUMzyCPa1Fq2fzqDz8hFZ7\n\tMsUi21rYYQk/45AEXLMwqSSOh1JSnEoaW84bGkeM=","Date":"Fri, 19 Feb 2021 11:31:37 +0900","From":"paul.elder@ideasonboard.com","To":"Naushir Patuck <naush@raspberrypi.com>","Message-ID":"<20210219023137.GC1826@pyrite.rasen.tech>","References":"<20210218124824.1825418-1-naush@raspberrypi.com>\n\t<20210218124824.1825418-4-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20210218124824.1825418-4-naush@raspberrypi.com>","Subject":"Re: [libcamera-devel] [PATCH v3 3/4] pipeline: ipa: raspberrypi:\n\tRename IPA Interface namespace to ipa::RPi","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>","Cc":"libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]