From patchwork Fri Dec 9 09:00:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 17976 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 E9775C3284 for ; Fri, 9 Dec 2022 09:01:43 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A33926336A; Fri, 9 Dec 2022 10:01:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1670576503; 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=FshxAEFQFGgdp70fSI6nOzWLPM3isX1i2yr7Soet7uSVGmO8TIxbAzqMhmKEtsaxH XbSF4bxISqB8O0bYoJLjJMqofEPJangJReTKFFh6CZiEI1St14Ob9fmEZuuPyUj0J2 hISJGzZPCwMN3j70CTLToOHw/8+vcu7HsVJKQQDqf9z8QV5gnRr/zu3oh5+Dg9UTRk KWQSpp9cnD7YELiNudaSx0A57B7FSsoXTIcIH3KLo5pdHqdlRNaqKd1hHgos9UNDGz +O3T7PnTooNBH+j4ptGLNZc7LFCVWDoj7+CxGN8ht5cegkcT3aa/mqAMds6ni28BDY w3CWS4jd7KZ2A== Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7431E63366 for ; Fri, 9 Dec 2022 10:01:38 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="qAQDogJA"; dkim-atps=neutral Received: by mail-wm1-x32f.google.com with SMTP id k22-20020a05600c1c9600b003d1ee3a6289so2917187wms.2 for ; Fri, 09 Dec 2022 01:01:38 -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=qAQDogJAAhl3vIw4e37ZJkqAggB3BAejH8nSHA1LUjnuGafKFQRHkoRkvagO515tpE cV1wovRKE3IEtwKj6sqbtqhQhhbKJUGh1mjtEMShcHZorgim69Iehiw14LLVmcnefSVW AqAV0p/ReahVASk1QjvRxQe/QMLZ2v9Hl9HtOfXiQ/DM7sQwYFOOT5VbrUJxDK259sgl qdsxU37M0MhIkwxFtS5rBdKcUzpsEO+fNyTLzpRVGfZMu7ywJtk4NyGDIGHwLxudVzds wegQccLt42RCiu3Jx6mA+E95SbLfIfCh/gPjje6mMNCcCp7xwKHqYh9TdCIbbtq9J2um 5rxQ== 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=CgNAtCa+/MWoq3/OTkBBEaoJfgEpX4eawcv7Ozol4U5PNlmh5n6Qr5vKtKycf3KJJ5 xdO7dfwmElSFG20oA4/Y9lsoxPERqP+TS0NQF8BjNEEX+FO8Ae+rPcNbDvVps8JAlYqJ xNR1iMiv9EUvK39/03m4zLIN3i74jmEr77aFu4i0Yx3mn85o+J4pI3FoL9s7fwyOlUjU 6kGQHVKgnfHbHJbIBqbH2KOKe/YNEpvfoHJu8f3LFJK4RK17SVtt6LCsPH9Tr80FMfEh oejRMtdceYQW0hYNpdfmBje75DcOKZWHlhGOsmdAU+ZlJ4f7i9ZVffcZAz8wLx2fAJ1H qhRQ== X-Gm-Message-State: ANoB5pmpS1nOQbHerHJFn+UvKa0WS6qx7rle2VgcF3Riwo+2mBVP2IZy o1odbqtEfgQHwHq1nXhmwAHoFF81MiNuLOV1 X-Google-Smtp-Source: AA0mqf6AbaC6Z7lazVj2UL61RonDO31PFFR6bm/Dzuzg71gw2/00K9dgm2i+W5k1opaDFzEluUOvDw== X-Received: by 2002:a05:600c:1685:b0:3d1:f687:1fd0 with SMTP id k5-20020a05600c168500b003d1f6871fd0mr3788132wmn.12.1670576497697; Fri, 09 Dec 2022 01:01:37 -0800 (PST) Received: from naush-laptop.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id bd10-20020a05600c1f0a00b003cf774c31a0sm7773674wmb.16.2022.12.09.01.01.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Dec 2022 01:01:37 -0800 (PST) To: libcamera-devel@lists.libcamera.org Date: Fri, 9 Dec 2022 09:00:50 +0000 Message-Id: <20221209090050.19441-13-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221209090050.19441-1-naush@raspberrypi.com> References: <20221209090050.19441-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 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 --- .../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 + } +}