{"id":18590,"url":"https://patchwork.libcamera.org/api/patches/18590/?format=json","web_url":"https://patchwork.libcamera.org/patch/18590/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20230503122035.32026-6-naush@raspberrypi.com>","date":"2023-05-03T12:20:27","name":"[libcamera-devel,05/13] pipeline: raspberrypi: Refactor and move pipeline handler code","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"3932ad1fab5a6fbc0853465b70615e213516dc53","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/?format=json","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/18590/mbox/","series":[{"id":3863,"url":"https://patchwork.libcamera.org/api/series/3863/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3863","date":"2023-05-03T12:20:22","name":"Raspberry Pi: Code refactoring","version":1,"mbox":"https://patchwork.libcamera.org/series/3863/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/18590/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/18590/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id D90ADC0DA4\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  3 May 2023 12:20:46 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 15773633C3;\n\tWed,  3 May 2023 14:20:45 +0200 (CEST)","from mail-wm1-x335.google.com (mail-wm1-x335.google.com\n\t[IPv6:2a00:1450:4864:20::335])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 209C5633BC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  3 May 2023 14:20:41 +0200 (CEST)","by mail-wm1-x335.google.com with SMTP id\n\t5b1f17b1804b1-3f315712406so21888675e9.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 03 May 2023 05:20:41 -0700 (PDT)","from localhost.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\tf23-20020a7bcd17000000b003ee443bf0c7sm1736785wmj.16.2023.05.03.05.20.39\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 03 May 2023 05:20:40 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1683116445;\n\tbh=ez9UHZ3oSN13tSkRau5999ckuxjrF9DpF0AWXWpBSpE=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=kGijXyzXUo1ekbg8kNC0oIuQ+/eXGIHsn7ioucz5wa57LKoHG7O1YHRxh+fig83Do\n\tqEI2kKaND3veMMAGAnEYf3KfSZCtxUgIItqWpItyuh9rLNeYiZ/y14LFpZoNeHSXJ1\n\tXGSxhNtdplibO0V0b9zCvwoQldqrHQg4pie9yZN3MyUt8bMEIb5Py/4g9V9eQvay4w\n\tQu5qM0til5792tR1zYLYc2Oeikb8/J7PJ6t3sQf5eju9O/A0Hz2FulL2KyJV3n34Gm\n\tbYYWJuCM/uwuaDJRmZ7K891OaxtQYEEh7xUoXWSpSXbyhKImEdrJrJJbPWxMiAmCQN\n\tgrGXtMA2UK77A==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1683116440; x=1685708440;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=F/2MHVKeOlr0o4VD8FPQQe36d1yC/zjAdEojKietEpU=;\n\tb=a7N7ICsAPDjfRYj6WDTzPQeQSis/X4U8tVdNsiMFHG/hdoEALFqrLFIDT/UGtpalrr\n\t5U64vYy8BqAi1ZA2KqReNuZA1i+VMorFd+qCL8xhplWZ5h3W7AVNthNyoaJS6QfYFjmT\n\tngQc9TfjR0o+Hco65Nwr9Qr4hHiUMThLdolBCFi+W1rwSsWsJgkqn4O93hGcUQpQYxFl\n\tCCYtifFoXWp28tVe9gU9HF3b+W/gQx5EpNRCfzA7XvNLi4bkCrRI7kW58OjyXyhhEqNI\n\tVKwAUhtsRvgkMDaN1he6veSCyCq5gDKZ7DvoVcu3+W8TGjjn+Jp0kJxv/6gjd00qUqwn\n\tsRfw=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"a7N7ICsA\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20221208; t=1683116440; x=1685708440;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=F/2MHVKeOlr0o4VD8FPQQe36d1yC/zjAdEojKietEpU=;\n\tb=Gx8Lhvwk1ZZWofR8pzr9mGg5uuAQnUYYrdhcEHKyb+3uEc6YoULrL0iDwmC/jyQHLZ\n\tOsZgQYOO0E5zxmarGz0i3+pSWe24lUGyIrmwhEZaZSUSpqpMOtjh5EKCIbWh80FC04WD\n\tuHR2MEl0AvdOvg+KSxlpnZEmpeYhOuG9/ZrOP7yX4i8Ah+UCrjj53QL1+EzQRDTDnoJb\n\tx3Ws/U3ZOqHMNSXChSWBTLC1qFQvOrRX3vUo6P1vItePUaw5K/+iYDc7CegFQOCF26rc\n\teujFeMP9iyKqqdpkYJUoUvowjmu2hfMbPUl0gwLMRvHwmA6C6e9uTlLWUF9eVZLidV8k\n\tLRmg==","X-Gm-Message-State":"AC+VfDxJ76I3H2rUJtb24nsse83mHGypv1qzkuFTxawsLtr8l++LeUMO\n\teXo5J94nYVM9ZUYwFVeI3aeM2hnFghR5Oq7pgAkkkg==","X-Google-Smtp-Source":"ACHHUZ6eOuTo5wXqLMIBGMGlXqwWoCDOOZSiHOQ8cJ1T7/iG8WPjJhOkX+DFuf1yT62qV8r/qY466A==","X-Received":"by 2002:a1c:770f:0:b0:3f1:94e2:e5bc with SMTP id\n\tt15-20020a1c770f000000b003f194e2e5bcmr1304650wmi.11.1683116440464; \n\tWed, 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","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 05/13] pipeline: raspberrypi: Refactor and\n\tmove pipeline handler code","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Naushir Patuck via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Naushir Patuck <naush@raspberrypi.com>","Cc":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Split the Raspberry Pi pipeline handler code into common and VC4/BCM2835\nspecific file structures.\n\nThe common code files now live in src/libcamera/pipeline/rpi/common/\nand the vc4 specific files in src/libcamera/pipeline/rpi/vc4/.\n\nTo build the pipeline handler, the meson configuration option to select\nthe Raspberry Pi pipeline handler has now changed from \"raspberrypi\" to\n\"rpi/vc4\":\n\nmeson setup build -Dpipelines=rpi/vc4\n\nThere are no functional changes in the pipeline handler code itself.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\nReviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n---\n Documentation/environment_variables.rst              |  2 +-\n Documentation/guides/introduction.rst                |  2 +-\n Documentation/guides/pipeline-handler.rst            |  2 +-\n include/libcamera/ipa/meson.build                    |  2 +-\n meson.build                                          |  2 +-\n meson_options.txt                                    |  2 +-\n .../{raspberrypi => rpi/common}/delayed_controls.cpp |  0\n .../{raspberrypi => rpi/common}/delayed_controls.h   |  0\n src/libcamera/pipeline/rpi/common/meson.build        |  6 ++++++\n .../{raspberrypi => rpi/common}/rpi_stream.cpp       |  0\n .../{raspberrypi => rpi/common}/rpi_stream.h         |  0\n src/libcamera/pipeline/rpi/meson.build               | 12 ++++++++++++\n .../{raspberrypi => rpi/vc4}/data/example.yaml       |  0\n .../{raspberrypi => rpi/vc4}/data/meson.build        |  2 +-\n .../pipeline/{raspberrypi => rpi/vc4}/dma_heaps.cpp  |  0\n .../pipeline/{raspberrypi => rpi/vc4}/dma_heaps.h    |  0\n .../pipeline/{raspberrypi => rpi/vc4}/meson.build    |  2 --\n .../{raspberrypi => rpi/vc4}/raspberrypi.cpp         |  6 +++---\n 18 files changed, 28 insertions(+), 12 deletions(-)\n rename src/libcamera/pipeline/{raspberrypi => rpi/common}/delayed_controls.cpp (100%)\n rename src/libcamera/pipeline/{raspberrypi => rpi/common}/delayed_controls.h (100%)\n create mode 100644 src/libcamera/pipeline/rpi/common/meson.build\n rename src/libcamera/pipeline/{raspberrypi => rpi/common}/rpi_stream.cpp (100%)\n rename src/libcamera/pipeline/{raspberrypi => rpi/common}/rpi_stream.h (100%)\n create mode 100644 src/libcamera/pipeline/rpi/meson.build\n rename src/libcamera/pipeline/{raspberrypi => rpi/vc4}/data/example.yaml (100%)\n rename src/libcamera/pipeline/{raspberrypi => rpi/vc4}/data/meson.build (63%)\n rename src/libcamera/pipeline/{raspberrypi => rpi/vc4}/dma_heaps.cpp (100%)\n rename src/libcamera/pipeline/{raspberrypi => rpi/vc4}/dma_heaps.h (100%)\n rename src/libcamera/pipeline/{raspberrypi => rpi/vc4}/meson.build (71%)\n rename src/libcamera/pipeline/{raspberrypi => rpi/vc4}/raspberrypi.cpp (99%)","diff":"diff --git a/Documentation/environment_variables.rst b/Documentation/environment_variables.rst\nindex ceeb251a2ac0..4bf38b877897 100644\n--- a/Documentation/environment_variables.rst\n+++ b/Documentation/environment_variables.rst\n@@ -40,7 +40,7 @@ LIBCAMERA_IPA_MODULE_PATH\n LIBCAMERA_RPI_CONFIG_FILE\n    Define a custom configuration file to use in the Raspberry Pi pipeline handler.\n \n-   Example value: ``/usr/local/share/libcamera/pipeline/raspberrypi/minimal_mem.yaml``\n+   Example value: ``/usr/local/share/libcamera/pipeline/rpi/vc4/minimal_mem.yaml``\n \n Further details\n ---------------\ndiff --git a/Documentation/guides/introduction.rst b/Documentation/guides/introduction.rst\nindex 2d1760c1866b..700ec2d33c30 100644\n--- a/Documentation/guides/introduction.rst\n+++ b/Documentation/guides/introduction.rst\n@@ -288,7 +288,7 @@ with dedicated pipeline handlers:\n \n    -  Intel IPU3 (ipu3)\n    -  Rockchip RK3399 (rkisp1)\n-   -  RaspberryPi 3 and 4 (raspberrypi)\n+   -  RaspberryPi 3 and 4 (rpi/vc4)\n \n Furthermore, generic platform support is provided for the following:\n \ndiff --git a/Documentation/guides/pipeline-handler.rst b/Documentation/guides/pipeline-handler.rst\nindex 1acd1812cf37..57644534de61 100644\n--- a/Documentation/guides/pipeline-handler.rst\n+++ b/Documentation/guides/pipeline-handler.rst\n@@ -183,7 +183,7 @@ to the libcamera build options in the top level ``meson_options.txt``.\n \n    option('pipelines',\n            type : 'array',\n-           choices : ['ipu3', 'raspberrypi', 'rkisp1', 'simple', 'uvcvideo', 'vimc', 'vivid'],\n+           choices : ['ipu3', 'rkisp1', 'rpi/vc4', 'simple', 'uvcvideo', 'vimc', 'vivid'],\n            description : 'Select which pipeline handlers to include')\n \n \ndiff --git a/include/libcamera/ipa/meson.build b/include/libcamera/ipa/meson.build\nindex c57b3a5e1570..6060c68f047d 100644\n--- a/include/libcamera/ipa/meson.build\n+++ b/include/libcamera/ipa/meson.build\n@@ -64,7 +64,7 @@ libcamera_generated_ipa_headers += custom_target('core_ipa_serializer_h',\n pipeline_ipa_mojom_mapping = {\n     'ipu3': 'ipu3.mojom',\n     'rkisp1': 'rkisp1.mojom',\n-    'raspberrypi': 'raspberrypi.mojom',\n+    'rpi/vc4': 'raspberrypi.mojom',\n     'vimc': 'vimc.mojom',\n }\n \ndiff --git a/meson.build b/meson.build\nindex 2d99029bf5b7..e1fd924307f7 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -194,8 +194,8 @@ arch_x86 = ['x86', 'x86_64']\n pipelines_support = {\n     'imx8-isi':     arch_arm,\n     'ipu3':         arch_x86,\n-    'raspberrypi':  arch_arm,\n     'rkisp1':       arch_arm,\n+    'rpi/vc4':      arch_arm,\n     'simple':       arch_arm,\n     'uvcvideo':     ['any'],\n     'vimc':         ['test'],\ndiff --git a/meson_options.txt b/meson_options.txt\nindex 78a78b7214d5..b4afb8e591a8 100644\n--- a/meson_options.txt\n+++ b/meson_options.txt\n@@ -43,8 +43,8 @@ option('pipelines',\n             'auto',\n             'imx8-isi',\n             'ipu3',\n-            'raspberrypi',\n             'rkisp1',\n+            'rpi/vc4',\n             'simple',\n             'uvcvideo',\n             'vimc'\ndiff --git a/src/libcamera/pipeline/raspberrypi/delayed_controls.cpp b/src/libcamera/pipeline/rpi/common/delayed_controls.cpp\nsimilarity index 100%\nrename from src/libcamera/pipeline/raspberrypi/delayed_controls.cpp\nrename to src/libcamera/pipeline/rpi/common/delayed_controls.cpp\ndiff --git a/src/libcamera/pipeline/raspberrypi/delayed_controls.h b/src/libcamera/pipeline/rpi/common/delayed_controls.h\nsimilarity index 100%\nrename from src/libcamera/pipeline/raspberrypi/delayed_controls.h\nrename to src/libcamera/pipeline/rpi/common/delayed_controls.h\ndiff --git a/src/libcamera/pipeline/rpi/common/meson.build b/src/libcamera/pipeline/rpi/common/meson.build\nnew file mode 100644\nindex 000000000000..2ad594cf8d1a\n--- /dev/null\n+++ b/src/libcamera/pipeline/rpi/common/meson.build\n@@ -0,0 +1,6 @@\n+# SPDX-License-Identifier: CC0-1.0\n+\n+libcamera_sources += files([\n+    'delayed_controls.cpp',\n+    'rpi_stream.cpp',\n+])\ndiff --git a/src/libcamera/pipeline/raspberrypi/rpi_stream.cpp b/src/libcamera/pipeline/rpi/common/rpi_stream.cpp\nsimilarity index 100%\nrename from src/libcamera/pipeline/raspberrypi/rpi_stream.cpp\nrename to src/libcamera/pipeline/rpi/common/rpi_stream.cpp\ndiff --git a/src/libcamera/pipeline/raspberrypi/rpi_stream.h b/src/libcamera/pipeline/rpi/common/rpi_stream.h\nsimilarity index 100%\nrename from src/libcamera/pipeline/raspberrypi/rpi_stream.h\nrename to src/libcamera/pipeline/rpi/common/rpi_stream.h\ndiff --git a/src/libcamera/pipeline/rpi/meson.build b/src/libcamera/pipeline/rpi/meson.build\nnew file mode 100644\nindex 000000000000..2391b6a9729e\n--- /dev/null\n+++ b/src/libcamera/pipeline/rpi/meson.build\n@@ -0,0 +1,12 @@\n+# SPDX-License-Identifier: CC0-1.0\n+\n+subdir('common')\n+\n+foreach pipeline : pipelines\n+    pipeline = pipeline.split('/')\n+    if pipeline.length() < 2 or pipeline[0] != 'rpi'\n+        continue\n+    endif\n+\n+    subdir(pipeline[1])\n+endforeach\ndiff --git a/src/libcamera/pipeline/raspberrypi/data/example.yaml b/src/libcamera/pipeline/rpi/vc4/data/example.yaml\nsimilarity index 100%\nrename from src/libcamera/pipeline/raspberrypi/data/example.yaml\nrename to src/libcamera/pipeline/rpi/vc4/data/example.yaml\ndiff --git a/src/libcamera/pipeline/raspberrypi/data/meson.build b/src/libcamera/pipeline/rpi/vc4/data/meson.build\nsimilarity index 63%\nrename from src/libcamera/pipeline/raspberrypi/data/meson.build\nrename to src/libcamera/pipeline/rpi/vc4/data/meson.build\nindex 1c70433bbcbc..cca5e3885a4e 100644\n--- a/src/libcamera/pipeline/raspberrypi/data/meson.build\n+++ b/src/libcamera/pipeline/rpi/vc4/data/meson.build\n@@ -5,4 +5,4 @@ conf_files = files([\n ])\n \n install_data(conf_files,\n-             install_dir : pipeline_data_dir / 'raspberrypi')\n+             install_dir : pipeline_data_dir / 'rpi' / 'vc4')\ndiff --git a/src/libcamera/pipeline/raspberrypi/dma_heaps.cpp b/src/libcamera/pipeline/rpi/vc4/dma_heaps.cpp\nsimilarity index 100%\nrename from src/libcamera/pipeline/raspberrypi/dma_heaps.cpp\nrename to src/libcamera/pipeline/rpi/vc4/dma_heaps.cpp\ndiff --git a/src/libcamera/pipeline/raspberrypi/dma_heaps.h b/src/libcamera/pipeline/rpi/vc4/dma_heaps.h\nsimilarity index 100%\nrename from src/libcamera/pipeline/raspberrypi/dma_heaps.h\nrename to src/libcamera/pipeline/rpi/vc4/dma_heaps.h\ndiff --git a/src/libcamera/pipeline/raspberrypi/meson.build b/src/libcamera/pipeline/rpi/vc4/meson.build\nsimilarity index 71%\nrename from src/libcamera/pipeline/raspberrypi/meson.build\nrename to src/libcamera/pipeline/rpi/vc4/meson.build\nindex 59e8fb18c555..228823f30922 100644\n--- a/src/libcamera/pipeline/raspberrypi/meson.build\n+++ b/src/libcamera/pipeline/rpi/vc4/meson.build\n@@ -1,10 +1,8 @@\n # SPDX-License-Identifier: CC0-1.0\n \n libcamera_sources += files([\n-    'delayed_controls.cpp',\n     'dma_heaps.cpp',\n     'raspberrypi.cpp',\n-    'rpi_stream.cpp',\n ])\n \n subdir('data')\ndiff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/rpi/vc4/raspberrypi.cpp\nsimilarity index 99%\nrename from src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nrename to src/libcamera/pipeline/rpi/vc4/raspberrypi.cpp\nindex 0060044143cc..af464d153f28 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/rpi/vc4/raspberrypi.cpp\n@@ -2,7 +2,7 @@\n /*\n  * Copyright (C) 2019-2021, Raspberry Pi Ltd\n  *\n- * raspberrypi.cpp - Pipeline handler for Raspberry Pi devices\n+ * raspberrypi.cpp - Pipeline handler for VC4-based Raspberry Pi devices\n  */\n #include <algorithm>\n #include <assert.h>\n@@ -43,9 +43,9 @@\n #include \"libcamera/internal/v4l2_videodevice.h\"\n #include \"libcamera/internal/yaml_parser.h\"\n \n-#include \"delayed_controls.h\"\n+#include \"../common/delayed_controls.h\"\n+#include \"../common/rpi_stream.h\"\n #include \"dma_heaps.h\"\n-#include \"rpi_stream.h\"\n \n using namespace std::chrono_literals;\n \n","prefixes":["libcamera-devel","05/13"]}