From patchwork Tue Dec 6 13:54:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 17954 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 349C8C3284 for ; Tue, 6 Dec 2022 13:55:19 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E3D2063358; Tue, 6 Dec 2022 14:55:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1670334918; bh=7X4Zmc5yC5hboaXK50ZihMMc/kCH6ICSf0zi+pptttg=; 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=mSKx6/uzPPtwvcwkmM25odKKejCuqRaftB135JgwumF22R7yfrVt4Ih/tprb0SaET hOu6gMJyMPL+QbWqBYBkOlsyBvYaDF4rnJwZ7IeIIslq3TGza8T8ULClw1GS5fnNWQ sNV1zPWRrQaXzYNg3TGEfbxgGI4aM+M+MaYCu6jX4O3Yha0n+T0AP5OtbPUWLXKySX hS2iH2JEL66/YGNQxcXsY1Dv0Eot0ytCPjjU8Un9QTr+qhh45gFcQ1YT007xfR5eFP mfHMN/Ys43EspkhUN1mJXCYkS47IS2t3CaThKZxC/cYutTwjYlef6ipH8QEsuz5A4H pH0EU5O/XObMA== Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 06EAB63354 for ; Tue, 6 Dec 2022 14:55:14 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="eeVF0qKB"; dkim-atps=neutral Received: by mail-wr1-x42e.google.com with SMTP id m14so23547834wrh.7 for ; Tue, 06 Dec 2022 05:55:14 -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=BXVGvoqGupVb8f9IJNRqPyPFxShg6Bm934ZLTGAVIzc=; b=eeVF0qKBmt78q/Jy5q7jdN8cW4Ypbu4nsHswRdUbz0rLXsB0PooLM2S4r0JLSicweM FN7KM+W1Gt26qxb0hjraQcFLiQR0xvZeNWtMY//UWj444f1UJ61grcvLVhK/s33z/uf5 /08ldA2I3iHMq7Ris2TdsjO4cB78Ia4qkbmNAln5r6E1D8xv69gywR+I9XvUvy1w1BAb kqs+9Hg+D33Bw4Jk1Ui9zPXEKNvwllN959U3mWI/yHXi5/L2TVCxuf0WHCe7sHSas749 adOlUko4Hy1iPqMyheMdJM9RSxI73OXlNTgoT8DK5Q5t0eeyHBDiqdfN/mZHbdsfPsvm xdFA== 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=BXVGvoqGupVb8f9IJNRqPyPFxShg6Bm934ZLTGAVIzc=; b=wc1JcyLo6twfcARJ1nSBA47pVBj6T8sxk9O4Zewtdrv8Fap+OVlk4GBELrk8FQ+pSh Ait8o42KYkbHBf6FxO6PK5FXJnYOD9tVIXXh7VTUogv+wmwu0w3fS7hF7BQRW7bUtTTW uoEX1blp29QEUcMjT7V6gtfIb8WtadIH9cAfXUlP6gf+/toYcV8iJP3sLvfIRZY+iz79 2sjowfq6Fg/ubx0LtKqhfZ54pPiawmHs1tc8fl7Jq0yioEmY15BwZEJ+duynyPC2qsL2 HLJdudlfyhi3FLdLsJGA6Bx15BopxQ5Hx03W2KANBk/Q48LVmJEuB1t90TYUhoLiDpKr AczA== X-Gm-Message-State: ANoB5pmNtitR9S/trejT/BzNpLug9yVXzfub87C+VYsjgfvXC/4izOYi mSXeEMa/LAJ8mnaLzHiGgUafrfJfcWuEVsm+ X-Google-Smtp-Source: AA0mqf5KiMcYmTGoT5z2POpsCD1fRFyX3AdU4QS+6l9CopX5+0QGnj8CWfNaHk01Zw0m5cI8g7UVlw== X-Received: by 2002:adf:e849:0:b0:242:65e:95d3 with SMTP id d9-20020adfe849000000b00242065e95d3mr29669433wrn.49.1670334913517; Tue, 06 Dec 2022 05:55:13 -0800 (PST) Received: from naush-laptop.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id q6-20020a05600c2e4600b003c6bd91caa5sm19444059wmf.17.2022.12.06.05.55.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 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 Subject: [libcamera-devel] [PATCH v3 11/13] 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 b18e11bb438f..ffd2ba85182f 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(); @@ -1724,6 +1729,7 @@ int RPiCameraData::configurePipeline() config_ = { .minUnicamBuffers = 2, .minTotalUnicamBuffers = 4, + .disableStartupFrameDrops = false, }; char const *configFromEnv = utils::secure_getenv("LIBCAMERA_RPI_CONFIG_FILE"); @@ -1757,6 +1763,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";