Patch Detail
Show a patch.
GET /api/patches/11318/?format=api
{ "id": 11318, "url": "https://patchwork.libcamera.org/api/patches/11318/?format=api", "web_url": "https://patchwork.libcamera.org/patch/11318/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/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": "<20210217100852.1542397-1-naush@raspberrypi.com>", "date": "2021-02-17T10:08:50", "name": "[libcamera-devel,1/3] pipeline: ipa: raspberrypi: Various fixups after IPAInterface changes", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "1c25b8a00178c682fa6ac9f42b5e61842b596c37", "submitter": { "id": 34, "url": "https://patchwork.libcamera.org/api/people/34/?format=api", "name": "Naushir Patuck", "email": "naush@raspberrypi.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/11318/mbox/", "series": [ { "id": 1700, "url": "https://patchwork.libcamera.org/api/series/1700/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1700", "date": "2021-02-17T10:08:50", "name": "[libcamera-devel,1/3] pipeline: ipa: raspberrypi: Various fixups after IPAInterface changes", "version": 1, "mbox": "https://patchwork.libcamera.org/series/1700/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/11318/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/11318/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 03CC5BD1F1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 17 Feb 2021 10:08:59 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9352B63820;\n\tWed, 17 Feb 2021 11:08:58 +0100 (CET)", "from mail-wr1-x431.google.com (mail-wr1-x431.google.com\n\t[IPv6:2a00:1450:4864:20::431])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DF55E602FA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 17 Feb 2021 11:08:56 +0100 (CET)", "by mail-wr1-x431.google.com with SMTP id v1so16732503wrd.6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 17 Feb 2021 02:08:56 -0800 (PST)", "from naush-laptop.patuck.local ([88.97.76.4])\n\tby smtp.gmail.com with ESMTPSA id\n\tl38sm2132481wmp.19.2021.02.17.02.08.55\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 17 Feb 2021 02:08:55 -0800 (PST)" ], "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"kI6Odv+S\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=aU4UgnIZNbETazhuwhor/hEli6bslNfbqx7r7mDUkMk=;\n\tb=kI6Odv+SieJKwVzZi+5iFJpulU8NuR1Q4IKk7KfvYxNzGV+3tcL1H62FiGSQMtrCpR\n\tvslBOJk54bz/ok9EEgfguLe2p2YRNbYrJ1VszqulsKgqxcH739Ug1dd6UUbioLDNPdIK\n\tRfJbPfby4S0Vhe8gIkcvUxA7W64bHvifNtH/t7YrKN+XhKz6Re3BadT/vIkqhMFe9Z14\n\t7EAvbiRm99BeZhGNx5Ko6d+4ql8KPnyZUMG0PXHQanV6bXdVUTtMBIEPSp+Zb2nBlyHK\n\tS+dd8NgK8son7iZfUunlnoubhiH7olGyibcUEaereZS75ZyiNMVZ4ivqYFclprG/NsPm\n\tuf7g==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=aU4UgnIZNbETazhuwhor/hEli6bslNfbqx7r7mDUkMk=;\n\tb=Ss9xPv++qbeC6WOJpfFszhXxvZ7BAEUiETnr/2tw2OWJfhAQYMHDo4YCj8DXRmBwOR\n\twneSK2gbiMyXDLEgwSnsYdEi8sJQvjFcIpsGA8gqbMPRwnvzFIwqGJ9nlHNGiiuztYBA\n\tTENJdytjFiEd9gZXn3MhqVg2GwND0HGidGvAf0tUv58yRBD6qQQMCPMnSvPfc91BAOS6\n\t3EMjkZLs6heYsbVLjQkDA7U+KAYxHUuS0O1+8pIAMH+q2pqSat9ng574RcSjnP1Y+V0Y\n\tmZ1PKIpyTcK4J9Ieaq7FKMoOOR5oNYvP2lMpD3dwDyTlhw0H3Fcwyqd/wItbf8RWzgD+\n\tJaxQ==", "X-Gm-Message-State": "AOAM532NHKNR4D4NrJjn+Bhlnef8b9epEGWv/qj7Pro/OORscxYuyw/S\n\tq5WjCZjJu8So1GB88PjagJzuNjuUkz2TJDWZ", "X-Google-Smtp-Source": "ABdhPJxexHZZjzuM6GWEHwbPqKFi/sfInhhGXUU2bqrFKy3Zzi/cvQN5ZA0EnQFKWANy/hWvhdFzJA==", "X-Received": "by 2002:a5d:698d:: with SMTP id\n\tg13mr29415045wru.30.1613556536266; \n\tWed, 17 Feb 2021 02:08:56 -0800 (PST)", "From": "Naushir Patuck <naush@raspberrypi.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Wed, 17 Feb 2021 10:08:50 +0000", "Message-Id": "<20210217100852.1542397-1-naush@raspberrypi.com>", "X-Mailer": "git-send-email 2.25.1", "MIME-Version": "1.0", "Subject": "[libcamera-devel] [PATCH 1/3] pipeline: ipa: raspberrypi: Various\n\tfixups after IPAInterface changes", "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>", "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>" }, "content": "This commit addresses a few fixes and tidy-ups after the IPAInterface\nrework:\n- Rename ConfigStaggeredWrite -> ConfigSensorParams\n- Rename setIsp -> setIspControls\n- Switch to camel case for ISPConfig::embeddedbufferId and\nISPConfig::bayerbufferId.\n- Signal handlers statsMetadataComplete(), runISP(), embeddedComplete()\nshould only run when state != Stopped. This matches the behavior of\nthe original code. Without this, start/stop cycles may cause errors.\n- In setIspControls(), only update the LS config (with the fd) when a LS\ncontrol is present.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\nFixes: e201cb4f5450 (\"libcamera: IPAInterface: Replace C API with the new C++-only API\")\n---\n include/libcamera/ipa/raspberrypi.mojom | 8 ++---\n src/ipa/raspberrypi/raspberrypi.cpp | 8 ++---\n .../pipeline/raspberrypi/raspberrypi.cpp | 36 ++++++++++---------\n 3 files changed, 27 insertions(+), 25 deletions(-)", "diff": "diff --git a/include/libcamera/ipa/raspberrypi.mojom b/include/libcamera/ipa/raspberrypi.mojom\nindex bab19a946e18..9c05cc68cceb 100644\n--- a/include/libcamera/ipa/raspberrypi.mojom\n+++ b/include/libcamera/ipa/raspberrypi.mojom\n@@ -16,7 +16,7 @@ enum BufferMask {\n const uint32 MaxLsGridSize = 0x8000;\n \n enum ConfigOutputParameters {\n-\tConfigStaggeredWrite = 0x01,\n+\tConfigSensorParams = 0x01,\n };\n \n struct SensorConfig {\n@@ -27,8 +27,8 @@ struct SensorConfig {\n };\n \n struct ISPConfig {\n-\tuint32 embeddedbufferId;\n-\tuint32 bayerbufferId;\n+\tuint32 embeddedBufferId;\n+\tuint32 bayerBufferId;\n };\n \n struct ConfigInput {\n@@ -126,6 +126,6 @@ interface IPARPiEventInterface {\n \tstatsMetadataComplete(uint32 bufferId, ControlList controls);\n \trunIsp(uint32 bufferId);\n \tembeddedComplete(uint32 bufferId);\n-\tsetIsp(ControlList controls);\n+\tsetIspControls(ControlList controls);\n \tsetDelayedControls(ControlList controls);\n };\ndiff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp\nindex 81a3195c82e9..974f4ec63058 100644\n--- a/src/ipa/raspberrypi/raspberrypi.cpp\n+++ b/src/ipa/raspberrypi/raspberrypi.cpp\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::ConfigStaggeredWrite;\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@@ -447,11 +447,11 @@ void IPARPi::signalIspPrepare(const ipa::rpi::ISPConfig &data)\n \t * avoid running the control algos for a few frames in case\n \t * they are \"unreliable\".\n \t */\n-\tprepareISP(data.embeddedbufferId);\n+\tprepareISP(data.embeddedBufferId);\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@@ -968,7 +968,7 @@ void IPARPi::prepareISP(unsigned int bufferId)\n \t\t\tapplyDPC(dpcStatus, ctrls);\n \n \t\tif (!ctrls.empty())\n-\t\t\tsetIsp.emit(ctrls);\n+\t\t\tsetIspControls.emit(ctrls);\n \t}\n }\n \ndiff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex 15aa600ed581..8770ae66a21a 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -152,7 +152,7 @@ public:\n \tvoid statsMetadataComplete(uint32_t bufferId, const ControlList &controls);\n \tvoid runIsp(uint32_t bufferId);\n \tvoid embeddedComplete(uint32_t bufferId);\n-\tvoid setIsp(const ControlList &controls);\n+\tvoid setIspControls(const ControlList &controls);\n \tvoid setDelayedControls(const ControlList &controls);\n \n \t/* bufferComplete signal handlers. */\n@@ -1172,7 +1172,7 @@ int RPiCameraData::loadIPA()\n \tipa_->statsMetadataComplete.connect(this, &RPiCameraData::statsMetadataComplete);\n \tipa_->runIsp.connect(this, &RPiCameraData::runIsp);\n \tipa_->embeddedComplete.connect(this, &RPiCameraData::embeddedComplete);\n-\tipa_->setIsp.connect(this, &RPiCameraData::setIsp);\n+\tipa_->setIspControls.connect(this, &RPiCameraData::setIspControls);\n \tipa_->setDelayedControls.connect(this, &RPiCameraData::setDelayedControls);\n \n \tIPASettings settings(ipa_->configurationFile(sensor_->model() + \".json\"));\n@@ -1241,7 +1241,7 @@ int RPiCameraData::configureIPA(const CameraConfiguration *config)\n \t\treturn -EPIPE;\n \t}\n \n-\tif (result.params & ipa::rpi::ConfigStaggeredWrite) {\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@@ -1281,7 +1281,7 @@ int RPiCameraData::configureIPA(const CameraConfiguration *config)\n void RPiCameraData::statsMetadataComplete(uint32_t bufferId, const ControlList &controls)\n {\n \tif (state_ == State::Stopped)\n-\t\thandleState();\n+\t\treturn;\n \n \tFrameBuffer *buffer = isp_[Isp::Stats].getBuffers().at(bufferId);\n \n@@ -1314,7 +1314,7 @@ void RPiCameraData::statsMetadataComplete(uint32_t bufferId, const ControlList &\n void RPiCameraData::runIsp(uint32_t bufferId)\n {\n \tif (state_ == State::Stopped)\n-\t\thandleState();\n+\t\treturn;\n \n \tFrameBuffer *buffer = unicam_[Unicam::Image].getBuffers().at(bufferId);\n \n@@ -1329,26 +1329,28 @@ void RPiCameraData::runIsp(uint32_t bufferId)\n void RPiCameraData::embeddedComplete(uint32_t bufferId)\n {\n \tif (state_ == State::Stopped)\n-\t\thandleState();\n+\t\treturn;\n \n \tFrameBuffer *buffer = unicam_[Unicam::Embedded].getBuffers().at(bufferId);\n \thandleStreamBuffer(buffer, &unicam_[Unicam::Embedded]);\n \thandleState();\n }\n \n-void RPiCameraData::setIsp(const ControlList &controls)\n+void RPiCameraData::setIspControls(const ControlList &controls)\n {\n \tControlList ctrls = controls;\n \n-\tSpan<const uint8_t> s =\n-\t\tctrls.get(V4L2_CID_USER_BCM2835_ISP_LENS_SHADING).data();\n-\tbcm2835_isp_lens_shading ls =\n-\t\t*reinterpret_cast<const bcm2835_isp_lens_shading *>(s.data());\n-\tls.dmabuf = lsTable_.fd();\n+\tif (ctrls.contains(V4L2_CID_USER_BCM2835_ISP_LENS_SHADING)) {\n+\t\tSpan<const uint8_t> s =\n+\t\t\tctrls.get(V4L2_CID_USER_BCM2835_ISP_LENS_SHADING).data();\n+\t\tbcm2835_isp_lens_shading ls =\n+\t\t\t*reinterpret_cast<const bcm2835_isp_lens_shading *>(s.data());\n+\t\tls.dmabuf = lsTable_.fd();\n \n-\tControlValue c(Span<const uint8_t>{ reinterpret_cast<uint8_t *>(&ls),\n-\t\t\t\t\t sizeof(ls) });\n-\tctrls.set(V4L2_CID_USER_BCM2835_ISP_LENS_SHADING, c);\n+\t\tControlValue c(Span<const uint8_t>{ reinterpret_cast<uint8_t *>(&ls),\n+\t\t\t\t\t\t sizeof(ls) });\n+\t\tctrls.set(V4L2_CID_USER_BCM2835_ISP_LENS_SHADING, c);\n+\t}\n \n \tisp_[Isp::Input].dev()->setControls(&ctrls);\n \thandleState();\n@@ -1692,8 +1694,8 @@ void RPiCameraData::tryRunPipeline()\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+\tispPrepare.embeddedBufferId = ipa::rpi::MaskEmbeddedData | embeddedId;\n+\tispPrepare.bayerBufferId = ipa::rpi::MaskBayerData | bayerId;\n \tipa_->signalIspPrepare(ispPrepare);\n }\n \n", "prefixes": [ "libcamera-devel", "1/3" ] }