{"id":17974,"url":"https://patchwork.libcamera.org/api/1.1/patches/17974/?format=json","web_url":"https://patchwork.libcamera.org/patch/17974/","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":"<20221209090050.19441-11-naush@raspberrypi.com>","date":"2022-12-09T09:00:48","name":"[libcamera-devel,v4,10/12] pipeline: raspberrypi: Add a parameter to disable startup drop frames","commit_ref":null,"pull_url":null,"state":"superseded","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/17974/mbox/","series":[{"id":3663,"url":"https://patchwork.libcamera.org/api/1.1/series/3663/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3663","date":"2022-12-09T09:00:38","name":"Raspberry Pi: Platform configuration and buffer allocation improvements","version":4,"mbox":"https://patchwork.libcamera.org/series/3663/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/17974/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/17974/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 C7344C3284\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  9 Dec 2022 09:01:42 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 786496335B;\n\tFri,  9 Dec 2022 10:01:42 +0100 (CET)","from mail-wm1-x334.google.com (mail-wm1-x334.google.com\n\t[IPv6:2a00:1450:4864:20::334])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id BA0BE63354\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  9 Dec 2022 10:01:36 +0100 (CET)","by mail-wm1-x334.google.com with SMTP id\n\tp13-20020a05600c468d00b003cf8859ed1bso2912470wmo.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 09 Dec 2022 01:01:36 -0800 (PST)","from naush-laptop.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\tbd10-20020a05600c1f0a00b003cf774c31a0sm7773674wmb.16.2022.12.09.01.01.35\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 09 Dec 2022 01:01:35 -0800 (PST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1670576502;\n\tbh=/MmfHyjyuV7+lDsjeOMyhSB65nzOMYCWZ7uEZUFpjpM=;\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=uGi5e99Bz2vXmUNmwEhQXzDZzMtNarwois8Ca+QgmGEQaMLAEU94gRZF9T17wSH0L\n\tPbVM4OhYVlFPX0favqXzZbiL9kTVUTG9YPM99w9R0/saUZi6Wr/6mAHEPqfcpaM4oY\n\tVil8dCoiuWUw7F2ssnXcm8ynDgpVMUg2X+H65LMl1wyDDZZb26rR+y1NA0hcJR6gnd\n\txZYuQS68V81yHC1OHHJiXKrV+nyId+xhqesq5VeRNf7XjMoQTluU6TNPXopCwJ30pG\n\t1eIPO2yu6jB7SLlY4MX2e65doT21zrJo9pMulQ+KiD+UJzPW1yB9ML03wN0X0+EELB\n\trUxmpC4C3WNtw==","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=3cWiVakbi2NOXkp8NicrmYDVzorY8ikQ/a+5gxscsSs=;\n\tb=LOwYZ4lx+PDSjfBWAsL867EVMaaz0VkXcbTFCToLo5+6X1qOx7MINJrv/mG/KsLooz\n\tbQr3Da+oGkSHsNQO0oKnm8SvHqHmauG5AxLCSqSB2jUYcbps7VIR4LwJroyYy1mUmc1u\n\t6aWj0ywyu0halEkjIIHI3qSePO0JvLDMy7s6zkbSiH8AdTF2r5+tYEPjecmhbPc09Q4s\n\tzQvqYEmhqlpMupLTSrb/6tNTXc4j3k/EsDO1pdBiFp6EKzkbtA5F2wV0IXCePuiBEAuq\n\tbjZaELSrGZlNG2Q1csm46I4wBJUCZ/jit2R9hKJ7Mq+GYEA4V5gFOy4nkFyQaliWDUOS\n\t1MSg=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"LOwYZ4lx\"; 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=3cWiVakbi2NOXkp8NicrmYDVzorY8ikQ/a+5gxscsSs=;\n\tb=RsVmSm1268q2wgBAOG1eC7PqW8ynhuu+IEdJEpsG3BC9OTggklXOW+f6m4UamfJkWV\n\thUfW0hUO6GeCJMvkfkKOo0BB540wixNl2C0oIzh5H141mUCfmhmmO13p516UTgJN/0zP\n\turnj9x8Li56iEPPnbA1m3plc4O/h40QG2qkbyd4QW3WSXsjxId2gTOk4Ro19diFOy6d8\n\tQoEdR5mAdYVVKZSRa0n6N+MRU6FbIWQ6rhUwztHSyJNs/XPwLMbrgurSTyAzE3Y5jYSb\n\tJjpfBdYd0TmNc60AL88w7+9nssphBcEiSipV6NARJIquV+ejO6Wd2EisK47aMbajEZgL\n\tHzjA==","X-Gm-Message-State":"ANoB5pnar3eXfvPT4C+qwMOLEHGlDXOjlru+ZJC8/Z020EDkhv0sIAev\n\tPni8M6slNf/L4TUrJJUfcuYDXVNXs2zrgrrm","X-Google-Smtp-Source":"AA0mqf7aONo+g+YNMlAJuOhDwl8Fx+8IZQPlXRrILtvWWp4ZTuK52hXHogcjYytuEotD72so4pGHkQ==","X-Received":"by 2002:a05:600c:a0f:b0:3d0:8a0e:3910 with SMTP id\n\tz15-20020a05600c0a0f00b003d08a0e3910mr4251184wmp.34.1670576496096; \n\tFri, 09 Dec 2022 01:01:36 -0800 (PST)","To":"libcamera-devel@lists.libcamera.org","Date":"Fri,  9 Dec 2022 09:00:48 +0000","Message-Id":"<20221209090050.19441-11-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.25.1","In-Reply-To":"<20221209090050.19441-1-naush@raspberrypi.com>","References":"<20221209090050.19441-1-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v4 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 2c2b79fa021d..4f15bcf0052a 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -308,6 +308,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@@ -1052,7 +1057,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","v4","10/12"]}