From patchwork Tue Sep 15 14:20:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 9627 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 06CB3BF01C for ; Tue, 15 Sep 2020 14:21:36 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C59BA62E23; Tue, 15 Sep 2020 16:21:35 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="ndJeS/Bz"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E4B8B62E17 for ; Tue, 15 Sep 2020 16:21:33 +0200 (CEST) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id B7F34275; Tue, 15 Sep 2020 16:21:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1600179692; bh=ntq4+1Mu3zSwO2v8sDzUUhj9oQrrbn70H0T2eCC18Bs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ndJeS/Bz61iMNEI5NFXuZTJFvFDbD0M1Fjze+Y0gIxRUNpJ4J3P6ngiKArVVbKbaY WUWhDE6m/ILdHsI1MQo24S66F78+9nviDC6zOqfffYn28kzYIg30rf38h0fvgJedbk 3jyKickMc+3BXgOmiMYjTloaDo96InLl8fozenVk= From: Paul Elder 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 definition file 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Add a mojom data definition for raspberrypi pipeline handler's IPAs. This is a direct translation of what the raspberrypi pipeline handler and IPA was using before with IPAOperationData. Also move the enums from raspberrypi.h to raspberrypi.mojom Signed-off-by: Paul Elder --- include/libcamera/ipa/meson.build | 4 +- include/libcamera/ipa/raspberrypi.h | 18 ---- include/libcamera/ipa/raspberrypi.mojom | 110 ++++++++++++++++++++++++ 3 files changed, 113 insertions(+), 19 deletions(-) create mode 100644 include/libcamera/ipa/raspberrypi.mojom diff --git a/include/libcamera/ipa/meson.build b/include/libcamera/ipa/meson.build index f61a5a8f..c80594d7 100644 --- a/include/libcamera/ipa/meson.build +++ b/include/libcamera/ipa/meson.build @@ -13,7 +13,9 @@ install_headers(libcamera_ipa_headers, # Prepare IPA/IPC generation components # -ipa_mojom_files = [] +ipa_mojom_files = [ + 'raspberrypi.mojom', +] mojom_generator = find_program('../../../utils/ipc/generate.py') diff --git a/include/libcamera/ipa/raspberrypi.h b/include/libcamera/ipa/raspberrypi.h index ca62990e..ed2b12d5 100644 --- a/include/libcamera/ipa/raspberrypi.h +++ b/include/libcamera/ipa/raspberrypi.h @@ -10,24 +10,6 @@ #include #include -enum RPiConfigParameters { - RPI_IPA_CONFIG_LS_TABLE = (1 << 0), - RPI_IPA_CONFIG_STAGGERED_WRITE = (1 << 1), - RPI_IPA_CONFIG_SENSOR = (1 << 2), -}; - -enum RPiOperations { - RPI_IPA_ACTION_V4L2_SET_STAGGERED = 1, - RPI_IPA_ACTION_V4L2_SET_ISP, - RPI_IPA_ACTION_STATS_METADATA_COMPLETE, - RPI_IPA_ACTION_RUN_ISP, - RPI_IPA_ACTION_RUN_ISP_AND_DROP_FRAME, - RPI_IPA_ACTION_EMBEDDED_COMPLETE, - RPI_IPA_EVENT_SIGNAL_STAT_READY, - RPI_IPA_EVENT_SIGNAL_ISP_PREPARE, - RPI_IPA_EVENT_QUEUE_REQUEST, -}; - enum RPiIpaMask { ID = 0x0ffff, STATS = 0x10000, diff --git a/include/libcamera/ipa/raspberrypi.mojom b/include/libcamera/ipa/raspberrypi.mojom new file mode 100644 index 00000000..6e1ce8c0 --- /dev/null +++ b/include/libcamera/ipa/raspberrypi.mojom @@ -0,0 +1,110 @@ +// these should probably should be in a mojo header +struct CameraSensorInfo {}; +struct ControlInfoMap {}; +struct ControlList {}; +struct FileDescriptor {}; +// for libcamera types, hasFd attr is needed to notify compiler that struct has fd +[hasFd] struct IPABuffer {}; +struct IPASettings {}; +struct IPAStream {}; + +// automatically add const and & to all inputs (that are not primitives) +// automatically add pointer to all outputs (that are not primitives) +// if return value is single and primitive, then return as ret value +// if return value is multiple or non-primitive, then return as output param +// const not allowed in array/map due to mojo parser +// default sync +interface IPARPiInterface { + init(IPASettings settings) => (int32 ret); + start() => (int32 ret); + stop(); + + configure(CameraSensorInfo sensorInfo, + map streamConfig, + map entityControls, + RPiConfigureParams ipaConfig) + => (RPiConfigureParams results); + + // arrays get turned into vectors + mapBuffers(array buffers); + unmapBuffers(array ids); + + [async] processEvent(RPiEventParams data); +}; + +// these shall not return anything +// only async allowed (sync not allowed) +interface IPARPiCallbackInterface { + queueFrameAction(uint32 frame, RPiActionParams action); +}; + +enum RPiConfigParameters { + RPI_IPA_CONFIG_LS_TABLE, + RPI_IPA_CONFIG_STAGGERED_WRITE, + RPI_IPA_CONFIG_SENSOR, + RPI_IPA_CONFIG_SEND_FD, +}; + +enum RPiEvents { + RPI_IPA_EVENT_SIGNAL_STAT_READY, + RPI_IPA_EVENT_SIGNAL_ISP_PREPARE, + RPI_IPA_EVENT_QUEUE_REQUEST, + RPI_IPA_EVENT_SEND_FD, +}; + +enum RPiActions { + RPI_IPA_ACTION_V4L2_SET_STAGGERED, + RPI_IPA_ACTION_V4L2_SET_ISP, + RPI_IPA_ACTION_STATS_METADATA_COMPLETE, + RPI_IPA_ACTION_RUN_ISP, + RPI_IPA_ACTION_RUN_ISP_AND_DROP_FRAME, + RPI_IPA_ACTION_EMBEDDED_COMPLETE, +}; + +// Custom Data containers + +struct RPiStaggeredWritePayload { + uint32 gainDelay; + uint32 exposureDelay; + uint32 sensorMetadata; +}; + +struct RPiIspPreparePayload { + uint32 embeddedbufferId; + uint32 bayerbufferId; +}; + +struct RPiStatsCompletePayload { + uint32 bufferId; + ControlList controls; +}; + +struct RPiConfigurePayload { + RPiConfigParameters op; + FileDescriptor lsTableHandle; + int32 lsTableHandleStatic = -1; + RPiStaggeredWritePayload staggeredWriteResult; + ControlList controls; + int32 bufferFd; +}; + +// First level payload + +struct RPiConfigureParams { + array payload; +}; + +struct RPiEventParams { + RPiEvents ev; + uint32 bufferId; + RPiIspPreparePayload ispPrepare; + ControlList controls; + int32 bufferFd; +}; + +struct RPiActionParams { + RPiActions op; + uint32 bufferId; + RPiStatsCompletePayload statsComplete; + ControlList controls; +};