Show a patch.

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

{
    "id": 18349,
    "url": "https://patchwork.libcamera.org/api/patches/18349/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/18349/",
    "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-4-naush@raspberrypi.com>",
    "date": "2023-03-07T10:30:23",
    "name": "[libcamera-devel,v3,3/3] pipeline: raspberrypi: Add a Unicam timeout override config options",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "a294623a86a1c0a0dbf36c0e881dc36b9d0567f6",
    "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/18349/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/18349/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/18349/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 222EBC329C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  7 Mar 2023 10:30:25 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 26EFD626C9;\n\tTue,  7 Mar 2023 11:30:24 +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 A4F77626B0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  7 Mar 2023 11:30:21 +0100 (CET)",
            "by mail-wr1-x434.google.com with SMTP id e13so11572012wro.10\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 07 Mar 2023 02:30:21 -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.20\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 07 Mar 2023 02:30:20 -0800 (PST)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1678185024;\n\tbh=lGYbbxoqtpGGSf8cC/frHzgSz4mi2oydf29mWnS4u/s=;\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=mzNDEKDAktkrNkXfVlaT4VNytGQuv079FI9ze9atp/swXtIAJuQSJ5LYlRbPU/7Q+\n\tmxp53dBy0KZTXl89jKVH38O535vNBV/7573A0EFO7QvKt8FmsZRJbbCqnDD0Gi1BjX\n\tG3WfHKC2aY8R4hZtiUS+JBxe18lAM5P5QUzg6bW5CCV8mCchF/muUaUeoCMbZGmnh1\n\tSMw5xrseZTqMdLEqnb7oTUdGAvI+JwG1uFkZs3AH3crqKB36K6RvVIilBpCVfL5/1m\n\tMV7XmjbtQKRRVATs+5IwQlE4joEjik7MYOjwQFSaiTAuFNTvvYK/pCAJSscrw+J5it\n\tSEJY487H1MxOQ==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1678185021;\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=hf459/AQVIscT2N7Fl1SGWffRnnAiMEDRDiXUOvhwZQ=;\n\tb=RpjGoED6Z2R5cMy6MmTrUBs+dBXru/YHq7FiGyradTXMaq+MjoScdkFftSW71GGL5O\n\t4kZxmMDPEsf4NBbc1BqM+MvbL3AniKHh3vEOT7YzzJcz6L+O0uOv0ykBtVMe7jAhFgBC\n\tD/ZXWH1mV1dsZrbrwzLVPEs7DK+EMKbSR9HZdVFXtQG8BcMdaZORZsnQOV2A6/bU5waa\n\tfxCx5o33AROD5wYheQBOKTkBAowYT1Bx99KjXfnRF+Gm9/fClADuKVlnd+rgML2jUPJ5\n\tdJKvZs4OI38nw2RJagejSGBnSDuojOd/jO5DWlpnCsNSk7Xnlo5V1IU/R9KjO/rAGt9f\n\t9GuQ=="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"RpjGoED6\"; dkim-atps=neutral",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112; t=1678185021;\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=hf459/AQVIscT2N7Fl1SGWffRnnAiMEDRDiXUOvhwZQ=;\n\tb=B02xWH6mLSDQZDGS4tmwTqKTbt/Z5bLWKUIMdLXWw37b/aOAuogaqGAri6CMxOcoyJ\n\tcq0N72+HeziP++RcRdkQVfQQLEJtDlUDktk0EyXUFpmjGefeUOPPBDafTBfb1cj6P3PR\n\tPT1+swTy8H3ssLvdt9Z7d13H0W76z25wjoPZLPqwCj2DpYxbMqhCca3UabyEXtl0GHvG\n\tfI1R8aMIGmfrgz1sCfHX9n280k67NGd3NX3IYqvShb5EUO4oXVXNuV6lOOHCdYWEAtRQ\n\t5f7qchWit2NmGnTsQxNwZWkATqi1s1O7n1UL09yuSVCHXV3l7BLiKwWp1yI7xCtZD7lZ\n\tHiXw==",
        "X-Gm-Message-State": "AO0yUKU0jY8oVWSSIM0JFvGILiXtHCJ0OG19AJsdG5mTVpacKZcMPVy6\n\tzCmGW7TL+v0t1kZUPo/USopY5MY5BPLShWoiw6bMGQ==",
        "X-Google-Smtp-Source": "AK7set/CrvW9fikQXhI0yhCk1XSp3F7Tkyt8l7v1GaPu72mxGmtHHex5yTYwhGU86bs/8Lv+mFCXQw==",
        "X-Received": "by 2002:a05:6000:c4:b0:2c7:5247:e496 with SMTP id\n\tq4-20020a05600000c400b002c75247e496mr7801252wrx.60.1678185021068; \n\tTue, 07 Mar 2023 02:30:21 -0800 (PST)",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Tue,  7 Mar 2023 10:30:23 +0000",
        "Message-Id": "<20230307103023.3932-4-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 3/3] pipeline: raspberrypi: Add a\n\tUnicam timeout override config options",
        "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 a new parameter to the pipeline handler config file named\n\"unicam_timeout_value_ms\" to allow users to override the automatically\ncomputed Unicam timeout value.\n\nThis value is given in milliseconds, and setting a value of 0 (the\ndefault value) disables the override.\n\nAn example use of this parameter would be if an application configured a\nRAW stream, and provides buffers for the stream on every request. If the\napplication holds off on sending requests for a particular reason (e.g.\na timelapse use case), then we will possibly hit the watchdog timeout as\nit is only a small multiple of the frame length. This override allows an\napplication to select a larger value with the knowledge that it may\nspace requests longer than the calculated timeout value.\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>\n---\n .../pipeline/raspberrypi/data/example.yaml         | 11 ++++++++++-\n src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 14 ++++++++++++++\n 2 files changed, 24 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/src/libcamera/pipeline/raspberrypi/data/example.yaml b/src/libcamera/pipeline/raspberrypi/data/example.yaml\nindex ad5f2344384f..c90f518f8849 100644\n--- a/src/libcamera/pipeline/raspberrypi/data/example.yaml\n+++ b/src/libcamera/pipeline/raspberrypi/data/example.yaml\n@@ -32,6 +32,15 @@\n                 # Override any request from the IPA to drop a number of startup\n                 # frames.\n                 #\n-                # \"disable_startup_frame_drops\": false\n+                # \"disable_startup_frame_drops\": false,\n+\n+                # Custom timeout value (in ms) for Unicam to use. This overrides\n+                # the value computed by the pipeline handler based on frame\n+                # durations.\n+                #\n+                # Set this value to 0 to use the pipeline handler computed\n+                # timeout value.\n+                #\n+                # \"unicam_timeout_value_ms\": 0,\n         }\n }\ndiff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex 3d04842a2440..58bab6b6e0d5 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -319,6 +319,11 @@ public:\n \t\t * frames.\n \t\t */\n \t\tbool disableStartupFrameDrops;\n+\t\t/*\n+\t\t * Override the Unicam timeout value calculated by the IPA based\n+\t\t * on frame durations.\n+\t\t */\n+\t\tunsigned int unicamTimeoutValue;\n \t};\n \n \tConfig config_;\n@@ -1715,6 +1720,7 @@ int RPiCameraData::loadPipelineConfiguration()\n \t\t.minUnicamBuffers = 2,\n \t\t.minTotalUnicamBuffers = 4,\n \t\t.disableStartupFrameDrops = false,\n+\t\t.unicamTimeoutValue = 0,\n \t};\n \n \tchar const *configFromEnv = utils::secure_getenv(\"LIBCAMERA_RPI_CONFIG_FILE\");\n@@ -1750,6 +1756,14 @@ int RPiCameraData::loadPipelineConfiguration()\n \t\tphConfig[\"min_total_unicam_buffers\"].get<unsigned int>(config_.minTotalUnicamBuffers);\n \tconfig_.disableStartupFrameDrops =\n \t\tphConfig[\"disable_startup_frame_drops\"].get<bool>(config_.disableStartupFrameDrops);\n+\tconfig_.unicamTimeoutValue =\n+\t\tphConfig[\"unicam_timeout_value_ms\"].get<unsigned int>(config_.unicamTimeoutValue);\n+\n+\tif (config_.unicamTimeoutValue) {\n+\t\t/* Disable the IPA signal to control timeout and set the user requested value. */\n+\t\tipa_->setCameraTimeout.disconnect();\n+\t\tunicam_[Unicam::Image].dev()->setDequeueTimeout(config_.unicamTimeoutValue * 1ms);\n+\t}\n \n \tif (config_.minTotalUnicamBuffers < config_.minUnicamBuffers) {\n \t\tLOG(RPI, Error) << \"Invalid configuration: min_total_unicam_buffers must be >= min_unicam_buffers\";\n",
    "prefixes": [
        "libcamera-devel",
        "v3",
        "3/3"
    ]
}