{"id":18210,"url":"https://patchwork.libcamera.org/api/patches/18210/?format=json","web_url":"https://patchwork.libcamera.org/patch/18210/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/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":"<20230127154322.29019-11-naush@raspberrypi.com>","date":"2023-01-27T15:43:17","name":"[libcamera-devel,v6,10/15] pipeline: raspberrypi: Add a parameter to disable startup drop frames","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"a044ae5c1f9738c08e3b07c942efadaee50f2452","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/?format=json","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/18210/mbox/","series":[{"id":3728,"url":"https://patchwork.libcamera.org/api/series/3728/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3728","date":"2023-01-27T15:43:07","name":"[libcamera-devel,v6,01/15] libcamera: stream: Add stream hints to StreamConfiguration","version":6,"mbox":"https://patchwork.libcamera.org/series/3728/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/18210/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/18210/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 D4697C3296\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 27 Jan 2023 15:43:50 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 940FE625EA;\n\tFri, 27 Jan 2023 16:43:50 +0100 (CET)","from mail-wm1-x329.google.com (mail-wm1-x329.google.com\n\t[IPv6:2a00:1450:4864:20::329])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 11265625F8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 27 Jan 2023 16:43:42 +0100 (CET)","by mail-wm1-x329.google.com with SMTP id j17so3775019wms.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 27 Jan 2023 07:43:42 -0800 (PST)","from localhost.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\th18-20020a05600c30d200b003c21ba7d7d6sm4549566wmn.44.2023.01.27.07.43.40\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 27 Jan 2023 07:43:41 -0800 (PST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1674834230;\n\tbh=pHI5uWmbWB5cxcaFlY7jt6B/aYTSunV8vLgbsZ0H2AM=;\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=THuXKU+1tKpvYF01IwdXnc9H06Eo27atZ/dBl2zM9E8OsOrW3cZwn3bQtWYRFESss\n\tZcaAfXamRrDnheCCdgMYUBi7XHp1H4GAh0ZnmNuL27G2uEetVk1P8V6hlG/G/pC9iT\n\tQI4SO4Hi3kjzScgU+n5pXzpdaEv9t49oKmzRFeAB3/wKr6VZlNuhLR/7pgjLyyWP9a\n\tyUNABdcklHbvdgclr/7l2hhdzRcbOAdMsMOcDFbYSHTY8Yvgp/EFGGlX9mAYxDRm7B\n\ttcqTiWaFkZq5Tbj+SeElEoTzL4jc+QVLgl8DAr4hRQKw/BijhChNJoCbZY1mJ5z6hU\n\tZd/k4Nc9IkI5g==","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=lK8gMsRaEMF9LU/BvGhTG6doYfu6+Hb6usSUiLnZCQg=;\n\tb=YGbkrgfmvPZ/chDoIDU1bcdYYaRoMsMrZ1iYCE9VhOzEIf8AlPdQTZg73/Ek6qAaN7\n\tEJKQUZGu2h5Sh8EjUm3YzEmjREdIUI0qVBhHRCENw2+xoglAbz+jqmRb3Sp5XjKu8A0r\n\tUS0IgIe3Cf61GfQ5OTglfDGyn29v2HyDiUSgDXSWWgJ4KUhS/XL7kSNEvauD5AdhIohG\n\tOAE4KVITrc35ZjyTuDNgoAOQl9PmQtd4qMx/qKM7JTW4zHnK9t68IkHrxeUbHZAGPT7w\n\tawAj2cBdus/pL7SNGu5L7ViJMXK6El13TRPa74qSl6lK56o4T+7ni89YbWoUP5NhcZXX\n\tg1Ug=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"YGbkrgfm\"; 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=lK8gMsRaEMF9LU/BvGhTG6doYfu6+Hb6usSUiLnZCQg=;\n\tb=y2Un/iMLMh21AotemBkEJTkcgMLlsyCb9wQsVwmlUMmjZR7fsYg7zGHGGNms80Alal\n\tJZmXTYdwt+/aMi2YgNoJyJPAtz4TKni5s077X6FweY4Z4IbeZWNATNr7cwvyvZ/+wx7o\n\t23tAMClWvK5wNcDXE5MR6kDE9tO41A0hVeHD2aSquWIVhQft+RfFjcQxQYzCJNnDxMpA\n\tP51DYWd+/DHcEVvV31TAokZ62/79AZ329k93oG9/2mIm940uiaBIFG6SvDYQpJr2v+Ni\n\tsLKPGwYCawUKpIK+ME3DjbQAlOvrZWmmbW3YA1Td1FJyir9ZK+GsmtUgroF+KdBL/eD8\n\tg+RA==","X-Gm-Message-State":"AFqh2ko12GFPPGQwL7BKJFKmdy1ShlyLelCoH4oP2VYXOgJy+ed0fRLQ\n\tgU1yBZonQ/flcSSsQXMR0MoOWrUHYeyPo8N/RnI=","X-Google-Smtp-Source":"AMrXdXsZwfRgpvk/rNuMejv2tWhXnU/xGidDoA29Gd0KAgDVXux+Yj0xgyFJZCbgZx+SkvgUa4CkJA==","X-Received":"by 2002:a05:600c:16c9:b0:3db:222:3e0c with SMTP id\n\tl9-20020a05600c16c900b003db02223e0cmr39877232wmn.33.1674834221433; \n\tFri, 27 Jan 2023 07:43:41 -0800 (PST)","To":"libcamera-devel@lists.libcamera.org","Date":"Fri, 27 Jan 2023 15:43:17 +0000","Message-Id":"<20230127154322.29019-11-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.25.1","In-Reply-To":"<20230127154322.29019-1-naush@raspberrypi.com>","References":"<20230127154322.29019-1-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v6 10/15] 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\ndisable any startup drop frames, overriding the IPA request.\n\nWhen this parameter is set, it allows the pipeline handler to run with\nno internally allocated Unicam buffers (\"min_unicam_buffers\").\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/pipeline/raspberrypi/data/example.yaml |  7 ++++++-\n src/libcamera/pipeline/raspberrypi/raspberrypi.cpp   | 11 ++++++++++-\n 2 files changed, 16 insertions(+), 2 deletions(-)","diff":"diff --git a/src/libcamera/pipeline/raspberrypi/data/example.yaml b/src/libcamera/pipeline/raspberrypi/data/example.yaml\nindex 4662136e0be0..ad5f2344384f 100644\n--- a/src/libcamera/pipeline/raspberrypi/data/example.yaml\n+++ b/src/libcamera/pipeline/raspberrypi/data/example.yaml\n@@ -27,6 +27,11 @@\n                 # internal buffer count = max(min_unicam_buffers,\n                 #         min_total_unicam_buffers - external buffer count)\n                 #\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+                #\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 7c6db070dfc0..9920f6bb01a7 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -313,6 +313,11 @@ public:\n \t\t * minTotalUnicamBuffers >= minUnicamBuffers\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@@ -1057,7 +1062,8 @@ 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\n+\t\t\t      ? 0 : startConfig.dropFrameCount;\n \n \tfor (auto const stream : data->streams_)\n \t\tstream->resetBuffers();\n@@ -1703,6 +1709,7 @@ int RPiCameraData::loadPipelineConfiguration()\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@@ -1736,6 +1743,8 @@ int RPiCameraData::loadPipelineConfiguration()\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","v6","10/15"]}