From patchwork Fri Jan 27 15:43:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 18200 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 CEC78BDC71 for ; Fri, 27 Jan 2023 15:43:38 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 2D600625EB; Fri, 27 Jan 2023 16:43:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1674834218; bh=Tkh94Ib9vK45TxShaWERDKrslRp6VFn6+LxwhRQYtmA=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=BhvxWU3YwIavxI88fX871JPSlyfkFlH4Dx4AT0ex5kPziRwrJlyDYsv74wJVGlXcz Wm1dCOyO8NyCNgIIgnRzvu6DphY5SJTkGX9zi2Ymo2efkoUwDkek4HNjIsybLEEeRq it6+LQRiS4RZCMH5u5sd0RdcL+vLR45u1II+sMZ+c/zLbY5JEsfqmBeTj+N6WsM0a+ ZR+4fTZ9CruQYE/fzpRaWiaTTzyNPo0O78Elvgnikse1ggech+yxHXslBzlxJBLu6P yKpE2rj+MUp+/3EzCbTNjdy595gF+0O2mpeP27s0iyLmaV8T1zR1dS36vECax659oe lyNqFYUJSuUkQ== Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2E79D61EF9 for ; Fri, 27 Jan 2023 16:43:36 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="FiIsG7Yi"; dkim-atps=neutral Received: by mail-wm1-x333.google.com with SMTP id l8so3744730wms.3 for ; Fri, 27 Jan 2023 07:43:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=FxV3XxK2tF1+je++shW2ukOENRtp4RoKr7KmSn6vmt4=; b=FiIsG7YiE4Nw4VQove8I6w8l4fZfZYs9YbSgqkgojKNfDTW456i8tW9l+dZsFBeI4f gfn1tSPE33d5cjZOcu123nAhLKWyeouq8F6CvjPIWTaNMXzQcCpWfk2JVZ2ko13zV7Ax C/ZGdVw7fmqdIgUkT7FyGoanONhPwZTFtQ48zHUGGvritfZ9jRmYXOdfVuJJNKN1mekg QuMcOuqdOPSxcqszN1TttjR6uOSDJkdwfXmvBrm6hUS0LDW/yT/Z5OEp1zQ9bkOMMPiE PREbkz2j9D6LEExfPHLCNHK0XMiHT4OPWwPAhGK5jTLuNerlwlxDjFasgSrlL1Rj5Ih6 C0/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=FxV3XxK2tF1+je++shW2ukOENRtp4RoKr7KmSn6vmt4=; b=Rb9D7tKeMLbNYUVzTYUQsnOgFNhBH6FcQOlP/A1o4pulRWuNBAlkG9RSZY7ryWmC2g jiz3+msPsTXOl5GT4wOemfI4RKP6TpbZTDFCTvV0LhbdRbsuXtVJGCOpoCNn9BuSAc0Y ZOqZbgfab1fMq9COzJRhj8tSfw7aWEXmu51AkWZr8ilfrxOxlAIRc2UMpLa1BgOGyzoW tk1Ou9eGSCI4SM0S907hCrWAPLa2wFm7eZ+9Nh51K6YnWh8tvsrdd5rtS0yhBnOoL+f9 MEgcbt4uuixLNHY31hyPJxm4t2aoKRfBlkRimYfY+i2K8DlVYS08x1hb7qI+kqptGmuw aBrA== X-Gm-Message-State: AFqh2kqUsllnupEiF7HPJYmQox0hlhabApEWkZ2roIyLV5L8TyQAYlQA UJuuucFA2Mrv8DfPehSi9J19NlClNiTTyExnxWY= X-Google-Smtp-Source: AMrXdXvesHFKYL5cUjHRcVzj5x+kD9Gv1QzbzrOERo9zCuQ6OUNHLf8TKetc91LZV5mlsRZusCLppg== X-Received: by 2002:a05:600c:4256:b0:3da:2a78:d7a3 with SMTP id r22-20020a05600c425600b003da2a78d7a3mr38574822wmm.33.1674834215356; Fri, 27 Jan 2023 07:43:35 -0800 (PST) Received: from localhost.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id h18-20020a05600c30d200b003c21ba7d7d6sm4549566wmn.44.2023.01.27.07.43.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Jan 2023 07:43:35 -0800 (PST) To: libcamera-devel@lists.libcamera.org Date: Fri, 27 Jan 2023 15:43:07 +0000 Message-Id: <20230127154322.29019-1-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v6 00/15] Raspberry Pi: Platform configuration and buffer allocation improvements 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" Hi, Version 6 of this series addresses the following: - Switch the sense of the hint back to how it was in v4. This hint is now called MandatorySteam. - Move the MandatorySteam hint validation into Camera::queueRequest. - Remove the "return_newest_frames" config option. As discussed in the discussion for v5, it's a bit redundant. - Added a bit more documentation for the Unicam buffer config options. - The biggest changes come in patches 12/15 - 15/15 where I've added multi-stream support to lc-compliance. With that, I've added tests for dual stream captures, optional streams, and use of stream hints. Hopefully I've captured all the changes from the feedback, but if I've missed anything, please do let me know. One thing to note - lc-compliance does not run correctly on the Raspberry Pi platform. The reason for this is detailed in [1]. In order to test the lc-compliance app you need to make the following change: This is something that we do need to address at some point... Regards, Naush [1] https://lists.libcamera.org/pipermail/libcamera-devel/2022-December/036136.html Naushir Patuck (15): libcamera: stream: Add stream hints to StreamConfiguration libcamera: pipeline: Add a platform configuration file helper pipeline: raspberrypi: Add a pipeline config structure pipeline: raspberrypi: Reorder startup drop frame initialisation pipeline: raspberrypi: Handle MandatoryStream hints for Unicam Image libcamera: pipeline: build: Add pipeline_data_dir variable pipeline: raspberrypi: Read config parameters from a file pipeline: raspberrypi: Handle MandatoryStream hints for ISP Output0 libcamera: camera: Validate MandatoryStream in queueRequest() pipeline: raspberrypi: Add a parameter to disable startup drop frames pipeline: raspberrypi: Add minimal memory usage config file libcamera: apps: lcc: Make rolesMap global libcamera: apps: lcc: Add multi-stream capture test framework libcamera: apps: lcc: Add optional stream tests libcamera: apps: lcc: Add stream hints test Documentation/environment_variables.rst | 5 + include/libcamera/internal/pipeline_handler.h | 3 + include/libcamera/stream.h | 8 + src/apps/lc-compliance/capture_test.cpp | 136 ++++++++- src/apps/lc-compliance/meson.build | 1 + src/apps/lc-compliance/multi_capture.cpp | 288 ++++++++++++++++++ src/apps/lc-compliance/multi_capture.h | 87 ++++++ src/libcamera/camera.cpp | 12 + src/libcamera/pipeline/meson.build | 3 + .../pipeline/raspberrypi/data/example.yaml | 37 +++ .../pipeline/raspberrypi/data/meson.build | 9 + .../raspberrypi/data/minimal_mem.yaml | 37 +++ .../pipeline/raspberrypi/meson.build | 2 + .../pipeline/raspberrypi/raspberrypi.cpp | 190 ++++++++++-- src/libcamera/pipeline_handler.cpp | 57 ++++ src/libcamera/stream.cpp | 25 ++ 16 files changed, 862 insertions(+), 38 deletions(-) create mode 100644 src/apps/lc-compliance/multi_capture.cpp create mode 100644 src/apps/lc-compliance/multi_capture.h create mode 100644 src/libcamera/pipeline/raspberrypi/data/example.yaml create mode 100644 src/libcamera/pipeline/raspberrypi/data/meson.build create mode 100644 src/libcamera/pipeline/raspberrypi/data/minimal_mem.yaml diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp index 9920f6bb01a7..656e0f623c44 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -1135,6 +1135,8 @@ void PipelineHandlerRPi::stopDevice(Camera *camera) data->bayerQueue_ = {}; data->embeddedQueue_ = {}; + data->freeBuffers(); + /* Stop the IPA. */ data->ipa_->stop();