From patchwork Fri Jan 27 15:43:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 18210 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id D4697C3296 for ; Fri, 27 Jan 2023 15:43:50 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 940FE625EA; Fri, 27 Jan 2023 16:43:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1674834230; bh=pHI5uWmbWB5cxcaFlY7jt6B/aYTSunV8vLgbsZ0H2AM=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=THuXKU+1tKpvYF01IwdXnc9H06Eo27atZ/dBl2zM9E8OsOrW3cZwn3bQtWYRFESss ZcaAfXamRrDnheCCdgMYUBi7XHp1H4GAh0ZnmNuL27G2uEetVk1P8V6hlG/G/pC9iT QI4SO4Hi3kjzScgU+n5pXzpdaEv9t49oKmzRFeAB3/wKr6VZlNuhLR/7pgjLyyWP9a yUNABdcklHbvdgclr/7l2hhdzRcbOAdMsMOcDFbYSHTY8Yvgp/EFGGlX9mAYxDRm7B tcqTiWaFkZq5Tbj+SeElEoTzL4jc+QVLgl8DAr4hRQKw/BijhChNJoCbZY1mJ5z6hU Zd/k4Nc9IkI5g== Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 11265625F8 for ; Fri, 27 Jan 2023 16:43:42 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="YGbkrgfm"; dkim-atps=neutral Received: by mail-wm1-x329.google.com with SMTP id j17so3775019wms.0 for ; Fri, 27 Jan 2023 07:43:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lK8gMsRaEMF9LU/BvGhTG6doYfu6+Hb6usSUiLnZCQg=; b=YGbkrgfmvPZ/chDoIDU1bcdYYaRoMsMrZ1iYCE9VhOzEIf8AlPdQTZg73/Ek6qAaN7 EJKQUZGu2h5Sh8EjUm3YzEmjREdIUI0qVBhHRCENw2+xoglAbz+jqmRb3Sp5XjKu8A0r US0IgIe3Cf61GfQ5OTglfDGyn29v2HyDiUSgDXSWWgJ4KUhS/XL7kSNEvauD5AdhIohG OAE4KVITrc35ZjyTuDNgoAOQl9PmQtd4qMx/qKM7JTW4zHnK9t68IkHrxeUbHZAGPT7w awAj2cBdus/pL7SNGu5L7ViJMXK6El13TRPa74qSl6lK56o4T+7ni89YbWoUP5NhcZXX g1Ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lK8gMsRaEMF9LU/BvGhTG6doYfu6+Hb6usSUiLnZCQg=; b=y2Un/iMLMh21AotemBkEJTkcgMLlsyCb9wQsVwmlUMmjZR7fsYg7zGHGGNms80Alal JZmXTYdwt+/aMi2YgNoJyJPAtz4TKni5s077X6FweY4Z4IbeZWNATNr7cwvyvZ/+wx7o 23tAMClWvK5wNcDXE5MR6kDE9tO41A0hVeHD2aSquWIVhQft+RfFjcQxQYzCJNnDxMpA P51DYWd+/DHcEVvV31TAokZ62/79AZ329k93oG9/2mIm940uiaBIFG6SvDYQpJr2v+Ni sLKPGwYCawUKpIK+ME3DjbQAlOvrZWmmbW3YA1Td1FJyir9ZK+GsmtUgroF+KdBL/eD8 g+RA== X-Gm-Message-State: AFqh2ko12GFPPGQwL7BKJFKmdy1ShlyLelCoH4oP2VYXOgJy+ed0fRLQ gU1yBZonQ/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 l9-20020a05600c16c900b003db02223e0cmr39877232wmn.33.1674834221433; Fri, 27 Jan 2023 07:43:41 -0800 (PST) Received: from localhost.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id h18-20020a05600c30d200b003c21ba7d7d6sm4549566wmn.44.2023.01.27.07.43.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 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 Subject: [libcamera-devel] [PATCH v6 10/15] pipeline: raspberrypi: Add a parameter to disable startup drop frames X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Naushir Patuck via libcamera-devel From: Naushir Patuck Reply-To: Naushir Patuck Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Add a new pipeline config parameter "disable_startup_frame_drops" to disable any startup drop frames, overriding the IPA request. When this parameter is set, it allows the pipeline handler to run with no internally allocated Unicam buffers ("min_unicam_buffers"). Signed-off-by: Naushir Patuck Reviewed-by: David Plowman Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- src/libcamera/pipeline/raspberrypi/data/example.yaml | 7 ++++++- src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 11 ++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/libcamera/pipeline/raspberrypi/data/example.yaml b/src/libcamera/pipeline/raspberrypi/data/example.yaml index 4662136e0be0..ad5f2344384f 100644 --- a/src/libcamera/pipeline/raspberrypi/data/example.yaml +++ b/src/libcamera/pipeline/raspberrypi/data/example.yaml @@ -27,6 +27,11 @@ # internal buffer count = max(min_unicam_buffers, # min_total_unicam_buffers - external buffer count) # - # "min_total_unicam_buffers": 4 + # "min_total_unicam_buffers": 4, + + # Override any request from the IPA to drop a number of startup + # frames. + # + # "disable_startup_frame_drops": false } } diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp index 7c6db070dfc0..9920f6bb01a7 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -313,6 +313,11 @@ public: * minTotalUnicamBuffers >= minUnicamBuffers */ unsigned int minTotalUnicamBuffers; + /* + * Override any request from the IPA to drop a number of startup + * frames. + */ + bool disableStartupFrameDrops; }; Config config_; @@ -1057,7 +1062,8 @@ int PipelineHandlerRPi::start(Camera *camera, const ControlList *controls) data->setSensorControls(startConfig.controls); /* Configure the number of dropped frames required on startup. */ - data->dropFrameCount_ = startConfig.dropFrameCount; + data->dropFrameCount_ = data->config_.disableStartupFrameDrops + ? 0 : startConfig.dropFrameCount; for (auto const stream : data->streams_) stream->resetBuffers(); @@ -1703,6 +1709,7 @@ int RPiCameraData::loadPipelineConfiguration() config_ = { .minUnicamBuffers = 2, .minTotalUnicamBuffers = 4, + .disableStartupFrameDrops = false, }; char const *configFromEnv = utils::secure_getenv("LIBCAMERA_RPI_CONFIG_FILE"); @@ -1736,6 +1743,8 @@ int RPiCameraData::loadPipelineConfiguration() phConfig["min_unicam_buffers"].get(config_.minUnicamBuffers); config_.minTotalUnicamBuffers = phConfig["min_total_unicam_buffers"].get(config_.minTotalUnicamBuffers); + config_.disableStartupFrameDrops = + phConfig["disable_startup_frame_drops"].get(config_.disableStartupFrameDrops); if (config_.minTotalUnicamBuffers < config_.minUnicamBuffers) { LOG(RPI, Error) << "Invalid configuration: min_total_unicam_buffers must be >= min_unicam_buffers";