From patchwork Fri Oct 14 13:18:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 17605 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 27B48C3288 for ; Fri, 14 Oct 2022 13:19:05 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id BDE6862DE3; Fri, 14 Oct 2022 15:19:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1665753544; bh=2Sy/DBqiypKC+W+kxP3byCJXUzU49e8NfVm12XkvPo8=; 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=MKW3mTYF2slIeet+PfjQJzM7L/i7HmcKUAZftCp7J0NYoSia1P7x+J2AZOmcyyXSC jZIuHb8bwKwfWjVGiNhdannDwGkt0nNFwxT1+syLVYQKQM6jntAN21oKL679Dnlu3H YE32PIa4EvPy0ukEoQ/ORqiIK0eAS7XqBX1dJXy01nwqO0/B9UeEkv7IwSaFA3rdsF 9WJYztSek0uPW6P3+QGw50g6Dc4IpIaN/Xk8sBX9lyb98Cq6n09MNr9GlTtwUsLe7z Usu4oL/nr9g3JP9OvC8+0iGxjOPKUXwJ4Ov50SpoijQr4069Bgc/ngavfMF4afdeo6 OoB7jTKfHfk8A== Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id CFC8E62DCF for ; Fri, 14 Oct 2022 15:18:58 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="omazfqa+"; dkim-atps=neutral Received: by mail-wm1-x32e.google.com with SMTP id o20-20020a05600c4fd400b003b4a516c479so3506628wmq.1 for ; Fri, 14 Oct 2022 06:18:58 -0700 (PDT) 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=4AWqYSoWbUS8BtecNwzpxgH9URcP2OOV0lO91UAnwdI=; b=omazfqa+MPZ0rd+BFv0rnNzJ52pXillSPep8KIXvhACWG3eZjVn8fFiMfe6txHWjNO NdfIEWLQm3xYpi1LQRSwiU/afCIBcqqUjj2YJiPLDxMpU95GZJ0LS40Bx1e8cetfl6Nx 0YyJYPtvzVbK5Er+40aZTQm+cUVi1GeI2AQLYJADEWwUwgSLwLLzvN/W4VHSPV4828wE 2c0L2Tis5r0rFw0yS9Ij0BhMPJa7GKFVC4QubAuFWBZHNRm1G+aSWjNDDzdtQvCP0r+r uLYKETtyyztDkBIpBf861o92OGxje2xr3I+hEQ/zuhatxc/4UF2P7Rl6x5/JB2ftM+a/ uB8A== 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=4AWqYSoWbUS8BtecNwzpxgH9URcP2OOV0lO91UAnwdI=; b=Y+Yb7Uqv1MiOrXHV3Z7LSwXtv7OgMblAJidjkovxvMaY10UhsIn/oa2cEoPI04L4Mj XqGDTptIauxt9cYSSdt2RjPBTCCbSMSjwLzmZK5divwfWGj8+AVnp2Q/7ZJkXHuWKh2r Q20aN6cq+d0WPjs4cYHNzXS8XYODH4D+RuoTLmUkOktl+bhdb27e6WlwdxiD6HtV17Rm MXmLRZSfJ/BeQpwfjdtN83ucyyJ1++n7H5wyXxbFvOHgt+j9DMQMFeuE9CFYvbiBnOxa EJo3YMjU+aqyw3yi4Ewryt1jgZvuWUHI/TEI+x+TS+M/2QhLhwtBVx+d8LUZeza1wNiT RTlg== X-Gm-Message-State: ACrzQf2+TtbMJwdtOYuv8LRsdnp/OrgfjqgauRR2B+grleBd64VvY0kt 7LOpSChw1qPJgNVuzhPDcLsTYMovQhTRnA== X-Google-Smtp-Source: AMsMyM5OE977jpOMddr+WGv9LnfyVSbQQQwrSa0brto/kgYloYPYXh4bkv66e8/T1PYvahiooS72AA== X-Received: by 2002:a05:600c:358b:b0:3c6:e3e4:828f with SMTP id p11-20020a05600c358b00b003c6e3e4828fmr3529084wmq.10.1665753538331; Fri, 14 Oct 2022 06:18:58 -0700 (PDT) Received: from naush-laptop.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id g17-20020a05600c001100b003c6bbe910fdsm8282458wmc.9.2022.10.14.06.18.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Oct 2022 06:18:57 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Fri, 14 Oct 2022 14:18:45 +0100 Message-Id: <20221014131846.27169-10-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221014131846.27169-1-naush@raspberrypi.com> References: <20221014131846.27169-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v1 09/10] 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_memory.json Signed-off-by: Naushir Patuck Reviewed-by: David Plowman --- .../pipeline/raspberrypi/data/meson.build | 1 + .../raspberrypi/data/minimal_mem.json | 28 +++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 src/libcamera/pipeline/raspberrypi/data/minimal_mem.json diff --git a/src/libcamera/pipeline/raspberrypi/data/meson.build b/src/libcamera/pipeline/raspberrypi/data/meson.build index 232f8b43c5fd..0592fc53877d 100644 --- a/src/libcamera/pipeline/raspberrypi/data/meson.build +++ b/src/libcamera/pipeline/raspberrypi/data/meson.build @@ -2,6 +2,7 @@ conf_files = files([ 'default.json', + 'minimal_mem.json', ]) install_data(conf_files, diff --git a/src/libcamera/pipeline/raspberrypi/data/minimal_mem.json b/src/libcamera/pipeline/raspberrypi/data/minimal_mem.json new file mode 100644 index 000000000000..fb306aa08f94 --- /dev/null +++ b/src/libcamera/pipeline/raspberrypi/data/minimal_mem.json @@ -0,0 +1,28 @@ +{ + "version": 1.0, + "target": "bcm2835", + + "pipeline_handler": + { + # The minimum number of internal buffers to be allocated for Unicam. + # This value must 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, + + # The number of internal buffers used for ISP Output0. + "num_output0_buffers": 0, + + # 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 heavey CPU loading. + "return_newest_frames": false + } +}