Show a patch.

GET /api/1.1/patches/21760/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 21760,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/21760/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/21760/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api",
        "name": "libcamera",
        "link_name": "libcamera",
        "list_id": "libcamera_core",
        "list_email": "libcamera-devel@lists.libcamera.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20241028091249.16473-1-jacopo.mondi@ideasonboard.com>",
    "date": "2024-10-28T09:12:48",
    "name": "libcamera: rkisp1: Rationalize IPA and handlers names",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "d9c9cb806b05d833e045c6dc19a209877039daf3",
    "submitter": {
        "id": 143,
        "url": "https://patchwork.libcamera.org/api/1.1/people/143/?format=api",
        "name": "Jacopo Mondi",
        "email": "jacopo.mondi@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/21760/mbox/",
    "series": [
        {
            "id": 4748,
            "url": "https://patchwork.libcamera.org/api/1.1/series/4748/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4748",
            "date": "2024-10-28T09:12:48",
            "name": "libcamera: rkisp1: Rationalize IPA and handlers names",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/4748/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/21760/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/21760/checks/",
    "tags": {},
    "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 D2015BD78E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 28 Oct 2024 09:13:04 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id AAA056539E;\n\tMon, 28 Oct 2024 10:13:03 +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 1EE7860360\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 28 Oct 2024 10:13:02 +0100 (CET)",
            "from ideasonboard.com (mob-5-90-59-111.net.vodafone.it\n\t[5.90.59.111])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 1E733641;\n\tMon, 28 Oct 2024 10:12:57 +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=\"uoLisyWe\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1730106778;\n\tbh=oqFxBis2O4SAFyXIuNL+TkAs7vCUB7v5nV9lpgp6uqE=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=uoLisyWewOK6CbpDvuaMsXTRulSGsgxH1ptlRjDCX/lLM0ufHLAz99vMcgpr/7fsJ\n\t0WvO49vnADHjloOJKPfRc96LQsikIgOI20tdsOCehI1yBWTqAK82WIJGJSPY5TOc1d\n\tzzcYZ1xv3MeDVFJuUEapBJq38vTJAzNWDeljPrxw=",
        "From": "Jacopo Mondi <jacopo.mondi@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "Jacopo Mondi <jacopo.mondi@ideasonboard.com>",
        "Subject": "[PATCH] libcamera: rkisp1: Rationalize IPA and handlers names",
        "Date": "Mon, 28 Oct 2024 10:12:48 +0100",
        "Message-ID": "<20241028091249.16473-1-jacopo.mondi@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.47.0",
        "MIME-Version": "1.0",
        "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>"
    },
    "content": "The names used by the IPA interface and the names used for buffer\ncompletions handlers for the RkISP1 clash in the use of the term \"buffer\".\n\nFor example the video device buffer completion handler is called\n\"bufferReady\" and the IPA event to ask the IPA to compute parameters is\ncalled \"fillParamsBuffers\". This makes it hard to recognize which\nfunction handles video device completion signals and which ones handle\nthe IPA interface events.\n\nRationalize the naming scheme in the IPA interface function and events\nand the signal handlers in the RkISP1 support, according to the\nfollowing table. Remove the name \"buffer\" from the IPA interface events\nand events handler and reserve it for the buffer completion handlers.\nRename the IPA interface events and function to use the 'params' and\n'stats' names and make the signal and the even names specular (ie\n'computeParams' : 'paramsComputed')\n\nIPA Interface:\n\n- fillParamsBuffer -> computeParams   [FUNCTION]\n- paramsBufferReady -> paramsComputed [EVENT]\n\n- processStatsBuffer -> processStats  [FUNCTION]\n- metadataReady -> statsProcessed     [EVENT]\n\nPipeline handler:\n\n- bufferReady -> videoBufferReady     [BUFFER HANDLER]\n- paramReady -> paramsBufferReady     [BUFFER HANDLER]\n- statReady -> statsBufferReady       [BUFFER HANDLER]\n- paramFilled -> paramsComputed       [IPA EVENT HANDLER]\n- metadataReady -> statsProcessed     [IPA EVENT HANDLER]\n\nCosmetic change only, no functional changes intended.\n\nSigned-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n---\n include/libcamera/ipa/rkisp1.mojom       | 10 +++---\n src/ipa/rkisp1/rkisp1.cpp                | 16 ++++-----\n src/libcamera/pipeline/rkisp1/rkisp1.cpp | 42 ++++++++++++------------\n 3 files changed, 34 insertions(+), 34 deletions(-)",
    "diff": "diff --git a/include/libcamera/ipa/rkisp1.mojom b/include/libcamera/ipa/rkisp1.mojom\nindex 80d54a03aa90..ced1526e18cd 100644\n--- a/include/libcamera/ipa/rkisp1.mojom\n+++ b/include/libcamera/ipa/rkisp1.mojom\n@@ -31,13 +31,13 @@ interface IPARkISP1Interface {\n \tunmapBuffers(array<uint32> ids);\n \n \t[async] queueRequest(uint32 frame, libcamera.ControlList reqControls);\n-\t[async] fillParamsBuffer(uint32 frame, uint32 bufferId);\n-\t[async] processStatsBuffer(uint32 frame, uint32 bufferId,\n-\t\t\t\t   libcamera.ControlList sensorControls);\n+\t[async] computeParams(uint32 frame, uint32 bufferId);\n+\t[async] processStats(uint32 frame, uint32 bufferId,\n+\t\t\t     libcamera.ControlList sensorControls);\n };\n \n interface IPARkISP1EventInterface {\n-\tparamsBufferReady(uint32 frame, uint32 bytesused);\n+\tparamsComputed(uint32 frame, uint32 bytesused);\n \tsetSensorControls(uint32 frame, libcamera.ControlList sensorControls);\n-\tmetadataReady(uint32 frame, libcamera.ControlList metadata);\n+\tstatsProcessed(uint32 frame, libcamera.ControlList metadata);\n };\ndiff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\nindex 9e161cabdea4..6d6f8392a70f 100644\n--- a/src/ipa/rkisp1/rkisp1.cpp\n+++ b/src/ipa/rkisp1/rkisp1.cpp\n@@ -65,9 +65,9 @@ public:\n \tvoid unmapBuffers(const std::vector<unsigned int> &ids) override;\n \n \tvoid queueRequest(const uint32_t frame, const ControlList &controls) override;\n-\tvoid fillParamsBuffer(const uint32_t frame, const uint32_t bufferId) override;\n-\tvoid processStatsBuffer(const uint32_t frame, const uint32_t bufferId,\n-\t\t\t\tconst ControlList &sensorControls) override;\n+\tvoid computeParams(const uint32_t frame, const uint32_t bufferId) override;\n+\tvoid processStats(const uint32_t frame, const uint32_t bufferId,\n+\t\t\t  const ControlList &sensorControls) override;\n \n protected:\n \tstd::string logPrefix() const override;\n@@ -335,7 +335,7 @@ void IPARkISP1::queueRequest(const uint32_t frame, const ControlList &controls)\n \t}\n }\n \n-void IPARkISP1::fillParamsBuffer(const uint32_t frame, const uint32_t bufferId)\n+void IPARkISP1::computeParams(const uint32_t frame, const uint32_t bufferId)\n {\n \tIPAFrameContext &frameContext = context_.frameContexts.get(frame);\n \n@@ -345,11 +345,11 @@ void IPARkISP1::fillParamsBuffer(const uint32_t frame, const uint32_t bufferId)\n \tfor (auto const &algo : algorithms())\n \t\talgo->prepare(context_, frame, frameContext, &params);\n \n-\tparamsBufferReady.emit(frame, params.size());\n+\tparamsComputed.emit(frame, params.size());\n }\n \n-void IPARkISP1::processStatsBuffer(const uint32_t frame, const uint32_t bufferId,\n-\t\t\t\t   const ControlList &sensorControls)\n+void IPARkISP1::processStats(const uint32_t frame, const uint32_t bufferId,\n+\t\t\t     const ControlList &sensorControls)\n {\n \tIPAFrameContext &frameContext = context_.frameContexts.get(frame);\n \n@@ -378,7 +378,7 @@ void IPARkISP1::processStatsBuffer(const uint32_t frame, const uint32_t bufferId\n \n \tsetControls(frame);\n \n-\tmetadataReady.emit(frame, metadata);\n+\tstatsProcessed.emit(frame, metadata);\n }\n \n void IPARkISP1::updateControls(const IPACameraSensorInfo &sensorInfo,\ndiff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\nindex c7b0b3927da1..83b74b27652f 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n@@ -114,11 +114,11 @@ public:\n \tControlInfoMap ipaControls_;\n \n private:\n-\tvoid paramFilled(unsigned int frame, unsigned int bytesused);\n+\tvoid paramsComputed(unsigned int frame, unsigned int bytesused);\n \tvoid setSensorControls(unsigned int frame,\n \t\t\t       const ControlList &sensorControls);\n \n-\tvoid metadataReady(unsigned int frame, const ControlList &metadata);\n+\tvoid statsProcessed(unsigned int frame, const ControlList &metadata);\n };\n \n class RkISP1CameraConfiguration : public CameraConfiguration\n@@ -180,9 +180,9 @@ private:\n \t\t      const RkISP1CameraConfiguration &config);\n \tint createCamera(MediaEntity *sensor);\n \tvoid tryCompleteRequest(RkISP1FrameInfo *info);\n-\tvoid bufferReady(FrameBuffer *buffer);\n-\tvoid paramReady(FrameBuffer *buffer);\n-\tvoid statReady(FrameBuffer *buffer);\n+\tvoid videoBufferReady(FrameBuffer *buffer);\n+\tvoid paramsBufferReady(FrameBuffer *buffer);\n+\tvoid statsBufferReady(FrameBuffer *buffer);\n \tvoid dewarpBufferReady(FrameBuffer *buffer);\n \tvoid frameStart(uint32_t sequence);\n \n@@ -367,8 +367,8 @@ int RkISP1CameraData::loadIPA(unsigned int hwRevision)\n \t\treturn -ENOENT;\n \n \tipa_->setSensorControls.connect(this, &RkISP1CameraData::setSensorControls);\n-\tipa_->paramsBufferReady.connect(this, &RkISP1CameraData::paramFilled);\n-\tipa_->metadataReady.connect(this, &RkISP1CameraData::metadataReady);\n+\tipa_->paramsComputed.connect(this, &RkISP1CameraData::paramsComputed);\n+\tipa_->statsProcessed.connect(this, &RkISP1CameraData::statsProcessed);\n \n \t/*\n \t * The API tuning file is made from the sensor name unless the\n@@ -400,7 +400,7 @@ int RkISP1CameraData::loadIPA(unsigned int hwRevision)\n \treturn 0;\n }\n \n-void RkISP1CameraData::paramFilled(unsigned int frame, unsigned int bytesused)\n+void RkISP1CameraData::paramsComputed(unsigned int frame, unsigned int bytesused)\n {\n \tPipelineHandlerRkISP1 *pipe = RkISP1CameraData::pipe();\n \tRkISP1FrameInfo *info = frameInfo_.find(frame);\n@@ -424,7 +424,7 @@ void RkISP1CameraData::setSensorControls([[maybe_unused]] unsigned int frame,\n \tdelayedCtrls_->push(sensorControls);\n }\n \n-void RkISP1CameraData::metadataReady(unsigned int frame, const ControlList &metadata)\n+void RkISP1CameraData::statsProcessed(unsigned int frame, const ControlList &metadata)\n {\n \tRkISP1FrameInfo *info = frameInfo_.find(frame);\n \tif (!info)\n@@ -1120,8 +1120,8 @@ int PipelineHandlerRkISP1::queueRequestDevice(Camera *camera, Request *request)\n \t\tif (data->selfPath_ && info->selfPathBuffer)\n \t\t\tdata->selfPath_->queueBuffer(info->selfPathBuffer);\n \t} else {\n-\t\tdata->ipa_->fillParamsBuffer(data->frame_,\n-\t\t\t\t\t     info->paramBuffer->cookie());\n+\t\tdata->ipa_->computeParams(data->frame_,\n+\t\t\t\t\t  info->paramBuffer->cookie());\n \t}\n \n \tdata->frame_++;\n@@ -1334,11 +1334,11 @@ bool PipelineHandlerRkISP1::match(DeviceEnumerator *enumerator)\n \tif (hasSelfPath_ && !selfPath_.init(media_))\n \t\treturn false;\n \n-\tmainPath_.bufferReady().connect(this, &PipelineHandlerRkISP1::bufferReady);\n+\tmainPath_.bufferReady().connect(this, &PipelineHandlerRkISP1::videoBufferReady);\n \tif (hasSelfPath_)\n-\t\tselfPath_.bufferReady().connect(this, &PipelineHandlerRkISP1::bufferReady);\n-\tstat_->bufferReady.connect(this, &PipelineHandlerRkISP1::statReady);\n-\tparam_->bufferReady.connect(this, &PipelineHandlerRkISP1::paramReady);\n+\t\tselfPath_.bufferReady().connect(this, &PipelineHandlerRkISP1::videoBufferReady);\n+\tstat_->bufferReady.connect(this, &PipelineHandlerRkISP1::statsBufferReady);\n+\tparam_->bufferReady.connect(this, &PipelineHandlerRkISP1::paramsBufferReady);\n \n \t/* If dewarper is present, create its instance. */\n \tDeviceMatch dwp(\"dw100\");\n@@ -1399,7 +1399,7 @@ void PipelineHandlerRkISP1::tryCompleteRequest(RkISP1FrameInfo *info)\n \tcompleteRequest(request);\n }\n \n-void PipelineHandlerRkISP1::bufferReady(FrameBuffer *buffer)\n+void PipelineHandlerRkISP1::videoBufferReady(FrameBuffer *buffer)\n {\n \tASSERT(activeCamera_);\n \tRkISP1CameraData *data = cameraData(activeCamera_);\n@@ -1424,7 +1424,7 @@ void PipelineHandlerRkISP1::bufferReady(FrameBuffer *buffer)\n \t\tif (isRaw_) {\n \t\t\tconst ControlList &ctrls =\n \t\t\t\tdata->delayedCtrls_->get(metadata.sequence);\n-\t\t\tdata->ipa_->processStatsBuffer(info->frame, 0, ctrls);\n+\t\t\tdata->ipa_->processStats(info->frame, 0, ctrls);\n \t\t}\n \t} else {\n \t\tif (isRaw_)\n@@ -1508,7 +1508,7 @@ void PipelineHandlerRkISP1::dewarpBufferReady(FrameBuffer *buffer)\n \ttryCompleteRequest(info);\n }\n \n-void PipelineHandlerRkISP1::paramReady(FrameBuffer *buffer)\n+void PipelineHandlerRkISP1::paramsBufferReady(FrameBuffer *buffer)\n {\n \tASSERT(activeCamera_);\n \tRkISP1CameraData *data = cameraData(activeCamera_);\n@@ -1521,7 +1521,7 @@ void PipelineHandlerRkISP1::paramReady(FrameBuffer *buffer)\n \ttryCompleteRequest(info);\n }\n \n-void PipelineHandlerRkISP1::statReady(FrameBuffer *buffer)\n+void PipelineHandlerRkISP1::statsBufferReady(FrameBuffer *buffer)\n {\n \tASSERT(activeCamera_);\n \tRkISP1CameraData *data = cameraData(activeCamera_);\n@@ -1539,8 +1539,8 @@ void PipelineHandlerRkISP1::statReady(FrameBuffer *buffer)\n \tif (data->frame_ <= buffer->metadata().sequence)\n \t\tdata->frame_ = buffer->metadata().sequence + 1;\n \n-\tdata->ipa_->processStatsBuffer(info->frame, info->statBuffer->cookie(),\n-\t\t\t\t       data->delayedCtrls_->get(buffer->metadata().sequence));\n+\tdata->ipa_->processStats(info->frame, info->statBuffer->cookie(),\n+\t\t\t\t data->delayedCtrls_->get(buffer->metadata().sequence));\n }\n \n REGISTER_PIPELINE_HANDLER(PipelineHandlerRkISP1, \"rkisp1\")\n",
    "prefixes": []
}