From patchwork Fri Oct 13 07:48:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 19129 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 73707C32B9 for ; Fri, 13 Oct 2023 07:48:55 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 374A162992; Fri, 13 Oct 2023 09:48:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1697183334; bh=iGMyhmt0bK1VsQNsnIf7pQRklQnUnY6RGTCE1C4YmEg=; 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=jhDFS4ZaccdEfW/cueQi8TH0NC6qNpPCP0y+I3AKQdImCKtp8m2MtGA8dT5QdCKVb iLwet2fCa+2yjZw4bkc3KC0bCu/+etlEFVUi/oko3e6d5MPWEos3pXXFH3mvylQW+s 65/po8P0GRPVGu9WA0ZnSEXwg0aSaSS/w3uqVWzReRod42SSdMwlNolWSr0a6DayIo 7ceE/zwHpjlJw+3EtpLzr0LQPjK4meisArPmmq7w7ZCpmnQX3s9nj60Rdn2/T3D/AK 8yFi6gG6IivR55f8fLzUo/SQQbCrG2g49VlJP6xUxmwvOkMlOxMLRg/C3dejfyXZEQ 8N4sjPoRwn9uA== Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id EEB6762983 for ; Fri, 13 Oct 2023 09:48:50 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="gOnJlSLB"; dkim-atps=neutral Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-9ada2e6e75fso310237666b.2 for ; Fri, 13 Oct 2023 00:48:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1697183330; x=1697788130; darn=lists.libcamera.org; 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=BODlzmgW5M/gqIgdlKGcK5w+gODL1ypd7loAk8PQnJM=; b=gOnJlSLBay6u93iE/bVTEvT0u2WWGdTgSN6ZZdUFIiODhftoXv36E8V/ACD9UrrXJn IJMo/VpfVLVnCQJKd5PI/Uz6+lJj/t1Y9xT08aJfBK+lqW2no1cKovfxwS8pNH/Cpzri moiZjcUCzfDIJcpppummZ8qzxiplWodRMf/ZcoGh3YRs4XkSS+zf3e6Vphn4b7hnmD76 32WPfmYuImTJuJd+M9BKrMHgZjoLON1EuHsc3b+GmAFFg2R89G0VM0h3k4gKLxq0nfNK 9/nWqpKL0JZJFITZIUvD02OE1Xam+U51BKxUj1DfzswDBokh1owbtrgSM+XfYwsbbFrt sD8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697183330; x=1697788130; 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=BODlzmgW5M/gqIgdlKGcK5w+gODL1ypd7loAk8PQnJM=; b=ZHVS4DpowSJ0lWqiPPGR/Ykepq+LYQ8OL/Lm7AtQAG0XSWK0VXXGa7XVRSB57G2/Tb R6GBTNTSYbm+TWzMeYvptGCi0dyDluz3AA3pJbtrg1ZRKoZap0evDme+jXXpRgEKc9zk sGKG05QQgVED9zuQ/Ri0hmleWEOgOURVPJkMQenhDKqLK4CcDbsX8fkB61GynK5MbnoD 6uSko42Dh1u5gLGULC3r+tf7QdbdXKMRHK1sTZ8K0qES1W0YcK/vSuVnzWpmG0Sd64o6 hCeBsENlZGaF5RbH9SUGV6V3KSL2i9Lg63tGkgl6i5/HGJwuBRQIlK1eDF1blhj50KUy ePRA== X-Gm-Message-State: AOJu0YyeF8da5RCiE9+X+lqPXOUX9GR/xXMmzGG0D4sZ87TBkxjx1PoD G3+qFp64/c7CHqboRfi5bOgvVX5mFNeOGkpnpTiOpA== X-Google-Smtp-Source: AGHT+IFvYmAzUXCJ1ah/ad2V3Alj1TZETpwxPT+Qg6g/GTAwpCpLvjFv6tFDMZxV2Jwz16iqcit+Ww== X-Received: by 2002:a17:906:cb:b0:9ae:4eb7:ae8b with SMTP id 11-20020a17090600cb00b009ae4eb7ae8bmr26208479eji.7.1697183330320; Fri, 13 Oct 2023 00:48:50 -0700 (PDT) Received: from localhost.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id m16-20020a7bca50000000b003fee6e170f9sm1791890wml.45.2023.10.13.00.48.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 00:48:49 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Fri, 13 Oct 2023 08:48:26 +0100 Message-Id: <20231013074841.16972-6-naush@raspberrypi.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231013074841.16972-1-naush@raspberrypi.com> References: <20231013074841.16972-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 05/20] mojom: pipeline: ipa: rpi: Add fields for PiSP objects 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" Add the PiSP Frontend and Backend SharedMemObject file descriptors to the ipa::init() call. This will allow the pipeline handler to pass these objects to the IPA after construction. Add a flag to indicate if buffer swaps are needed when starting the ISP for the stitch block. Signed-off-by: Naushir Patuck Reviewed-by: David Plowman Reviewed-by: Jacopo Mondi --- include/libcamera/ipa/raspberrypi.mojom | 6 +++++- src/ipa/rpi/common/ipa_base.cpp | 2 +- src/libcamera/pipeline/rpi/vc4/vc4.cpp | 5 +++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/include/libcamera/ipa/raspberrypi.mojom b/include/libcamera/ipa/raspberrypi.mojom index ab4c4e2edca3..5986c4366c15 100644 --- a/include/libcamera/ipa/raspberrypi.mojom +++ b/include/libcamera/ipa/raspberrypi.mojom @@ -22,6 +22,9 @@ struct SensorConfig { struct InitParams { bool lensPresent; libcamera.IPACameraSensorInfo sensorInfo; + /* PISP specific */ + libcamera.SharedFD fe; + libcamera.SharedFD be; }; struct InitResult { @@ -219,13 +222,14 @@ interface IPARPiEventInterface { * \fn prepareIspComplete() * \brief Signal completion of \a prepareIsp * \param[in] buffers Bayer and embedded buffers actioned. + * \param[in] stitchSwapBuffers Whether the stitch block buffers need to be swapped. * * This asynchronous event is signalled to the pipeline handler once * the \a prepareIsp signal has completed, and the ISP is ready to start * processing the frame. The embedded data buffer may be recycled after * this event. */ - prepareIspComplete(BufferIds buffers); + prepareIspComplete(BufferIds buffers, bool stitchSwapBuffers); /** * \fn processStatsComplete() diff --git a/src/ipa/rpi/common/ipa_base.cpp b/src/ipa/rpi/common/ipa_base.cpp index 5939fe57f040..97f647a9e53e 100644 --- a/src/ipa/rpi/common/ipa_base.cpp +++ b/src/ipa/rpi/common/ipa_base.cpp @@ -446,7 +446,7 @@ void IpaBase::prepareIsp(const PrepareParams ¶ms) frameCount_++; /* Ready to push the input buffer into the ISP. */ - prepareIspComplete.emit(params.buffers); + prepareIspComplete.emit(params.buffers, false); } void IpaBase::processStats(const ProcessParams ¶ms) diff --git a/src/libcamera/pipeline/rpi/vc4/vc4.cpp b/src/libcamera/pipeline/rpi/vc4/vc4.cpp index bc90d6324777..233473e2fe2b 100644 --- a/src/libcamera/pipeline/rpi/vc4/vc4.cpp +++ b/src/libcamera/pipeline/rpi/vc4/vc4.cpp @@ -78,7 +78,7 @@ public: void ispOutputDequeue(FrameBuffer *buffer); void processStatsComplete(const ipa::RPi::BufferIds &buffers); - void prepareIspComplete(const ipa::RPi::BufferIds &buffers); + void prepareIspComplete(const ipa::RPi::BufferIds &buffers, bool stitchSwapBuffers); void setIspControls(const ControlList &controls); void setCameraTimeout(uint32_t maxFrameLengthMs); @@ -833,7 +833,8 @@ void Vc4CameraData::processStatsComplete(const ipa::RPi::BufferIds &buffers) handleState(); } -void Vc4CameraData::prepareIspComplete(const ipa::RPi::BufferIds &buffers) +void Vc4CameraData::prepareIspComplete(const ipa::RPi::BufferIds &buffers, + [[maybe_unused]] bool stitchSwapBuffers) { unsigned int embeddedId = buffers.embedded & RPi::MaskID; unsigned int bayer = buffers.bayer & RPi::MaskID;