Patch Detail
Show a patch.
GET /api/patches/18347/?format=api
{ "id": 18347, "url": "https://patchwork.libcamera.org/api/patches/18347/?format=api", "web_url": "https://patchwork.libcamera.org/patch/18347/", "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": "<20230307103023.3932-2-naush@raspberrypi.com>", "date": "2023-03-07T10:30:21", "name": "[libcamera-devel,v3,1/3] pipeline: ipa: raspberrypi: Change Unicam timeout handling", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "ccebaec06f94ca86e8a2c04526a9ce7e7194e6d5", "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/18347/mbox/", "series": [ { "id": 3791, "url": "https://patchwork.libcamera.org/api/series/3791/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3791", "date": "2023-03-07T10:30:20", "name": "Raspberry Pi: Improving camera timeouts", "version": 3, "mbox": "https://patchwork.libcamera.org/series/3791/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/18347/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/18347/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 CA8D0C3262\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 7 Mar 2023 10:30:23 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 193DD626C2;\n\tTue, 7 Mar 2023 11:30:22 +0100 (CET)", "from mail-wr1-x434.google.com (mail-wr1-x434.google.com\n\t[IPv6:2a00:1450:4864:20::434])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 168DA6266A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 7 Mar 2023 11:30:20 +0100 (CET)", "by mail-wr1-x434.google.com with SMTP id e13so11571925wro.10\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 07 Mar 2023 02:30:20 -0800 (PST)", "from localhost.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\tr1-20020a056000014100b002c5534db60bsm12523621wrx.71.2023.03.07.02.30.18\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 07 Mar 2023 02:30:19 -0800 (PST)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1678185022;\n\tbh=p4NX4NT6AUG8DZqOr71i/qWbOUcv1IEEHvyDAOhZ0kA=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=KByPWuoyqr0CNdsOQznUURdiwC6h9O4S0dE1MkPbxwrT9+Q1DCFeF8aJPDv23eAcX\n\tED7/ONKINIeHUKbF74/LzmsnM00wUMbV28/vbsmEygvGkDxYGmYJ47jMgD9QFZIM0Q\n\tEJWTKG/cN++Et+fuvjXlsoVAGYJIdUVATYSn87RZoE1Oux6bTBkBQGfLeR1k2bo/eR\n\t2w5j46UhbEqYHwPafz2fxkpAktiJib9YEqsnyIAYC4S0a7spwfPP+KsjmM3n7GuPIx\n\tHijZGcyM35C7FWyX50zLqSj+eksF0LR82Ah+FRaPAtEg6oCtxQH9s9I6//Xit0CMAk\n\tNZh4IoxnRETjA==", "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1678185019;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=3gAHJm9NpiQ1zfRhg6VO2npvj+v9NiZ4ZFdagsdSiow=;\n\tb=AkzSOT96rKWukUYg3zPM0BQ+M8cNo+rXXEJvFx7XGajh+1a1JJi0ZMExN3J/L8t7xI\n\t/UXdMP1GySR72QN/HCuVri3emMQ1wJ30az1XR449fLBiBHTObtMe0vWaVaHiBqLbzvFj\n\tp8GMX96YnAr5Jmd+TzGI1qY805rwaXhL3ANxbtQHDue83zFV8hUArC2u3kw5OcqO61ON\n\t54t3IueRoqp66SsDMml9jbQKsKgEsKSouqoXdt7XBPoI6TanTRlUjXDl8ChSAOb4wLPA\n\taW/6TcoYbdnX6oc+UUe9uvFe/IbM9+KGQTsxHbs3Wep8aGT765EfOgAvB8c03WnDlYv/\n\tHVqA==" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"AkzSOT96\"; dkim-atps=neutral", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112; t=1678185019;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=3gAHJm9NpiQ1zfRhg6VO2npvj+v9NiZ4ZFdagsdSiow=;\n\tb=V545Sz2cWfz/kMUbV2xz2RrHzK39RdoIWnT1idaqbmFNRBycZcp30vne43Zw1D+wh/\n\t9O5gOkaqBg4ItCqKQESmSnVPSRgM38bDj8jiCmfml/9A1BKedPVY18oF1sQehiAHG2e3\n\t2MPT7RhFzz2fpkIM1syEOclLvl222c4LnIR27ICUnhPJtb8+kxuLWgeTXazRibn7MXer\n\t/zZVdYsV3qvDntWvK51G+A67zMCa/bEzHJ+p34IXLyPboeJ6WZ/OfrR3vKYnuHQwbvfN\n\tFRsq0Si9XgNxpnQMM1vDPIbIIeOiewkE7/yNz0BzTVc6a+jbRQOAT3kgehR4zpeXoMDY\n\tCduQ==", "X-Gm-Message-State": "AO0yUKVZySZYwGQgdaMKaJP+fFa27RGJPhl5HvuMnRZW64EC3RQVz/Iw\n\tXbDsfePIPxwxM+QpDT1sVF1ShD2qY7h9R0aMDFE7kw==", "X-Google-Smtp-Source": "AK7set87XyUyvkxCES5pFuLDcwv2Ft+fgoFZBvwDzfTPA56BBe96wXfzk0udQ53wAeZStTEchX8yaA==", "X-Received": "by 2002:a5d:558e:0:b0:2c9:e5f0:bd4f with SMTP id\n\ti14-20020a5d558e000000b002c9e5f0bd4fmr9082931wrv.18.1678185019472; \n\tTue, 07 Mar 2023 02:30:19 -0800 (PST)", "To": "libcamera-devel@lists.libcamera.org", "Date": "Tue, 7 Mar 2023 10:30:21 +0000", "Message-Id": "<20230307103023.3932-2-naush@raspberrypi.com>", "X-Mailer": "git-send-email 2.34.1", "In-Reply-To": "<20230307103023.3932-1-naush@raspberrypi.com>", "References": "<20230307103023.3932-1-naush@raspberrypi.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v3 1/3] pipeline: ipa: raspberrypi: Change\n\tUnicam timeout handling", "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": "Jacopo Mondi <jacopo.mondi@ideasonboard.com>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "Add an explicit helper function setCameraTimeout() in the pipeline\nhandler to set the Unicam timeout value. This function is signalled from\nthe IPA to set up an appropriate timeout. This replaces the\nmaxSensorFrameLengthMs value parameter returned back from\nIPARPi::start().\n\nAdjust the timeout to be 5x the maximum frame duration reported by the\nIPA.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\nReviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n include/libcamera/ipa/raspberrypi.mojom | 2 +-\n src/ipa/raspberrypi/raspberrypi.cpp | 2 +-\n .../pipeline/raspberrypi/raspberrypi.cpp | 24 ++++++++++++-------\n 3 files changed, 18 insertions(+), 10 deletions(-)", "diff": "diff --git a/include/libcamera/ipa/raspberrypi.mojom b/include/libcamera/ipa/raspberrypi.mojom\nindex 8e78f167f179..80e0126618c8 100644\n--- a/include/libcamera/ipa/raspberrypi.mojom\n+++ b/include/libcamera/ipa/raspberrypi.mojom\n@@ -49,7 +49,6 @@ struct IPAConfigResult {\n struct StartConfig {\n \tlibcamera.ControlList controls;\n \tint32 dropFrameCount;\n-\tuint32 maxSensorFrameLengthMs;\n };\n \n interface IPARPiInterface {\n@@ -132,4 +131,5 @@ interface IPARPiEventInterface {\n \tsetIspControls(libcamera.ControlList controls);\n \tsetDelayedControls(libcamera.ControlList controls, uint32 delayContext);\n \tsetLensControls(libcamera.ControlList controls);\n+\tsetCameraTimeout(uint32 maxFrameLengthMs);\n };\ndiff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp\nindex 9b08ae4ca622..f6826bf27fe1 100644\n--- a/src/ipa/raspberrypi/raspberrypi.cpp\n+++ b/src/ipa/raspberrypi/raspberrypi.cpp\n@@ -341,7 +341,7 @@ void IPARPi::start(const ControlList &controls, StartConfig *startConfig)\n \n \tstartConfig->dropFrameCount = dropFrameCount_;\n \tconst Duration maxSensorFrameDuration = mode_.maxFrameLength * mode_.maxLineLength;\n-\tstartConfig->maxSensorFrameLengthMs = maxSensorFrameDuration.get<std::milli>();\n+\tsetCameraTimeout.emit(maxSensorFrameDuration.get<std::milli>());\n \n \tfirstStart_ = false;\n \tlastRunTimestamp_ = 0;\ndiff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex 841209548350..3d04842a2440 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -212,6 +212,7 @@ public:\n \tvoid setIspControls(const ControlList &controls);\n \tvoid setDelayedControls(const ControlList &controls, uint32_t delayContext);\n \tvoid setLensControls(const ControlList &controls);\n+\tvoid setCameraTimeout(uint32_t maxExposureTimeMs);\n \tvoid setSensorControls(ControlList &controls);\n \tvoid unicamTimeout();\n \n@@ -1166,14 +1167,6 @@ int PipelineHandlerRPi::start(Camera *camera, const ControlList *controls)\n \t\t}\n \t}\n \n-\t/*\n-\t * Set the dequeue timeout to the larger of 2x the maximum possible\n-\t * frame duration or 1 second.\n-\t */\n-\tutils::Duration timeout =\n-\t\tstd::max<utils::Duration>(1s, 2 * startConfig.maxSensorFrameLengthMs * 1ms);\n-\tdata->unicam_[Unicam::Image].dev()->setDequeueTimeout(timeout);\n-\n \treturn 0;\n }\n \n@@ -1645,6 +1638,7 @@ int RPiCameraData::loadIPA(ipa::RPi::IPAInitResult *result)\n \tipa_->setIspControls.connect(this, &RPiCameraData::setIspControls);\n \tipa_->setDelayedControls.connect(this, &RPiCameraData::setDelayedControls);\n \tipa_->setLensControls.connect(this, &RPiCameraData::setLensControls);\n+\tipa_->setCameraTimeout.connect(this, &RPiCameraData::setCameraTimeout);\n \n \t/*\n \t * The configuration (tuning file) is made from the sensor name unless\n@@ -1957,6 +1951,20 @@ void RPiCameraData::setLensControls(const ControlList &controls)\n \t}\n }\n \n+void RPiCameraData::setCameraTimeout(uint32_t maxFrameLengthMs)\n+{\n+\t/*\n+\t * Set the dequeue timeout to the larger of 5x the maximum reported\n+\t * frame length advertised by the IPA over a number of frames. Allow\n+\t * a minimum timeout value of 1s.\n+\t */\n+\tutils::Duration timeout =\n+\t\tstd::max<utils::Duration>(1s, 5 * maxFrameLengthMs * 1ms);\n+\n+\tLOG(RPI, Debug) << \"Setting Unicam timeout to \" << timeout;\n+\tunicam_[Unicam::Image].dev()->setDequeueTimeout(timeout);\n+}\n+\n void RPiCameraData::setSensorControls(ControlList &controls)\n {\n \t/*\n", "prefixes": [ "libcamera-devel", "v3", "1/3" ] }