From patchwork Fri Dec 9 09:00:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 17974 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 C7344C3284 for ; Fri, 9 Dec 2022 09:01:42 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 786496335B; Fri, 9 Dec 2022 10:01:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1670576502; bh=/MmfHyjyuV7+lDsjeOMyhSB65nzOMYCWZ7uEZUFpjpM=; 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=uGi5e99Bz2vXmUNmwEhQXzDZzMtNarwois8Ca+QgmGEQaMLAEU94gRZF9T17wSH0L PbVM4OhYVlFPX0favqXzZbiL9kTVUTG9YPM99w9R0/saUZi6Wr/6mAHEPqfcpaM4oY Vil8dCoiuWUw7F2ssnXcm8ynDgpVMUg2X+H65LMl1wyDDZZb26rR+y1NA0hcJR6gnd xZYuQS68V81yHC1OHHJiXKrV+nyId+xhqesq5VeRNf7XjMoQTluU6TNPXopCwJ30pG 1eIPO2yu6jB7SLlY4MX2e65doT21zrJo9pMulQ+KiD+UJzPW1yB9ML03wN0X0+EELB rUxmpC4C3WNtw== Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id BA0BE63354 for ; Fri, 9 Dec 2022 10:01:36 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="LOwYZ4lx"; dkim-atps=neutral Received: by mail-wm1-x334.google.com with SMTP id p13-20020a05600c468d00b003cf8859ed1bso2912470wmo.1 for ; Fri, 09 Dec 2022 01:01:36 -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=3cWiVakbi2NOXkp8NicrmYDVzorY8ikQ/a+5gxscsSs=; b=LOwYZ4lx+PDSjfBWAsL867EVMaaz0VkXcbTFCToLo5+6X1qOx7MINJrv/mG/KsLooz bQr3Da+oGkSHsNQO0oKnm8SvHqHmauG5AxLCSqSB2jUYcbps7VIR4LwJroyYy1mUmc1u 6aWj0ywyu0halEkjIIHI3qSePO0JvLDMy7s6zkbSiH8AdTF2r5+tYEPjecmhbPc09Q4s zQvqYEmhqlpMupLTSrb/6tNTXc4j3k/EsDO1pdBiFp6EKzkbtA5F2wV0IXCePuiBEAuq bjZaELSrGZlNG2Q1csm46I4wBJUCZ/jit2R9hKJ7Mq+GYEA4V5gFOy4nkFyQaliWDUOS 1MSg== 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=3cWiVakbi2NOXkp8NicrmYDVzorY8ikQ/a+5gxscsSs=; b=RsVmSm1268q2wgBAOG1eC7PqW8ynhuu+IEdJEpsG3BC9OTggklXOW+f6m4UamfJkWV hUfW0hUO6GeCJMvkfkKOo0BB540wixNl2C0oIzh5H141mUCfmhmmO13p516UTgJN/0zP urnj9x8Li56iEPPnbA1m3plc4O/h40QG2qkbyd4QW3WSXsjxId2gTOk4Ro19diFOy6d8 QoEdR5mAdYVVKZSRa0n6N+MRU6FbIWQ6rhUwztHSyJNs/XPwLMbrgurSTyAzE3Y5jYSb JjpfBdYd0TmNc60AL88w7+9nssphBcEiSipV6NARJIquV+ejO6Wd2EisK47aMbajEZgL HzjA== X-Gm-Message-State: ANoB5pnar3eXfvPT4C+qwMOLEHGlDXOjlru+ZJC8/Z020EDkhv0sIAev Pni8M6slNf/L4TUrJJUfcuYDXVNXs2zrgrrm X-Google-Smtp-Source: AA0mqf7aONo+g+YNMlAJuOhDwl8Fx+8IZQPlXRrILtvWWp4ZTuK52hXHogcjYytuEotD72so4pGHkQ== X-Received: by 2002:a05:600c:a0f:b0:3d0:8a0e:3910 with SMTP id z15-20020a05600c0a0f00b003d08a0e3910mr4251184wmp.34.1670576496096; Fri, 09 Dec 2022 01:01:36 -0800 (PST) Received: from naush-laptop.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id bd10-20020a05600c1f0a00b003cf774c31a0sm7773674wmb.16.2022.12.09.01.01.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Dec 2022 01:01:35 -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 Subject: [libcamera-devel] [PATCH v4 10/12] 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 --- src/libcamera/pipeline/raspberrypi/data/example.yaml | 6 +++++- src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 10 +++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/libcamera/pipeline/raspberrypi/data/example.yaml b/src/libcamera/pipeline/raspberrypi/data/example.yaml index 001a906af528..421f30e62aa3 100644 --- a/src/libcamera/pipeline/raspberrypi/data/example.yaml +++ b/src/libcamera/pipeline/raspberrypi/data/example.yaml @@ -15,6 +15,10 @@ # # 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 2c2b79fa021d..4f15bcf0052a 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -308,6 +308,11 @@ public: * the Unicam Image stream. */ unsigned int minTotalUnicamBuffers; + /* + * Override any request from the IPA to drop a number of startup + * frames. + */ + bool disableStartupFrameDrops; }; Config config_; @@ -1052,7 +1057,7 @@ 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(); @@ -1706,6 +1711,7 @@ int RPiCameraData::configurePipeline() config_ = { .minUnicamBuffers = 2, .minTotalUnicamBuffers = 4, + .disableStartupFrameDrops = false, }; char const *configFromEnv = utils::secure_getenv("LIBCAMERA_RPI_CONFIG_FILE"); @@ -1739,6 +1745,8 @@ int RPiCameraData::configurePipeline() 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";