{"id":17954,"url":"https://patchwork.libcamera.org/api/1.1/patches/17954/?format=json","web_url":"https://patchwork.libcamera.org/patch/17954/","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":"<20221206135459.25521-12-naush@raspberrypi.com>","date":"2022-12-06T13:54:57","name":"[libcamera-devel,v3,11/13] 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/17954/mbox/","series":[{"id":3659,"url":"https://patchwork.libcamera.org/api/1.1/series/3659/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3659","date":"2022-12-06T13:54:46","name":"Raspberry Pi: Platform configuration and buffer allocation improvements","version":3,"mbox":"https://patchwork.libcamera.org/series/3659/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/17954/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/17954/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 349C8C3284\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  6 Dec 2022 13:55:19 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E3D2063358;\n\tTue,  6 Dec 2022 14:55:18 +0100 (CET)","from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com\n\t[IPv6:2a00:1450:4864:20::42e])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 06EAB63354\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  6 Dec 2022 14:55:14 +0100 (CET)","by mail-wr1-x42e.google.com with SMTP id m14so23547834wrh.7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 06 Dec 2022 05:55:14 -0800 (PST)","from naush-laptop.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\tq6-20020a05600c2e4600b003c6bd91caa5sm19444059wmf.17.2022.12.06.05.55.12\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 06 Dec 2022 05:55:13 -0800 (PST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1670334918;\n\tbh=7X4Zmc5yC5hboaXK50ZihMMc/kCH6ICSf0zi+pptttg=;\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=mSKx6/uzPPtwvcwkmM25odKKejCuqRaftB135JgwumF22R7yfrVt4Ih/tprb0SaET\n\thOu6gMJyMPL+QbWqBYBkOlsyBvYaDF4rnJwZ7IeIIslq3TGza8T8ULClw1GS5fnNWQ\n\tsNV1zPWRrQaXzYNg3TGEfbxgGI4aM+M+MaYCu6jX4O3Yha0n+T0AP5OtbPUWLXKySX\n\thS2iH2JEL66/YGNQxcXsY1Dv0Eot0ytCPjjU8Un9QTr+qhh45gFcQ1YT007xfR5eFP\n\tmfHMN/Ys43EspkhUN1mJXCYkS47IS2t3CaThKZxC/cYutTwjYlef6ipH8QEsuz5A4H\n\tpH0EU5O/XObMA==","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=BXVGvoqGupVb8f9IJNRqPyPFxShg6Bm934ZLTGAVIzc=;\n\tb=eeVF0qKBmt78q/Jy5q7jdN8cW4Ypbu4nsHswRdUbz0rLXsB0PooLM2S4r0JLSicweM\n\tFN7KM+W1Gt26qxb0hjraQcFLiQR0xvZeNWtMY//UWj444f1UJ61grcvLVhK/s33z/uf5\n\t/08ldA2I3iHMq7Ris2TdsjO4cB78Ia4qkbmNAln5r6E1D8xv69gywR+I9XvUvy1w1BAb\n\tkqs+9Hg+D33Bw4Jk1Ui9zPXEKNvwllN959U3mWI/yHXi5/L2TVCxuf0WHCe7sHSas749\n\tadOlUko4Hy1iPqMyheMdJM9RSxI73OXlNTgoT8DK5Q5t0eeyHBDiqdfN/mZHbdsfPsvm\n\txdFA=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"eeVF0qKB\"; 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=BXVGvoqGupVb8f9IJNRqPyPFxShg6Bm934ZLTGAVIzc=;\n\tb=wc1JcyLo6twfcARJ1nSBA47pVBj6T8sxk9O4Zewtdrv8Fap+OVlk4GBELrk8FQ+pSh\n\tAit8o42KYkbHBf6FxO6PK5FXJnYOD9tVIXXh7VTUogv+wmwu0w3fS7hF7BQRW7bUtTTW\n\tuoEX1blp29QEUcMjT7V6gtfIb8WtadIH9cAfXUlP6gf+/toYcV8iJP3sLvfIRZY+iz79\n\t2sjowfq6Fg/ubx0LtKqhfZ54pPiawmHs1tc8fl7Jq0yioEmY15BwZEJ+duynyPC2qsL2\n\tHLJdudlfyhi3FLdLsJGA6Bx15BopxQ5Hx03W2KANBk/Q48LVmJEuB1t90TYUhoLiDpKr\n\tAczA==","X-Gm-Message-State":"ANoB5pmNtitR9S/trejT/BzNpLug9yVXzfub87C+VYsjgfvXC/4izOYi\n\tmSXeEMa/LAJ8mnaLzHiGgUafrfJfcWuEVsm+","X-Google-Smtp-Source":"AA0mqf5KiMcYmTGoT5z2POpsCD1fRFyX3AdU4QS+6l9CopX5+0QGnj8CWfNaHk01Zw0m5cI8g7UVlw==","X-Received":"by 2002:adf:e849:0:b0:242:65e:95d3 with SMTP id\n\td9-20020adfe849000000b00242065e95d3mr29669433wrn.49.1670334913517; \n\tTue, 06 Dec 2022 05:55:13 -0800 (PST)","To":"libcamera-devel@lists.libcamera.org","Date":"Tue,  6 Dec 2022 13:54:57 +0000","Message-Id":"<20221206135459.25521-12-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.25.1","In-Reply-To":"<20221206135459.25521-1-naush@raspberrypi.com>","References":"<20221206135459.25521-1-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v3 11/13] 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 b18e11bb438f..ffd2ba85182f 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@@ -1724,6 +1729,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@@ -1757,6 +1763,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","v3","11/13"]}