{"id":9627,"url":"https://patchwork.libcamera.org/api/patches/9627/?format=json","web_url":"https://patchwork.libcamera.org/patch/9627/","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":"<20200915142038.28757-18-paul.elder@ideasonboard.com>","date":"2020-09-15T14:20:32","name":"[libcamera-devel,17/23] ipa: raspberrypi: Add mojom data definition file","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"1f8c993fd72530972712a0890e620beddfbaff7e","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/?format=json","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/9627/mbox/","series":[{"id":1291,"url":"https://patchwork.libcamera.org/api/series/1291/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1291","date":"2020-09-15T14:20:16","name":"IPA isolation implementation","version":1,"mbox":"https://patchwork.libcamera.org/series/1291/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/9627/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/9627/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 06CB3BF01C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 15 Sep 2020 14:21:36 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C59BA62E23;\n\tTue, 15 Sep 2020 16:21:35 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E4B8B62E17\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 15 Sep 2020 16:21:33 +0200 (CEST)","from pyrite.rasen.tech (unknown\n\t[IPv6:2400:4051:61:600:2c71:1b79:d06d:5032])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B7F34275;\n\tTue, 15 Sep 2020 16:21:30 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"ndJeS/Bz\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1600179692;\n\tbh=ntq4+1Mu3zSwO2v8sDzUUhj9oQrrbn70H0T2eCC18Bs=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=ndJeS/Bz61iMNEI5NFXuZTJFvFDbD0M1Fjze+Y0gIxRUNpJ4J3P6ngiKArVVbKbaY\n\tWUWhDE6m/ILdHsI1MQo24S66F78+9nviDC6zOqfffYn28kzYIg30rf38h0fvgJedbk\n\t3jyKickMc+3BXgOmiMYjTloaDo96InLl8fozenVk=","From":"Paul Elder <paul.elder@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Tue, 15 Sep 2020 23:20:32 +0900","Message-Id":"<20200915142038.28757-18-paul.elder@ideasonboard.com>","X-Mailer":"git-send-email 2.27.0","In-Reply-To":"<20200915142038.28757-1-paul.elder@ideasonboard.com>","References":"<20200915142038.28757-1-paul.elder@ideasonboard.com>","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH 17/23] ipa: raspberrypi: Add mojom data\n\tdefinition file","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>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Add a mojom data definition for raspberrypi pipeline handler's IPAs.\nThis is a direct translation of what the raspberrypi pipeline handler\nand IPA was using before with IPAOperationData.\n\nAlso move the enums from raspberrypi.h to raspberrypi.mojom\n\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\n---\n include/libcamera/ipa/meson.build       |   4 +-\n include/libcamera/ipa/raspberrypi.h     |  18 ----\n include/libcamera/ipa/raspberrypi.mojom | 110 ++++++++++++++++++++++++\n 3 files changed, 113 insertions(+), 19 deletions(-)\n create mode 100644 include/libcamera/ipa/raspberrypi.mojom","diff":"diff --git a/include/libcamera/ipa/meson.build b/include/libcamera/ipa/meson.build\nindex f61a5a8f..c80594d7 100644\n--- a/include/libcamera/ipa/meson.build\n+++ b/include/libcamera/ipa/meson.build\n@@ -13,7 +13,9 @@ install_headers(libcamera_ipa_headers,\n # Prepare IPA/IPC generation components\n #\n \n-ipa_mojom_files = []\n+ipa_mojom_files = [\n+    'raspberrypi.mojom',\n+]\n \n mojom_generator = find_program('../../../utils/ipc/generate.py')\n \ndiff --git a/include/libcamera/ipa/raspberrypi.h b/include/libcamera/ipa/raspberrypi.h\nindex ca62990e..ed2b12d5 100644\n--- a/include/libcamera/ipa/raspberrypi.h\n+++ b/include/libcamera/ipa/raspberrypi.h\n@@ -10,24 +10,6 @@\n #include <libcamera/control_ids.h>\n #include <libcamera/controls.h>\n \n-enum RPiConfigParameters {\n-\tRPI_IPA_CONFIG_LS_TABLE = (1 << 0),\n-\tRPI_IPA_CONFIG_STAGGERED_WRITE = (1 << 1),\n-\tRPI_IPA_CONFIG_SENSOR = (1 << 2),\n-};\n-\n-enum RPiOperations {\n-\tRPI_IPA_ACTION_V4L2_SET_STAGGERED = 1,\n-\tRPI_IPA_ACTION_V4L2_SET_ISP,\n-\tRPI_IPA_ACTION_STATS_METADATA_COMPLETE,\n-\tRPI_IPA_ACTION_RUN_ISP,\n-\tRPI_IPA_ACTION_RUN_ISP_AND_DROP_FRAME,\n-\tRPI_IPA_ACTION_EMBEDDED_COMPLETE,\n-\tRPI_IPA_EVENT_SIGNAL_STAT_READY,\n-\tRPI_IPA_EVENT_SIGNAL_ISP_PREPARE,\n-\tRPI_IPA_EVENT_QUEUE_REQUEST,\n-};\n-\n enum RPiIpaMask {\n \tID\t\t= 0x0ffff,\n \tSTATS\t\t= 0x10000,\ndiff --git a/include/libcamera/ipa/raspberrypi.mojom b/include/libcamera/ipa/raspberrypi.mojom\nnew file mode 100644\nindex 00000000..6e1ce8c0\n--- /dev/null\n+++ b/include/libcamera/ipa/raspberrypi.mojom\n@@ -0,0 +1,110 @@\n+// these should probably should be in a mojo header\n+struct CameraSensorInfo {};\n+struct ControlInfoMap {};\n+struct ControlList {};\n+struct FileDescriptor {};\n+// for libcamera types, hasFd attr is needed to notify compiler that struct has fd\n+[hasFd] struct IPABuffer {};\n+struct IPASettings {};\n+struct IPAStream {};\n+\n+// automatically add const and & to all inputs (that are not primitives)\n+// automatically add pointer to all outputs (that are not primitives)\n+// if return value is single and primitive, then return as ret value\n+// if return value is multiple or non-primitive, then return as output param\n+// const not allowed in array/map due to mojo parser\n+// default sync\n+interface IPARPiInterface {\n+\tinit(IPASettings settings) => (int32 ret);\n+\tstart() => (int32 ret);\n+\tstop();\n+\n+\tconfigure(CameraSensorInfo sensorInfo,\n+\t\t  map<uint32, IPAStream> streamConfig,\n+\t\t  map<uint32, ControlInfoMap> entityControls,\n+\t\t  RPiConfigureParams ipaConfig)\n+\t\t=> (RPiConfigureParams results);\n+\n+\t// arrays get turned into vectors\n+\tmapBuffers(array<IPABuffer> buffers);\n+\tunmapBuffers(array<uint32> ids);\n+\n+\t[async] processEvent(RPiEventParams data);\n+};\n+\n+// these shall not return anything\n+// only async allowed (sync not allowed)\n+interface IPARPiCallbackInterface {\n+\tqueueFrameAction(uint32 frame, RPiActionParams action);\n+};\n+\n+enum RPiConfigParameters {\n+\tRPI_IPA_CONFIG_LS_TABLE,\n+\tRPI_IPA_CONFIG_STAGGERED_WRITE,\n+\tRPI_IPA_CONFIG_SENSOR,\n+\tRPI_IPA_CONFIG_SEND_FD,\n+};\n+\n+enum RPiEvents {\n+\tRPI_IPA_EVENT_SIGNAL_STAT_READY,\n+\tRPI_IPA_EVENT_SIGNAL_ISP_PREPARE,\n+\tRPI_IPA_EVENT_QUEUE_REQUEST,\n+\tRPI_IPA_EVENT_SEND_FD,\n+};\n+\n+enum RPiActions {\n+\tRPI_IPA_ACTION_V4L2_SET_STAGGERED,\n+\tRPI_IPA_ACTION_V4L2_SET_ISP,\n+\tRPI_IPA_ACTION_STATS_METADATA_COMPLETE,\n+\tRPI_IPA_ACTION_RUN_ISP,\n+\tRPI_IPA_ACTION_RUN_ISP_AND_DROP_FRAME,\n+\tRPI_IPA_ACTION_EMBEDDED_COMPLETE,\n+};\n+\n+// Custom Data containers\n+\n+struct RPiStaggeredWritePayload {\n+\tuint32 gainDelay;\n+\tuint32 exposureDelay;\n+\tuint32 sensorMetadata;\n+};\n+\n+struct RPiIspPreparePayload {\n+\tuint32 embeddedbufferId;\n+\tuint32 bayerbufferId;\n+};\n+\n+struct RPiStatsCompletePayload {\n+\tuint32 bufferId;\n+\tControlList controls;\n+};\n+\n+struct RPiConfigurePayload {\n+\tRPiConfigParameters op;\n+\tFileDescriptor lsTableHandle;\n+\tint32 lsTableHandleStatic = -1;\n+\tRPiStaggeredWritePayload staggeredWriteResult;\n+\tControlList controls;\n+\tint32 bufferFd;\n+};\n+\n+// First level payload\n+\n+struct RPiConfigureParams {\n+\tarray<RPiConfigurePayload> payload;\n+};\n+\n+struct RPiEventParams {\n+\tRPiEvents ev;\n+\tuint32 bufferId;\n+\tRPiIspPreparePayload ispPrepare;\n+\tControlList controls;\n+\tint32 bufferFd;\n+};\n+\n+struct RPiActionParams {\n+\tRPiActions op;\n+\tuint32 bufferId;\n+\tRPiStatsCompletePayload statsComplete;\n+\tControlList controls;\n+};\n","prefixes":["libcamera-devel","17/23"]}