From patchwork Tue Dec 6 13:54:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 17956 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 F1364C3284 for ; Tue, 6 Dec 2022 13:55:20 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B94C86335E; Tue, 6 Dec 2022 14:55:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1670334920; 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=HeVcyz3g3w06wmHUncGl3+EffYPydP+Go64Fh5nO+Ily8da/ejBtLlfFyNdrXuZP7 NYeDTcvbYII3R3twe/PGrt+QF2H6HWznPjrBaPr/H9+l3zZHYRVguzVrYC0mOIOM1V tgn+sC2p4wpzVPJUCX1/wuL+3oSoGAWkGfw4R5xUPQU/TD6bACYC1tlP1MslC3fmmE 7wS3Mbxd6jYyxc6QPPFkrWLk4pCwJh4eTfU9oHFrthdMYNd0XmwVd8+AQdjy+ba3B0 wT79donXyLU6JIqGa8gDrEXWMxzlKa30dVpkk8lVZGbNxdvBbAIzP1kL5e+5iPmy2m HKZ9JMuTREFzA== Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 75F546335C for ; Tue, 6 Dec 2022 14:55:15 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="dzqYglzO"; dkim-atps=neutral Received: by mail-wm1-x336.google.com with SMTP id m4-20020a05600c3b0400b003d1cb516ce0so663359wms.4 for ; Tue, 06 Dec 2022 05:55:15 -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=dzqYglzOfQxskrsTrzJZpzVyd1meLJkz2spte3XD2cZKK9yPZv9G+jcjv/e2eA/ajc ozK64aMZ0dzenqE9R6yJpi5WJaWN56rVXJKPJpRnSRT/yhgWysgB9mFx7lgAQQGY4H7O qzF2LaUSPBs4ScIwxfBIhf6xEo7XtqLhke5FqAXT8RAfY6UtIPa8Joxf2taOeQAd2ZE9 +0RnBtLfNUgsc8X9723LbzbCimihYdV6X2IaGECulJFmH+Zqh/1mo+e/9wF3GCQ/cD7Q pSOeTOgXhyNjgXAb2PVUZnOhXYLWduHTSR7lksVbv+j9ypeN6nKcUm/YMyHo031pQkbB imSw== 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=1MzmYQp5SJc0kx0SvSSXniIeY4pwQ+dAPyoYLwnxKw4UXazmkqOAydDlOyw4W76Clp CSAKSQC9dOsbnaTvlpo2eVMXfYSGCJpGXZ+v8YW4o2Y6Jz7WzfTKaZqO94D2GUgxJxeb UH8zpFoRjD0sHKwELYAX7VnYySmQjPvcVsJ0mAE8SOehiQutiW87PHw0qacV1H09yUPJ t2MZahvT8WLQlMC7LpFG1FZD8UQ75rI0seIkiZVHDQRPT6F3pOng0vM2RpXpQgP51bBh JfxjNP0TEiFCqnEuIteAmat/GeSZHGT2fB0cPdi7sP4kZ5AJbLF7jYgX/jZPaiAGivvI lXww== X-Gm-Message-State: ANoB5pkI95NAFWTcoYS9Oa7oFjg6gMJRIP2WG90l5JT3wYOnkQqmWd+L jkHCvFuC5jNmFJXIkWfqNdscc39eM9Ao0brs X-Google-Smtp-Source: AA0mqf7VJe1TMveit0puu9y5W1h3TbWConnZSgMMD0RnnqqSct4imaP4Yx5jsE1FDSpmoT66rHxpiA== X-Received: by 2002:a05:600c:4f45:b0:3cf:9be3:8d26 with SMTP id m5-20020a05600c4f4500b003cf9be38d26mr56184608wmq.185.1670334914941; Tue, 06 Dec 2022 05:55:14 -0800 (PST) Received: from naush-laptop.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id q6-20020a05600c2e4600b003c6bd91caa5sm19444059wmf.17.2022.12.06.05.55.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Dec 2022 05:55:14 -0800 (PST) To: libcamera-devel@lists.libcamera.org Date: Tue, 6 Dec 2022 13:54:59 +0000 Message-Id: <20221206135459.25521-14-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221206135459.25521-1-naush@raspberrypi.com> References: <20221206135459.25521-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 13/13] 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 + } +}