From patchwork Tue Nov 29 13:45:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 17916 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 E37B8C3287 for ; Tue, 29 Nov 2022 13:45:51 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9630263347; Tue, 29 Nov 2022 14:45:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1669729551; bh=nhMjr/8XCo8fFgW+XAgMjAcAbVxyemxB03eGT+6+vxs=; 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=l9RD19RU3s1W4RvjEhpL+nofyNXNxgIOEXDHMudUoTeRvsL9vY+1MhDpuuVneYL19 FdL460FTgQjiHlsyXDYiCVpsz81bJnu0Ty1qfFFqMIylTGHm8lk6hv3cpPYUIFb5BJ dY3kfUeDAbdXzMSck4hYlGOHQW5kRqNxY3tzSwDihx6Z7evRZZYpVYTiZdCSVI+s1l FM62/A1I3GjTlZsO6cqF8Kd2KC9M/HdBzWoBA6gY+fV015R81VRXej3w7/6Jrwj395 9PQTt1cUBao6Cld/euiSKApFOZl97VkcR4lACOLzDcxkSF+B8KMr3Cp/0+KFPRkNUf XsC1x/4+mJjSQ== 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 20FC66333E for ; Tue, 29 Nov 2022 14:45:45 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="ZORRXxnC"; dkim-atps=neutral Received: by mail-wm1-x32f.google.com with SMTP id r66-20020a1c4445000000b003d05a3775d4so4906618wma.3 for ; Tue, 29 Nov 2022 05:45:45 -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=uJOuSzayRsCSnI+YDcJu56Ukq9KBYQOZTGGIta+kJ1s=; b=ZORRXxnCiRc8flmuTH/kQr6CEz52pIShKitteOTnQSh8UIJoU9Szmkh0uRD4QKofxq tY+lZ1PhqBf2FuUkRue7YTXXD/E/JD0HQEMjmHi9xkTlfr25R/y5X3TP3GECk/Nu48Rl MMB0oMktmuGjH+BdVQIsKaL/GvW6sLtbs1xkH80SqiD32O0zPQfu/YErfBfnTivp4ou4 OIqLqFpgUf19ufIozffay9Y+YEdJvB0pHXCgr1Kl5BCUHBJ9YZC7rKf1LuKipdml0C7Z qrK5EK3/slnDjZn/qcTS66Bbv7kPWI0JWw/zzcM0ilCprUyePtQ3TOAViXEsZmfoVM20 gPtA== 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=uJOuSzayRsCSnI+YDcJu56Ukq9KBYQOZTGGIta+kJ1s=; b=iJZxdmFMmTAZzjfy2idEkdFIB2pXWf7q9RLbIExLqm0uSm0J7hiVnMAjA2NUKL4hb9 vwRLVMT4DJNxMdnsf+9MTzO8ftUjuMAofCGsklLLH/wRAaCNUwCl1zwVu20eOCDTB/JC DL9v4yOQTPeCb3k47S2u0exRhC5YA36VU7Qw/PsHfA5pKaciy9Bk+Q6twxSWPpnVpKgj tCP85mQIx+plTwvMhxDev3F5uhcSDNU0Cgkju+8vlHv9M96epJLhw0eR6tij/R9Z3YAB lnqOQqE4HHEBq57s0sglr+3bGVOTZBT2ske4AUpA0e6AzdaVcfkT4VmR49P4GpU4WeVL 3YrA== X-Gm-Message-State: ANoB5pnL/7DEMr0AUe8FWYYXcTOvZuctVxwFtY/VBIdNReR9s4jmBitm wD/yy1q/MkLK30yFV1r71r+JFCxdUIVWHg== X-Google-Smtp-Source: AA0mqf41NKF86WS+iBFQkQFbURtlNbQUYRedri5HAOm2V0Zk3CxQ7RKigAO61pxuSV+d13aFks0Qvg== X-Received: by 2002:a1c:4b0f:0:b0:3cf:735c:9d5a with SMTP id y15-20020a1c4b0f000000b003cf735c9d5amr34915263wma.113.1669729544261; Tue, 29 Nov 2022 05:45:44 -0800 (PST) Received: from naush-laptop.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id n8-20020a05600c3b8800b003cfbbd54178sm3565636wms.2.2022.11.29.05.45.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Nov 2022 05:45:43 -0800 (PST) To: libcamera-devel@lists.libcamera.org Date: Tue, 29 Nov 2022 13:45:33 +0000 Message-Id: <20221129134534.2933-10-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221129134534.2933-1-naush@raspberrypi.com> References: <20221129134534.2933-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 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..87ede70ee854 --- /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 heavy CPU loading. + "return_newest_frames": false + } +}