From patchwork Fri Jan 27 15:43:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 18211 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 CF671C3297 for ; Fri, 27 Jan 2023 15:43:51 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 705FC625FD; Fri, 27 Jan 2023 16:43:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1674834231; bh=1Ig8lWSCDlGf6VtqXhWEwfeoCFsqN7yB5rm1PzEHhOw=; 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=lAUoYm9S6+zcg0OYGnn5d1O6qZOhLn8Bfl+RbKToQSXJm9FsoACcScRV730VGeCdX RwDYj+38gq5FCLtMxENqUjZA/gY1IrFYltukXAAat1Mmo2n2q1zItvXPjaJbW7syKB WpJFoGyjhGqSLQUoC6lzBhtfgf2/V5c9VdWJzA3ELPZuXHPmn3wOL8qe/cKU9NVulk avm2WR4xLn3GfKQDC9uYNwssrxHgMDWgk/ukG3ib4SWttDr7NENtbnddq1i15/Ujrn XjSseMReS6KE8OCd5RoysLEE4BmM8z5mbDDn6HySbptfD89XrXbP0ZXavJUndvWAd5 Qt8Z3njEXoA/A== Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C70D6625EA 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="NeVffUHK"; dkim-atps=neutral Received: by mail-wr1-x434.google.com with SMTP id bk16so5314255wrb.11 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=6Pu/E3yZHUFL7jfDGhxcod1G6B+EAehMGf3zdxn2Go0=; b=NeVffUHK+yS0olihAs1licR6w6GZ76ed9VkI5OKmIycR4hKvr2EkBR16OnlMiKU4CQ G1Qd/lWaNwhu/2docvGE3UsytTY8fbrJ8S1X0WI+K3/Fgcj5VuWiobIZnyq+AlTA/W39 s+YT4eMzEWHjscQt5Z6zEFxAwDy/UC/Kx1xMdNAph4tif6XxszBzyO3rwNZfIM8Ks2Yl kBZuxOERA7kT2OmA6INP0z60hKPl8IDl8ODfzjuMXzLs9MrtO8dUcqFeODmYe+v5+Hpd Rb9aeJrV1pHyp+AH5L2IXIguB8qSA/NoIuWzvEXe4KFIYzxr6JM7x0BfvP7LH6+sZ+7M UPCw== 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=6Pu/E3yZHUFL7jfDGhxcod1G6B+EAehMGf3zdxn2Go0=; b=0c9CFcuHBu2R3pNuqz+UY5aXVS5kGCdYyan1Bd7lw52oFXU+v0Az3faf8emJZpaRVH SbVmP9Ay/x3bARsjjFkalXlrjW5QEtckaluLQheszOzpZbxPhJ66RRqAovFxm3B0lS0H ZseSTM9JNSqYxApUDsXcS9cRLi12FEXVUoTL3ohhb+vT0u6Hhq53r1+gOiG2sWa/a9qg qSXGBl91Ak7xucT2QOJep/llmwUoSAA36kDupZFAJbo6l6bj5s9HFCVCpQakQQ0YZYuF 1TgX2JeVlBcHP/wgMNTwT14x4fkqPLZsl2nsbSqhN3Tu2mCYtarErHgBSZNGQFfGSRdZ Xgag== X-Gm-Message-State: AFqh2kqjTCBYQcq6floQXpWDsCydnJTVdRcSA3tWqTXcnqa4Rv/RIpcc KVHKTaQG7ZTwSdLc9HAB82EKxqBwWwCPG9AuBow= X-Google-Smtp-Source: AMrXdXsPgjEqJghSce77KbkUg22vSnB5teKvgtZRLLM+rYG0YULPFKyjMcSGsd+gzR9Ay3Nnkdu6qw== X-Received: by 2002:a5d:5190:0:b0:2bd:fde4:885c with SMTP id k16-20020a5d5190000000b002bdfde4885cmr33059578wrv.63.1674834222197; Fri, 27 Jan 2023 07:43:42 -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.41 (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:18 +0000 Message-Id: <20230127154322.29019-12-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 11/15] pipeline: raspberrypi: Add minimal memory usage config file 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 platform configuration file that allocates the least amount of frame buffer memory possible. This configuration does come with the following compromises: - Startup frame drops are disabled, so the first few frames will not have fully converged AE/AWB/ALSC applied. - Applications must provide ISP Output0 and Unicam Image (if a RAW stream is configured) buffers in requests. - Only 1 Unicam Image buffer will be allocated if a RAW stream is not configured, causing the framerate to be effectively halved. To use the configuration on the Raspberry Pi platform, invoke the application with the following prepended to the command line: LIBCAMERA_RPI_CONFIG_FILE=/usr/local/share/libcamera/pipeline/raspberrypi/minimal_mem.yaml Signed-off-by: Naushir Patuck Reviewed-by: David Plowman Reviewed-by: Kieran Bingham --- .../pipeline/raspberrypi/data/meson.build | 1 + .../raspberrypi/data/minimal_mem.yaml | 37 +++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 src/libcamera/pipeline/raspberrypi/data/minimal_mem.yaml diff --git a/src/libcamera/pipeline/raspberrypi/data/meson.build b/src/libcamera/pipeline/raspberrypi/data/meson.build index 1c70433bbcbc..6aecd8ae68c8 100644 --- a/src/libcamera/pipeline/raspberrypi/data/meson.build +++ b/src/libcamera/pipeline/raspberrypi/data/meson.build @@ -2,6 +2,7 @@ conf_files = files([ 'example.yaml', + 'minimal_mem.yaml', ]) install_data(conf_files, diff --git a/src/libcamera/pipeline/raspberrypi/data/minimal_mem.yaml b/src/libcamera/pipeline/raspberrypi/data/minimal_mem.yaml new file mode 100644 index 000000000000..5e4906af7cfd --- /dev/null +++ b/src/libcamera/pipeline/raspberrypi/data/minimal_mem.yaml @@ -0,0 +1,37 @@ +{ + "version": 1.0, + "target": "bcm2835", + + "pipeline_handler": + { + # The minimum number of internal buffers to be allocated for + # Unicam. This value must be greater than 0, but less than or + # equal to min_total_unicam_buffers. + # + # A larger number of internal buffers can reduce the occurrence + # of frame drops during high CPU loads, but might also cause + # additional latency in the system. + # + # Note that the pipeline handler might override this value and + # not allocate any internal buffers if it knows they will never + # be used. For example if the RAW stream is marked as mandatory + # and there are no dropped frames signalled for algorithm + # convergence. + # + "min_unicam_buffers": 0, + + # The minimum total (internal + external) buffer count used for + # Unicam. The number of internal buffers allocated for Unicam is + # given by: + # + # internal buffer count = max(min_unicam_buffers, + # min_total_unicam_buffers - external buffer count) + # + "min_total_unicam_buffers": 1, + + # Override any request from the IPA to drop a number of startup + # frames. + # + "disable_startup_frame_drops": true + } +}