{"id":18136,"url":"https://patchwork.libcamera.org/api/1.1/patches/18136/?format=json","web_url":"https://patchwork.libcamera.org/patch/18136/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20230118085953.7027-11-naush@raspberrypi.com>","date":"2023-01-18T08:59:51","name":"[libcamera-devel,v5,10/12] pipeline: raspberrypi: Add a parameter to disable startup drop frames","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"d7728ea54dd577fca4ab8c02a56ee38811b4e78b","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/1.1/people/34/?format=json","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/18136/mbox/","series":[{"id":3713,"url":"https://patchwork.libcamera.org/api/1.1/series/3713/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3713","date":"2023-01-18T08:59:41","name":"Raspberry Pi: Platform configuration and buffer allocation improvements","version":5,"mbox":"https://patchwork.libcamera.org/series/3713/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/18136/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/18136/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 BAC14C3240\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 18 Jan 2023 09:01:28 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 63D95625EF;\n\tWed, 18 Jan 2023 10:01:28 +0100 (CET)","from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com\n\t[IPv6:2a00:1450:4864:20::42c])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 56AC8625F5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 18 Jan 2023 10:01:22 +0100 (CET)","by mail-wr1-x42c.google.com with SMTP id d2so13062097wrp.8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 18 Jan 2023 01:01:22 -0800 (PST)","from localhost.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\ti6-20020adfe486000000b002423dc3b1a9sm30312464wrm.52.2023.01.18.01.01.21\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 18 Jan 2023 01:01:21 -0800 (PST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1674032488;\n\tbh=xWEJkF6fwmg+ej+XN2M6IqJL/P22tjDDj7dvCFuyLAg=;\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=0emIc8dKJp+Fvxt29RXorP8KYQccq/27Y+u71oiSsn401cW/cGK4FSHWa4plLSddE\n\to7WM9I/bG87l0gg9OK6eZWd71n3UK5JAokVXifOyaLlTAxvwFFWXp0lJvaNuHN8f78\n\t0EbzWyAE96qBVvq7KoKDvTA2zjQImQg3LUnUxVJJiWMHfSQ0AHQgrJwG+L8UL29W2D\n\tMnMwPZDhFv0d5NPFgN2V1H64woPQ3hj2QNMySi6bMAhNIvWFvn88007BGcYoqxiwnM\n\tyic5VpAiMQtH33gSrpLDdNl3hZNRaba+rsYI8ANFcHVF52pE8oKXR/mIHeKH29r2+9\n\td74dB/c7qwAxg==","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=Xm9A0Dc0ylC7MuHawpOh5lFzItkxnCtpqzdPfEfou7U=;\n\tb=jd+8h6CCvQAhG2OxH29I9t6kXMUTdqkzE4jTPalYIrBaxF03Eol6baf2x7n/JAnTzg\n\tXZ8F+3CMsKdoj4sWnc9Us9fOPBa/AuoIfD2keVA8zceRZjhiXUvEYF0p3g3g6P4KTILW\n\t8EcPMxspfYWMGHDpaVJPvOXgWjnuhFcKufYuyM+5mIl2dpkbwuPRy2669rK1aNZLS6fc\n\tT2aBva7QrPvjrdHESXDLIgdgcy/O2+ZBRcxeUymzkDPKtsmWAUv00PgoW2pewS+308LW\n\tdyGutZvop3zkgQ6Z9+JBAdGGz3tUwPXIpLuZjcnFflHJJ71Q+ClWGImLkMCvuLgLufqm\n\tWLPQ=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"jd+8h6CC\"; 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=Xm9A0Dc0ylC7MuHawpOh5lFzItkxnCtpqzdPfEfou7U=;\n\tb=02isU2CBxC3uoVVkJk47YQxWUPiAlf5CwNy6ZGs8dJxIgIGcD2zc1MvhrLHgAgLXao\n\tWf5m31MPlGyqQEoFURHfmjTwMCjIhG7gQ2wBtBxYWzVIpTMgNK2AjTbMp1C5k0RGwVSm\n\tdhC670sEhzEfx6jM7HlhDGmhcrmBjn5Afu2qYp8c4rsxHKtEwJcpy2RidVHuUEHWO0jX\n\t6s+AFDMFaIc+qJqrC0bAnfKYPhCY0nEyGu1dw9nJ5pkOWMnQXKFS337zND4WZnO2Vsvm\n\tNTb9/omy0JcZabMsD341/8Z29aSXIpsS9bc6UEmDjUNXBOZRiRaC1HZwq6n3wE0EIAxc\n\tEFyw==","X-Gm-Message-State":"AFqh2kohQghd9HR3S1qybyIfeFdFH2ujlSjWvNNoSyKnOkY+CbbxpuEb\n\tEiAJqSR5Zcet2TQFHis+sG0cZm1B5UArmAoZzVo=","X-Google-Smtp-Source":"AMrXdXtiJNJdZBQDplNOt3BDxK/f9XlMjgLEVFBxpY4YlmgkLGgYOggkZ3Z5Rkkf8xigzaeJ8EMgrA==","X-Received":"by 2002:a5d:5224:0:b0:2bd:bbf7:1f87 with SMTP id\n\ti4-20020a5d5224000000b002bdbbf71f87mr6124530wra.60.1674032481781; \n\tWed, 18 Jan 2023 01:01:21 -0800 (PST)","To":"libcamera-devel@lists.libcamera.org","Date":"Wed, 18 Jan 2023 08:59:51 +0000","Message-Id":"<20230118085953.7027-11-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.25.1","In-Reply-To":"<20230118085953.7027-1-naush@raspberrypi.com>","References":"<20230118085953.7027-1-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v5 10/12] 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\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\n---\n src/libcamera/pipeline/raspberrypi/data/example.yaml |  6 +++++-\n src/libcamera/pipeline/raspberrypi/raspberrypi.cpp   | 10 +++++++++-\n 2 files changed, 14 insertions(+), 2 deletions(-)","diff":"diff --git a/src/libcamera/pipeline/raspberrypi/data/example.yaml b/src/libcamera/pipeline/raspberrypi/data/example.yaml\nindex 001a906af528..421f30e62aa3 100644\n--- a/src/libcamera/pipeline/raspberrypi/data/example.yaml\n+++ b/src/libcamera/pipeline/raspberrypi/data/example.yaml\n@@ -15,6 +15,10 @@\n                 #\n                 # internal buffer count = max(min_unicam_buffers,\n                 #         min_total_unicam_buffers - external buffer count)\n-                \"min_total_unicam_buffers\": 4\n+                \"min_total_unicam_buffers\": 4,\n+\n+                # Override any request from the IPA to drop a number of startup\n+                # 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 39f48e0a57fb..3529d331deb6 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -309,6 +309,11 @@ public:\n \t\t * the Unicam Image stream.\n \t\t */\n \t\tunsigned int minTotalUnicamBuffers;\n+\t\t/*\n+\t\t * Override any request from the IPA to drop a number of startup\n+\t\t * frames.\n+\t\t */\n+\t\tbool disableStartupFrameDrops;\n \t};\n \n \tConfig config_;\n@@ -1053,7 +1058,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@@ -1706,6 +1711,7 @@ int RPiCameraData::configurePipeline()\n \tconfig_ = {\n \t\t.minUnicamBuffers = 2,\n \t\t.minTotalUnicamBuffers = 4,\n+\t\t.disableStartupFrameDrops = false,\n \t};\n \n \tchar const *configFromEnv = utils::secure_getenv(\"LIBCAMERA_RPI_CONFIG_FILE\");\n@@ -1739,6 +1745,8 @@ int RPiCameraData::configurePipeline()\n \t\tphConfig[\"min_unicam_buffers\"].get<unsigned int>(config_.minUnicamBuffers);\n \tconfig_.minTotalUnicamBuffers =\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 \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","v5","10/12"]}