From patchwork Wed May 3 12:20:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 18590 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 D90ADC0DA4 for ; Wed, 3 May 2023 12:20:46 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 15773633C3; Wed, 3 May 2023 14:20:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1683116445; bh=ez9UHZ3oSN13tSkRau5999ckuxjrF9DpF0AWXWpBSpE=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=kGijXyzXUo1ekbg8kNC0oIuQ+/eXGIHsn7ioucz5wa57LKoHG7O1YHRxh+fig83Do qEI2kKaND3veMMAGAnEYf3KfSZCtxUgIItqWpItyuh9rLNeYiZ/y14LFpZoNeHSXJ1 XGSxhNtdplibO0V0b9zCvwoQldqrHQg4pie9yZN3MyUt8bMEIb5Py/4g9V9eQvay4w Qu5qM0til5792tR1zYLYc2Oeikb8/J7PJ6t3sQf5eju9O/A0Hz2FulL2KyJV3n34Gm bYYWJuCM/uwuaDJRmZ7K891OaxtQYEEh7xUoXWSpSXbyhKImEdrJrJJbPWxMiAmCQN grGXtMA2UK77A== Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 209C5633BC for ; Wed, 3 May 2023 14:20:41 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="a7N7ICsA"; dkim-atps=neutral Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-3f315712406so21888675e9.0 for ; Wed, 03 May 2023 05:20:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1683116440; x=1685708440; 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=F/2MHVKeOlr0o4VD8FPQQe36d1yC/zjAdEojKietEpU=; b=a7N7ICsAPDjfRYj6WDTzPQeQSis/X4U8tVdNsiMFHG/hdoEALFqrLFIDT/UGtpalrr 5U64vYy8BqAi1ZA2KqReNuZA1i+VMorFd+qCL8xhplWZ5h3W7AVNthNyoaJS6QfYFjmT ngQc9TfjR0o+Hco65Nwr9Qr4hHiUMThLdolBCFi+W1rwSsWsJgkqn4O93hGcUQpQYxFl CCYtifFoXWp28tVe9gU9HF3b+W/gQx5EpNRCfzA7XvNLi4bkCrRI7kW58OjyXyhhEqNI VKwAUhtsRvgkMDaN1he6veSCyCq5gDKZ7DvoVcu3+W8TGjjn+Jp0kJxv/6gjd00qUqwn sRfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683116440; x=1685708440; 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=F/2MHVKeOlr0o4VD8FPQQe36d1yC/zjAdEojKietEpU=; b=Gx8Lhvwk1ZZWofR8pzr9mGg5uuAQnUYYrdhcEHKyb+3uEc6YoULrL0iDwmC/jyQHLZ OsZgQYOO0E5zxmarGz0i3+pSWe24lUGyIrmwhEZaZSUSpqpMOtjh5EKCIbWh80FC04WD uHR2MEl0AvdOvg+KSxlpnZEmpeYhOuG9/ZrOP7yX4i8Ah+UCrjj53QL1+EzQRDTDnoJb x3Ws/U3ZOqHMNSXChSWBTLC1qFQvOrRX3vUo6P1vItePUaw5K/+iYDc7CegFQOCF26rc eujFeMP9iyKqqdpkYJUoUvowjmu2hfMbPUl0gwLMRvHwmA6C6e9uTlLWUF9eVZLidV8k LRmg== X-Gm-Message-State: AC+VfDxJ76I3H2rUJtb24nsse83mHGypv1qzkuFTxawsLtr8l++LeUMO eXo5J94nYVM9ZUYwFVeI3aeM2hnFghR5Oq7pgAkkkg== X-Google-Smtp-Source: ACHHUZ6eOuTo5wXqLMIBGMGlXqwWoCDOOZSiHOQ8cJ1T7/iG8WPjJhOkX+DFuf1yT62qV8r/qY466A== X-Received: by 2002:a1c:770f:0:b0:3f1:94e2:e5bc with SMTP id t15-20020a1c770f000000b003f194e2e5bcmr1304650wmi.11.1683116440464; Wed, 03 May 2023 05:20:40 -0700 (PDT) Received: from localhost.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id f23-20020a7bcd17000000b003ee443bf0c7sm1736785wmj.16.2023.05.03.05.20.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 May 2023 05:20:40 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Wed, 3 May 2023 13:20:27 +0100 Message-Id: <20230503122035.32026-6-naush@raspberrypi.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230503122035.32026-1-naush@raspberrypi.com> References: <20230503122035.32026-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 05/13] pipeline: raspberrypi: Refactor and move pipeline handler code 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 Cc: Jacopo Mondi Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Split the Raspberry Pi pipeline handler code into common and VC4/BCM2835 specific file structures. The common code files now live in src/libcamera/pipeline/rpi/common/ and the vc4 specific files in src/libcamera/pipeline/rpi/vc4/. To build the pipeline handler, the meson configuration option to select the Raspberry Pi pipeline handler has now changed from "raspberrypi" to "rpi/vc4": meson setup build -Dpipelines=rpi/vc4 There are no functional changes in the pipeline handler code itself. Signed-off-by: Naushir Patuck Reviewed-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- Documentation/environment_variables.rst | 2 +- Documentation/guides/introduction.rst | 2 +- Documentation/guides/pipeline-handler.rst | 2 +- include/libcamera/ipa/meson.build | 2 +- meson.build | 2 +- meson_options.txt | 2 +- .../{raspberrypi => rpi/common}/delayed_controls.cpp | 0 .../{raspberrypi => rpi/common}/delayed_controls.h | 0 src/libcamera/pipeline/rpi/common/meson.build | 6 ++++++ .../{raspberrypi => rpi/common}/rpi_stream.cpp | 0 .../{raspberrypi => rpi/common}/rpi_stream.h | 0 src/libcamera/pipeline/rpi/meson.build | 12 ++++++++++++ .../{raspberrypi => rpi/vc4}/data/example.yaml | 0 .../{raspberrypi => rpi/vc4}/data/meson.build | 2 +- .../pipeline/{raspberrypi => rpi/vc4}/dma_heaps.cpp | 0 .../pipeline/{raspberrypi => rpi/vc4}/dma_heaps.h | 0 .../pipeline/{raspberrypi => rpi/vc4}/meson.build | 2 -- .../{raspberrypi => rpi/vc4}/raspberrypi.cpp | 6 +++--- 18 files changed, 28 insertions(+), 12 deletions(-) rename src/libcamera/pipeline/{raspberrypi => rpi/common}/delayed_controls.cpp (100%) rename src/libcamera/pipeline/{raspberrypi => rpi/common}/delayed_controls.h (100%) create mode 100644 src/libcamera/pipeline/rpi/common/meson.build rename src/libcamera/pipeline/{raspberrypi => rpi/common}/rpi_stream.cpp (100%) rename src/libcamera/pipeline/{raspberrypi => rpi/common}/rpi_stream.h (100%) create mode 100644 src/libcamera/pipeline/rpi/meson.build rename src/libcamera/pipeline/{raspberrypi => rpi/vc4}/data/example.yaml (100%) rename src/libcamera/pipeline/{raspberrypi => rpi/vc4}/data/meson.build (63%) rename src/libcamera/pipeline/{raspberrypi => rpi/vc4}/dma_heaps.cpp (100%) rename src/libcamera/pipeline/{raspberrypi => rpi/vc4}/dma_heaps.h (100%) rename src/libcamera/pipeline/{raspberrypi => rpi/vc4}/meson.build (71%) rename src/libcamera/pipeline/{raspberrypi => rpi/vc4}/raspberrypi.cpp (99%) diff --git a/Documentation/environment_variables.rst b/Documentation/environment_variables.rst index ceeb251a2ac0..4bf38b877897 100644 --- a/Documentation/environment_variables.rst +++ b/Documentation/environment_variables.rst @@ -40,7 +40,7 @@ LIBCAMERA_IPA_MODULE_PATH LIBCAMERA_RPI_CONFIG_FILE Define a custom configuration file to use in the Raspberry Pi pipeline handler. - Example value: ``/usr/local/share/libcamera/pipeline/raspberrypi/minimal_mem.yaml`` + Example value: ``/usr/local/share/libcamera/pipeline/rpi/vc4/minimal_mem.yaml`` Further details --------------- diff --git a/Documentation/guides/introduction.rst b/Documentation/guides/introduction.rst index 2d1760c1866b..700ec2d33c30 100644 --- a/Documentation/guides/introduction.rst +++ b/Documentation/guides/introduction.rst @@ -288,7 +288,7 @@ with dedicated pipeline handlers: - Intel IPU3 (ipu3) - Rockchip RK3399 (rkisp1) - - RaspberryPi 3 and 4 (raspberrypi) + - RaspberryPi 3 and 4 (rpi/vc4) Furthermore, generic platform support is provided for the following: diff --git a/Documentation/guides/pipeline-handler.rst b/Documentation/guides/pipeline-handler.rst index 1acd1812cf37..57644534de61 100644 --- a/Documentation/guides/pipeline-handler.rst +++ b/Documentation/guides/pipeline-handler.rst @@ -183,7 +183,7 @@ to the libcamera build options in the top level ``meson_options.txt``. option('pipelines', type : 'array', - choices : ['ipu3', 'raspberrypi', 'rkisp1', 'simple', 'uvcvideo', 'vimc', 'vivid'], + choices : ['ipu3', 'rkisp1', 'rpi/vc4', 'simple', 'uvcvideo', 'vimc', 'vivid'], description : 'Select which pipeline handlers to include') diff --git a/include/libcamera/ipa/meson.build b/include/libcamera/ipa/meson.build index c57b3a5e1570..6060c68f047d 100644 --- a/include/libcamera/ipa/meson.build +++ b/include/libcamera/ipa/meson.build @@ -64,7 +64,7 @@ libcamera_generated_ipa_headers += custom_target('core_ipa_serializer_h', pipeline_ipa_mojom_mapping = { 'ipu3': 'ipu3.mojom', 'rkisp1': 'rkisp1.mojom', - 'raspberrypi': 'raspberrypi.mojom', + 'rpi/vc4': 'raspberrypi.mojom', 'vimc': 'vimc.mojom', } diff --git a/meson.build b/meson.build index 2d99029bf5b7..e1fd924307f7 100644 --- a/meson.build +++ b/meson.build @@ -194,8 +194,8 @@ arch_x86 = ['x86', 'x86_64'] pipelines_support = { 'imx8-isi': arch_arm, 'ipu3': arch_x86, - 'raspberrypi': arch_arm, 'rkisp1': arch_arm, + 'rpi/vc4': arch_arm, 'simple': arch_arm, 'uvcvideo': ['any'], 'vimc': ['test'], diff --git a/meson_options.txt b/meson_options.txt index 78a78b7214d5..b4afb8e591a8 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -43,8 +43,8 @@ option('pipelines', 'auto', 'imx8-isi', 'ipu3', - 'raspberrypi', 'rkisp1', + 'rpi/vc4', 'simple', 'uvcvideo', 'vimc' diff --git a/src/libcamera/pipeline/raspberrypi/delayed_controls.cpp b/src/libcamera/pipeline/rpi/common/delayed_controls.cpp similarity index 100% rename from src/libcamera/pipeline/raspberrypi/delayed_controls.cpp rename to src/libcamera/pipeline/rpi/common/delayed_controls.cpp diff --git a/src/libcamera/pipeline/raspberrypi/delayed_controls.h b/src/libcamera/pipeline/rpi/common/delayed_controls.h similarity index 100% rename from src/libcamera/pipeline/raspberrypi/delayed_controls.h rename to src/libcamera/pipeline/rpi/common/delayed_controls.h diff --git a/src/libcamera/pipeline/rpi/common/meson.build b/src/libcamera/pipeline/rpi/common/meson.build new file mode 100644 index 000000000000..2ad594cf8d1a --- /dev/null +++ b/src/libcamera/pipeline/rpi/common/meson.build @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: CC0-1.0 + +libcamera_sources += files([ + 'delayed_controls.cpp', + 'rpi_stream.cpp', +]) diff --git a/src/libcamera/pipeline/raspberrypi/rpi_stream.cpp b/src/libcamera/pipeline/rpi/common/rpi_stream.cpp similarity index 100% rename from src/libcamera/pipeline/raspberrypi/rpi_stream.cpp rename to src/libcamera/pipeline/rpi/common/rpi_stream.cpp diff --git a/src/libcamera/pipeline/raspberrypi/rpi_stream.h b/src/libcamera/pipeline/rpi/common/rpi_stream.h similarity index 100% rename from src/libcamera/pipeline/raspberrypi/rpi_stream.h rename to src/libcamera/pipeline/rpi/common/rpi_stream.h diff --git a/src/libcamera/pipeline/rpi/meson.build b/src/libcamera/pipeline/rpi/meson.build new file mode 100644 index 000000000000..2391b6a9729e --- /dev/null +++ b/src/libcamera/pipeline/rpi/meson.build @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: CC0-1.0 + +subdir('common') + +foreach pipeline : pipelines + pipeline = pipeline.split('/') + if pipeline.length() < 2 or pipeline[0] != 'rpi' + continue + endif + + subdir(pipeline[1]) +endforeach diff --git a/src/libcamera/pipeline/raspberrypi/data/example.yaml b/src/libcamera/pipeline/rpi/vc4/data/example.yaml similarity index 100% rename from src/libcamera/pipeline/raspberrypi/data/example.yaml rename to src/libcamera/pipeline/rpi/vc4/data/example.yaml diff --git a/src/libcamera/pipeline/raspberrypi/data/meson.build b/src/libcamera/pipeline/rpi/vc4/data/meson.build similarity index 63% rename from src/libcamera/pipeline/raspberrypi/data/meson.build rename to src/libcamera/pipeline/rpi/vc4/data/meson.build index 1c70433bbcbc..cca5e3885a4e 100644 --- a/src/libcamera/pipeline/raspberrypi/data/meson.build +++ b/src/libcamera/pipeline/rpi/vc4/data/meson.build @@ -5,4 +5,4 @@ conf_files = files([ ]) install_data(conf_files, - install_dir : pipeline_data_dir / 'raspberrypi') + install_dir : pipeline_data_dir / 'rpi' / 'vc4') diff --git a/src/libcamera/pipeline/raspberrypi/dma_heaps.cpp b/src/libcamera/pipeline/rpi/vc4/dma_heaps.cpp similarity index 100% rename from src/libcamera/pipeline/raspberrypi/dma_heaps.cpp rename to src/libcamera/pipeline/rpi/vc4/dma_heaps.cpp diff --git a/src/libcamera/pipeline/raspberrypi/dma_heaps.h b/src/libcamera/pipeline/rpi/vc4/dma_heaps.h similarity index 100% rename from src/libcamera/pipeline/raspberrypi/dma_heaps.h rename to src/libcamera/pipeline/rpi/vc4/dma_heaps.h diff --git a/src/libcamera/pipeline/raspberrypi/meson.build b/src/libcamera/pipeline/rpi/vc4/meson.build similarity index 71% rename from src/libcamera/pipeline/raspberrypi/meson.build rename to src/libcamera/pipeline/rpi/vc4/meson.build index 59e8fb18c555..228823f30922 100644 --- a/src/libcamera/pipeline/raspberrypi/meson.build +++ b/src/libcamera/pipeline/rpi/vc4/meson.build @@ -1,10 +1,8 @@ # SPDX-License-Identifier: CC0-1.0 libcamera_sources += files([ - 'delayed_controls.cpp', 'dma_heaps.cpp', 'raspberrypi.cpp', - 'rpi_stream.cpp', ]) subdir('data') diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/rpi/vc4/raspberrypi.cpp similarity index 99% rename from src/libcamera/pipeline/raspberrypi/raspberrypi.cpp rename to src/libcamera/pipeline/rpi/vc4/raspberrypi.cpp index 0060044143cc..af464d153f28 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/rpi/vc4/raspberrypi.cpp @@ -2,7 +2,7 @@ /* * Copyright (C) 2019-2021, Raspberry Pi Ltd * - * raspberrypi.cpp - Pipeline handler for Raspberry Pi devices + * raspberrypi.cpp - Pipeline handler for VC4-based Raspberry Pi devices */ #include #include @@ -43,9 +43,9 @@ #include "libcamera/internal/v4l2_videodevice.h" #include "libcamera/internal/yaml_parser.h" -#include "delayed_controls.h" +#include "../common/delayed_controls.h" +#include "../common/rpi_stream.h" #include "dma_heaps.h" -#include "rpi_stream.h" using namespace std::chrono_literals;