From patchwork Wed Jan 18 08:59:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 18138 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 E2DE6C3294 for ; Wed, 18 Jan 2023 09:01:29 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A7127625F8; Wed, 18 Jan 2023 10:01:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1674032489; bh=a3YaJE7CSXCIWHjsIpjMGKKlrxVHNtGXnCOROHKsYI0=; 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=iSmbQp5s4EG60Zl326abZxD5r3vSYghEDST0jjNP7XFA8tkH6qhU16fUt+yMJumDC 525zcN0kV3uTmYu7sSx1iBjXEwRiXl6ZyOqDiaHR+tm9zm+F80+VZ6+nt68ARLnPvh 5LwWoUw0FDZpDRz9IK5KKHINbDdRfBDCJx7HWsrJ2nMrkYLUv8JHJodu+It0FE2RBt fWH1nHLh3PgF0/1MvVw8Max24QWBrIcsKqm4zNp7gmZ+lYCuKYNEpkj+ktv3P6vOrH 6yrNWDluwg22zsDTSXE7b3Oxo8H90yYhn1g596EWg5d18Eg2oa7nQcQJ/QvRUKzw8L GzHqiXjAZ3jjA== 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 1F8CB625FF for ; Wed, 18 Jan 2023 10:01:24 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="tvfctysQ"; dkim-atps=neutral Received: by mail-wr1-x42c.google.com with SMTP id d2so13062185wrp.8 for ; Wed, 18 Jan 2023 01:01:24 -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=sWILBBIXlzAhPGU6fvcIkhjxcYBCw5crq4jorvb3iUU=; b=tvfctysQOa8FpzKUR4vVKGBkyvciMZg2vPcPJY5TmvicTeBvFRzKlRin4ZJSnRZ7J5 DCeH6XT34/Cw4aYtymdLCYo+hzxLY8sL08HnH5jWBNcFFFA/7Ih+z2gWreDX6avhkbFU DBp4SDqryRkzhyfb68svoWyLcYQXvDmIWcK9HiaLKhPKnPtNwM+IiHC4aWvA1307GKzv r+Gu8MTImHWZjuGNFCN6knD/Yy2WAePkbcmIvoX4hfUeHmpMPILg06whYADaFrM+xRXY 8NVpLLXuJKmRkmADNBOvbjSgLluQmn7Q/qUb7WU/bGux2OTnwceZqsCw5hqnymDqxNyR Fc0Q== 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=sWILBBIXlzAhPGU6fvcIkhjxcYBCw5crq4jorvb3iUU=; b=qw8aYXiOGVZEC6g+4Sk3voLa01vwDXd2grO+tiI9qeSh6z1hzW4NinBH8ah1SvHZOE 0TGHLCyCtVuSZPAf3fZn6EkxtFfZNQg8cc7+r2mqBYWEncu3MBo0mwbkGkZ+d/eOWMxy P6/iB1T7hjJNpzMis0Rdb+lsi+gvqP+riKBP+Fq2ZyeTxK7M7gs1A3rbmqH6fLUNeMWB le/40t44wQEDSpp7rEAxCsmE3mmzLOklADzZAs/dQqCqebhKDSDSsKtE9vs0aa1btG2d LEReUHJE8HT5K3GZMyS+2w/aIrpZ4S840Y1VpjjlDJRKRdJSLwhRCVXGwFGvAkfbwpBr ytlA== X-Gm-Message-State: AFqh2kqLFE8/djXwba+X8VdZfn9gukVct69FaYCZmgRkzTZX6PexA5m9 q/vR6R0NZ85N5Ks379UBzWWRYpMIZ+PAPZgMP+w= X-Google-Smtp-Source: AMrXdXulM0i2nh8gD0yGuMavAinP9tEMBPvFCk/ZnsiiS8n+4eK2wolUu3sPCMIx3goY+7mVRCMgUg== X-Received: by 2002:a5d:4dc9:0:b0:2be:21fc:ae3 with SMTP id f9-20020a5d4dc9000000b002be21fc0ae3mr4194808wru.11.1674032483651; Wed, 18 Jan 2023 01:01:23 -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.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Jan 2023 01:01:23 -0800 (PST) To: libcamera-devel@lists.libcamera.org Date: Wed, 18 Jan 2023 08:59:53 +0000 Message-Id: <20230118085953.7027-13-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 12/12] 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 | 29 +++++++++++++++++++ 2 files changed, 30 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..5cd593025140 --- /dev/null +++ b/src/libcamera/pipeline/raspberrypi/data/minimal_mem.yaml @@ -0,0 +1,29 @@ +{ + "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. + "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, + + # Always process a pending request with the last captured sensor + # frame. Note that this might lead to avoidable frame drops + # during periods of transient heavy CPU loading. + "return_newest_frames": false + } +}