From patchwork Wed Apr 26 13:10:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 18551 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 EE462BDCBD for ; Wed, 26 Apr 2023 13:13:17 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B3A21627EA; Wed, 26 Apr 2023 15:13:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1682514797; bh=F3959Pm6JU5R3zup7IqNB32YmRQJwXCrrBJ1IbncgHw=; 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=0Vr4UV3JBpOVUCpRuHB1QQUIHcda9+iQEAQavZLlE1Y+85igQcNouKxc/CkBXrn5P 7D7W9+fvzqSFLFKbA7ePvKHN5hDQZxHRA3tjjKq5hIpBD3SxOqOp/Vd6vBJ+ZO1RWF bIR27Odg1Cpqg3rNa3xyuHXj9v44CiHYRJDBHSWBkjnSLPYqh+O8IX9IKMcR8e7sEF JKn0hhobm3Zdh07HLa2F6giLQkhZLL9HABAh/b/s1MRSSz8fYCBGTH22jrlIHRaMJr LT4RGt60P+UqPeOiBykdvKdmPkjRfwNZAAhyWTQOfwoj01pfxOoTjRFHChDS7V/rJm mpVKNi478xzcw== Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 69B60627E6 for ; Wed, 26 Apr 2023 15:13:14 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="ldtEXm3P"; dkim-atps=neutral Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-3f195b164c4so37126405e9.1 for ; Wed, 26 Apr 2023 06:13:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1682514793; x=1685106793; 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=NQoeQRknbIwTLq4lL4VzO01h7SoAhCUftXdW8ib11g4=; b=ldtEXm3PKdKcqPz7Bd19JtG0IDam7z+ntRYwcPoJhOAwiNx2MqPL2idpLvVVmp4Ue7 RC3OAOb8jJFtWJxm4lVFHTWJdgZHevxsPothx7GEaoNyDeEE3jmSB6iSTDcdwOgeHat1 JtqSPpfR+vPc22DT2w83GmI0HS7NLbyEQsbKGxHboRRhmRQaQt4Vvl4fEGt+u8HNrsV3 xgLEzgHgMv9Pgi+k4rj4l/Dax4/l5FJtiHahPvz76X7lUq95AH1gMty0wpo5BUZdhGNI 5gfbnBlqJXKk/5vcTU1OoUNhMbrUC1WQ8lF9qyIfUjGI7y+X03ZTVG4hTgQ1gDuENsaX krbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682514793; x=1685106793; 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=NQoeQRknbIwTLq4lL4VzO01h7SoAhCUftXdW8ib11g4=; b=e9Au/HiIP4Q6PiG7p6eoh87a6AinoM5VDU48b5AI2n4RhTn1fJf/4vL16bMUxwJJkV XAibZFsJbfhvoh258yyxkX55KhANWT0jimcfpXpoFqxBP6IUU3cnQQB3ndrm3WEovhn2 XtvPwHsRN2RLRuPnTnoW1jHsth79miN9BqsV7honVuKFUKMFrAT2P0sBFfJvm421cQpb 6XOGltmpRqLq72qAVBTaA65Qfdf5kbsp8wGUO2Tidc+qNLGFp+lPiPSyP51hAWS2WtMt imXoZqGHRTBANUjETNyP46hCCHJ6X1ylMX/P2oLTO2c0c8yStseg7CDxKz3S+V9z4aPL QvgA== X-Gm-Message-State: AAQBX9fPqPZcK9chcWdgh2xiugwrP41Gieav7prCHox5RJIVFCdBB7K2 hIrOwGwyNWs+IrlGBU6lHGu9cqXVGTgtzsQ1ldTmQQ== X-Google-Smtp-Source: AKy350bH8M2NHeyYPjpE3EhZj4T6p4RZD0JFP7Trh2pB5w0WLo6Hr0niaqxkwy+l8FEFF+VpkaOIkw== X-Received: by 2002:a1c:4b1a:0:b0:3f1:7bb5:9d71 with SMTP id y26-20020a1c4b1a000000b003f17bb59d71mr12663855wma.33.1682514793556; Wed, 26 Apr 2023 06:13:13 -0700 (PDT) Received: from localhost.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id k5-20020adff5c5000000b002f103ca90cdsm15780949wrp.101.2023.04.26.06.13.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Apr 2023 06:13:12 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Wed, 26 Apr 2023 14:10:47 +0100 Message-Id: <20230426131057.21550-4-naush@raspberrypi.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230426131057.21550-1-naush@raspberrypi.com> References: <20230426131057.21550-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 03/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 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 --- Documentation/environment_variables.rst | 2 +- Documentation/guides/introduction.rst | 2 +- Documentation/guides/ipa.rst | 2 +- Documentation/guides/pipeline-handler.rst | 2 +- include/libcamera/ipa/meson.build | 2 +- meson.build | 2 +- meson_options.txt | 2 +- src/libcamera/pipeline/meson.build | 9 +++++++++ .../{raspberrypi => rpi/common}/delayed_controls.cpp | 0 .../{raspberrypi => rpi/common}/delayed_controls.h | 0 src/libcamera/pipeline/rpi/common/meson.build | 8 ++++++++ .../pipeline/{raspberrypi => rpi/common}/rpi_stream.cpp | 0 .../pipeline/{raspberrypi => rpi/common}/rpi_stream.h | 0 .../pipeline/{raspberrypi => rpi/vc4}/data/example.yaml | 0 .../pipeline/{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 -- .../pipeline/{raspberrypi => rpi/vc4}/raspberrypi.cpp | 2 +- 19 files changed, 26 insertions(+), 11 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%) 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/ipa.rst b/Documentation/guides/ipa.rst index 89839408672a..10301d89fc80 100644 --- a/Documentation/guides/ipa.rst +++ b/Documentation/guides/ipa.rst @@ -279,7 +279,7 @@ For example, adding the raspberrypi.mojom file to meson: .. code-block:: none pipeline_ipa_mojom_mapping = [ - 'raspberrypi': 'raspberrypi.mojom', + 'rpi/vc4': 'raspberrypi.mojom', ] This will cause the mojo data definition file to be compiled. Specifically, it diff --git a/Documentation/guides/pipeline-handler.rst b/Documentation/guides/pipeline-handler.rst index 4d38fa23fbcd..7d143b0eaecb 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', 'rpi/vc4', 'rkisp1', '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 67c31cb04ccf..bae15d64d7d8 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 8628e6acebee..f60da3e17719 100644 --- a/meson.build +++ b/meson.build @@ -179,7 +179,7 @@ arch_x86 = ['x86', 'x86_64'] pipelines_support = { 'imx8-isi': arch_arm, 'ipu3': arch_x86, - 'raspberrypi': arch_arm, + 'rpi/vc4': arch_arm, 'rkisp1': arch_arm, 'simple': arch_arm, 'uvcvideo': ['any'], diff --git a/meson_options.txt b/meson_options.txt index 78a78b7214d5..e1f4c205aa94 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -43,7 +43,7 @@ option('pipelines', 'auto', 'imx8-isi', 'ipu3', - 'raspberrypi', + 'rpi/vc4', 'rkisp1', 'simple', 'uvcvideo', diff --git a/src/libcamera/pipeline/meson.build b/src/libcamera/pipeline/meson.build index f14869f3a3c0..4f55611013db 100644 --- a/src/libcamera/pipeline/meson.build +++ b/src/libcamera/pipeline/meson.build @@ -3,6 +3,15 @@ # Location of pipeline specific configuration files pipeline_data_dir = libcamera_datadir / 'pipeline' +# If the Raspberry Pi VC4 pipeline handler is enabled, ensure we include the +# rpi/common subdirectory in the build. +# +# This is done here and not within rpi/vc4/meson.build as meson does not +# allow the subdir command to traverse up the directory tree. +if pipelines.contains('rpi/vc4') + subdir('rpi/common') +endif + foreach pipeline : pipelines subdir(pipeline) endforeach 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..1dec6d3d028b --- /dev/null +++ b/src/libcamera/pipeline/rpi/common/meson.build @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: CC0-1.0 + +libcamera_sources += files([ + 'delayed_controls.cpp', + 'rpi_stream.cpp', +]) + +includes += include_directories('.') 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/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..a7dfa02320e5 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 a4fff28bf198..4595773d2517 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