From patchwork Wed Jan 18 08:59:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 18136 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 BAC14C3240 for ; Wed, 18 Jan 2023 09:01:28 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 63D95625EF; Wed, 18 Jan 2023 10:01:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1674032488; bh=xWEJkF6fwmg+ej+XN2M6IqJL/P22tjDDj7dvCFuyLAg=; 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=0emIc8dKJp+Fvxt29RXorP8KYQccq/27Y+u71oiSsn401cW/cGK4FSHWa4plLSddE o7WM9I/bG87l0gg9OK6eZWd71n3UK5JAokVXifOyaLlTAxvwFFWXp0lJvaNuHN8f78 0EbzWyAE96qBVvq7KoKDvTA2zjQImQg3LUnUxVJJiWMHfSQ0AHQgrJwG+L8UL29W2D MnMwPZDhFv0d5NPFgN2V1H64woPQ3hj2QNMySi6bMAhNIvWFvn88007BGcYoqxiwnM yic5VpAiMQtH33gSrpLDdNl3hZNRaba+rsYI8ANFcHVF52pE8oKXR/mIHeKH29r2+9 d74dB/c7qwAxg== Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 56AC8625F5 for ; Wed, 18 Jan 2023 10:01:22 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="jd+8h6CC"; dkim-atps=neutral Received: by mail-wr1-x42c.google.com with SMTP id d2so13062097wrp.8 for ; Wed, 18 Jan 2023 01:01:22 -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=Xm9A0Dc0ylC7MuHawpOh5lFzItkxnCtpqzdPfEfou7U=; b=jd+8h6CCvQAhG2OxH29I9t6kXMUTdqkzE4jTPalYIrBaxF03Eol6baf2x7n/JAnTzg XZ8F+3CMsKdoj4sWnc9Us9fOPBa/AuoIfD2keVA8zceRZjhiXUvEYF0p3g3g6P4KTILW 8EcPMxspfYWMGHDpaVJPvOXgWjnuhFcKufYuyM+5mIl2dpkbwuPRy2669rK1aNZLS6fc T2aBva7QrPvjrdHESXDLIgdgcy/O2+ZBRcxeUymzkDPKtsmWAUv00PgoW2pewS+308LW dyGutZvop3zkgQ6Z9+JBAdGGz3tUwPXIpLuZjcnFflHJJ71Q+ClWGImLkMCvuLgLufqm WLPQ== 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=Xm9A0Dc0ylC7MuHawpOh5lFzItkxnCtpqzdPfEfou7U=; b=02isU2CBxC3uoVVkJk47YQxWUPiAlf5CwNy6ZGs8dJxIgIGcD2zc1MvhrLHgAgLXao Wf5m31MPlGyqQEoFURHfmjTwMCjIhG7gQ2wBtBxYWzVIpTMgNK2AjTbMp1C5k0RGwVSm dhC670sEhzEfx6jM7HlhDGmhcrmBjn5Afu2qYp8c4rsxHKtEwJcpy2RidVHuUEHWO0jX 6s+AFDMFaIc+qJqrC0bAnfKYPhCY0nEyGu1dw9nJ5pkOWMnQXKFS337zND4WZnO2Vsvm NTb9/omy0JcZabMsD341/8Z29aSXIpsS9bc6UEmDjUNXBOZRiRaC1HZwq6n3wE0EIAxc EFyw== X-Gm-Message-State: AFqh2kohQghd9HR3S1qybyIfeFdFH2ujlSjWvNNoSyKnOkY+CbbxpuEb EiAJqSR5Zcet2TQFHis+sG0cZm1B5UArmAoZzVo= X-Google-Smtp-Source: AMrXdXtiJNJdZBQDplNOt3BDxK/f9XlMjgLEVFBxpY4YlmgkLGgYOggkZ3Z5Rkkf8xigzaeJ8EMgrA== X-Received: by 2002:a5d:5224:0:b0:2bd:bbf7:1f87 with SMTP id i4-20020a5d5224000000b002bdbbf71f87mr6124530wra.60.1674032481781; Wed, 18 Jan 2023 01:01:21 -0800 (PST) Received: from localhost.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id i6-20020adfe486000000b002423dc3b1a9sm30312464wrm.52.2023.01.18.01.01.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Jan 2023 01:01:21 -0800 (PST) To: libcamera-devel@lists.libcamera.org Date: Wed, 18 Jan 2023 08:59:51 +0000 Message-Id: <20230118085953.7027-11-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230118085953.7027-1-naush@raspberrypi.com> References: <20230118085953.7027-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 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 Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- 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 39f48e0a57fb..3529d331deb6 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -309,6 +309,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_; @@ -1053,7 +1058,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";