Show a patch.

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

{
    "id": 17603,
    "url": "https://patchwork.libcamera.org/api/patches/17603/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/17603/",
    "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": "<20221014131846.27169-8-naush@raspberrypi.com>",
    "date": "2022-10-14T13:18:43",
    "name": "[libcamera-devel,v1,07/10] pipeline: raspberrypi: Add a parameter to disable startup drop frames",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "700ec138aae10e09e26214fbbe1a2cf1e4e33d21",
    "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/17603/mbox/",
    "series": [
        {
            "id": 3555,
            "url": "https://patchwork.libcamera.org/api/series/3555/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3555",
            "date": "2022-10-14T13:18:37",
            "name": "Raspberry Pi: Platform configuration and buffer allocation improvements",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/3555/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/17603/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/17603/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 B342BC3287\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 14 Oct 2022 13:19:03 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4A61E62DCF;\n\tFri, 14 Oct 2022 15:19:03 +0200 (CEST)",
            "from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com\n\t[IPv6:2a00:1450:4864:20::32a])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 79FAC62DC2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 14 Oct 2022 15:18:57 +0200 (CEST)",
            "by mail-wm1-x32a.google.com with SMTP id\n\tbg9-20020a05600c3c8900b003bf249616b0so3489844wmb.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 14 Oct 2022 06:18:57 -0700 (PDT)",
            "from naush-laptop.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\tg17-20020a05600c001100b003c6bbe910fdsm8282458wmc.9.2022.10.14.06.18.56\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 14 Oct 2022 06:18:56 -0700 (PDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1665753543;\n\tbh=yPJ3S5ePksDxI13TuKjRrYLoz3QD65zs4J/EG6QH2Gs=;\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:\n\tFrom;\n\tb=C+tb0tOlNM8bj54ceSui2bjiriZE16hp1M7p7uxP/Sn51MyksHwcFjiG+VuDqNUZC\n\t4EIqx2G7QbPQlEGUf9qcQVEAsldSDKE2ULVlWhGgARltmVHe3C41KsMiS1f+k/2V27\n\t5esbEBXMOjg2iA0VEmq7vv85HkV3Jh5P7H8uz8Rc4kVVMpElinL+5PjnaK/TQVmccg\n\tFneYi7L4UXPXCGKQb9rMEDBe5DU59YbUn7QrzGRGZugAsj3Qe0SsWVMw+GdncMRSLV\n\trIBo63I0XNouiawTEzqfHmv2e/AwjRJ6qujuTBCDdxlCQSqtKjHsgjcKYfLmj+F9Gn\n\t3QYp3u/D6tnoA==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\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=9MEcdherGyKKJA3fExM5ot5SzxT8Cp9XWWgwst113Kw=;\n\tb=VyxR7uBGRO8lL5b6ag4t5alQSKYqGVPjk0f78Yw5bgHYIf0JQ70o9Zg9VmuDsmO0Vc\n\tU1xY2E+SEx1seCUXgFOElUfrZpKM39MJnirZKLrA9jd5sHIB0EQ+O5KDEbabXfwGOmHg\n\tU26OcH/7taul+B7rdLfpkJpoKkxBut9EeNawcxVS9ep3O3LHz5GylFCMTAGp4vN6cwIA\n\t0/UtYfruVcPxvfvnXtnFxisws0BIFilnAF8p0tV9AnxmgZL/4zUvQjICejB+4ydufJ9i\n\tz5LbDIm4zX8GNJM8BUvyeGDmbF99IEV1jBmi9FxyZQ2u7XsAEK554WC5SJxZAwEYs6ui\n\tSthw=="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"VyxR7uBG\"; dkim-atps=neutral",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\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=9MEcdherGyKKJA3fExM5ot5SzxT8Cp9XWWgwst113Kw=;\n\tb=Z0PKZTF9O0ljjZ/K2ot3adWMxQVs0zpO+BZZ1vY70CT9Bc8UA1Fk7KwffyXIKR1I+N\n\tGZXATHIPl17i7QBRyjcI0IW2AawjyG7LCbSmWLZX/v/HSf3xbLgP7cfaWvginM3GpkkJ\n\tme/Z3qeWtgdFOkiU2zxtGKrCRTOj/qQ2N5Ku0b6y+kinYg3clYMrpKeOY+EQvgRCaZ48\n\tkc+S2JqjndNGTa2V/uAqms4otbSN3XR4H1Is+dSrMoccjQTsROjPi4UjCAN8wBqqCtmn\n\to67XC3l6aC6+gNQSCF9WHVJXZ8n/SohopOCG1LmHAa8qPYwqnjjr3WNSDv/au1ks/1N6\n\tonrg==",
        "X-Gm-Message-State": "ACrzQf038OxLiN2vcxBLsUDdmEvuG43LwO7vx/gP8rV3onTOcZe90ElC\n\tCCWPPSY+4ARuV6Npyb91T+lfJvHsLxfydg==",
        "X-Google-Smtp-Source": "AMsMyM6lSi/aojev0iSoDyNQTEZsodhslEC/3GJCJQsULQ2vwYWYbC5fZodCGeRa9wS2kPcJsQIprg==",
        "X-Received": "by 2002:a05:600c:3147:b0:3c6:d28e:4440 with SMTP id\n\th7-20020a05600c314700b003c6d28e4440mr9280868wmo.68.1665753536853; \n\tFri, 14 Oct 2022 06:18:56 -0700 (PDT)",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Fri, 14 Oct 2022 14:18:43 +0100",
        "Message-Id": "<20221014131846.27169-8-naush@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20221014131846.27169-1-naush@raspberrypi.com>",
        "References": "<20221014131846.27169-1-naush@raspberrypi.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v1 07/10] pipeline: raspberrypi: Add a\n\tparameter to disable startup drop frames",
        "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>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Add a new pipeline config parameter \"disable_startup_frame_drops\" to disable\nany startup drop frames, overriding the IPA request.\n\nWhen this parameter is set, it allows the pipeline handler to run with no\ninternally allocated Unicam buffers (\"min_unicam_buffers\").\n\nAdd a validation to ensure if \"disable_startup_frame_drops\" is false, at least\none internal Unicam buffer is allocated, possibly overriding the\n\"min_unicam_buffers\" parameter.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n---\n .../pipeline/raspberrypi/data/default.json        |  7 +++++--\n .../pipeline/raspberrypi/raspberrypi.cpp          | 15 ++++++++++++++-\n 2 files changed, 19 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/src/libcamera/pipeline/raspberrypi/data/default.json b/src/libcamera/pipeline/raspberrypi/data/default.json\nindex a7ea735c87f4..707414bcc5c5 100644\n--- a/src/libcamera/pipeline/raspberrypi/data/default.json\n+++ b/src/libcamera/pipeline/raspberrypi/data/default.json\n@@ -5,7 +5,7 @@\n         \"pipeline_handler\":\n         {\n                 # The minimum number of internal buffers to be allocated for Unicam.\n-                # This value must be greater than 0, but less than or equal to min_total_unicam_buffers.\n+                # This value must less than or equal to min_total_unicam_buffers.\n                 \"min_unicam_buffers\": 2,\n \n                 # The minimum total (internal + external) buffer count used for Unicam.\n@@ -15,6 +15,9 @@\n                 \"min_total_unicam_buffers\": 4,\n                 \n                 # The number of internal buffers used for ISP Output0.\n-                \"num_output0_buffers\": 1\n+                \"num_output0_buffers\": 1,\n+\n+                # Override any request from the IPA to drop a number of startup frames.\n+                \"disable_startup_frame_drops\": false\n         }\n }\ndiff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex 2aba0430c02e..135948d82f41 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -300,6 +300,7 @@ public:\n \t\tunsigned int minUnicamBuffers;\n \t\tunsigned int minTotalUnicamBuffers;\n \t\tunsigned int numOutput0Buffers;\n+\t\tbool disableStartupFrameDrops;\n \t};\n \n \tConfig config_;\n@@ -1044,7 +1045,7 @@ int PipelineHandlerRPi::start(Camera *camera, const ControlList *controls)\n \t\tdata->setSensorControls(startConfig.controls);\n \n \t/* Configure the number of dropped frames required on startup. */\n-\tdata->dropFrameCount_ = startConfig.dropFrameCount;\n+\tdata->dropFrameCount_ = data->config_.disableStartupFrameDrops ? 0 : startConfig.dropFrameCount;\n \n \tfor (auto const stream : data->streams_)\n \t\tstream->resetBuffers();\n@@ -1430,6 +1431,7 @@ int PipelineHandlerRPi::configurePipelineHandler(RPiCameraData *data)\n \t\t.minUnicamBuffers = 2,\n \t\t.minTotalUnicamBuffers = 4,\n \t\t.numOutput0Buffers = 1,\n+\t\t.disableStartupFrameDrops = false,\n \t};\n \n \tchar const *configFromEnv = utils::secure_getenv(\"LIBCAMERA_RPI_CONFIG_FILE\");\n@@ -1464,6 +1466,8 @@ int PipelineHandlerRPi::configurePipelineHandler(RPiCameraData *data)\n \t\tphConfig[\"min_total_unicam_buffers\"].get<unsigned int>(config.minTotalUnicamBuffers);\n \tconfig.numOutput0Buffers =\n \t\tphConfig[\"num_output0_buffers\"].get<unsigned int>(config.numOutput0Buffers);\n+\tconfig.disableStartupFrameDrops =\n+\t\tphConfig[\"disable_startup_frame_drops\"].get<bool>(config.disableStartupFrameDrops);\n \n \tif (config.minTotalUnicamBuffers < config.minUnicamBuffers || config.minTotalUnicamBuffers < 1) {\n \t\tLOG(RPI, Error) << \"Invalid Unicam buffer configuration used!\";\n@@ -1543,6 +1547,15 @@ int PipelineHandlerRPi::prepareBuffers(Camera *camera)\n \t\t\t */\n \t\t\tnumBuffers = std::max<int>(data->config_.minUnicamBuffers,\n \t\t\t\t\t\t   minBuffers - numRawBuffers);\n+\n+\t\t\tif (numBuffers == 0 && data->dropFrameCount_) {\n+\t\t\t\tLOG(RPI, Warning)\n+\t\t\t\t\t<< \"Configured with no Unicam buffers,\"\n+\t\t\t\t\t   \" but the IPA requested startup frame drops.\"\n+\t\t\t\t\t   \" Increasing to one buffer.\";\n+\t\t\t\tnumBuffers = 1;\n+\t\t\t}\n+\n \t\t\tdata->numUnicamBuffers = numBuffers;\n \t\t} else if (stream == &data->isp_[Isp::Input]) {\n \t\t\t/*\n",
    "prefixes": [
        "libcamera-devel",
        "v1",
        "07/10"
    ]
}