From patchwork Fri Oct 6 13:19:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 19107 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 4E2FAC32B8 for ; Fri, 6 Oct 2023 13:20:05 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 026F762978; Fri, 6 Oct 2023 15:20:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1696598405; bh=q0vFDvJ59VY1d2uiPajM23Wn3sUowIiscRNkmUTSDtU=; 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=lYUvC/bMkUMShHVx11bjv+A2MEOJiJE+yBdqehrqboJxRJtwkCk3GwZAeERWYnY9N 5FM5dPTkbuVOa3duWkzPynLTy/VwweO/SgZzT0pPljltznr2HvR9PXEihde1brnjw0 SnXy7e/XNaczI9DdVo8eDJk3wiuVCVW8wTjg23gTBs80pbDrL8n3R2qGrOilUi0EZ2 3GyQphJIC8JvUY7s5NgzQ5Kr5p+UDuJo/uBmdHgDKZiM5Pse4EdDnzdjSrdIFTeom/ IR7jLb2uw1tnCLRLgn6j6h07XUVsEjY5dtsUJFz5FY/RsWaViW7hJirAAqTc9GHZRo JI8L3OYL0kg7A== Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id DCA216296B for ; Fri, 6 Oct 2023 15:20:02 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="m8jvrtCU"; dkim-atps=neutral Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-3231df68584so1935522f8f.1 for ; Fri, 06 Oct 2023 06:20:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1696598402; x=1697203202; 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=yWhhsdkDeaFIuTb/9tB3mwgwsDiB+8l3puInlWZGtSQ=; b=m8jvrtCUbjOPnCI28XSfi26YWvIvyJZnkx+/1GcdQykOxoBxqb40pXDeQ27x3RqnW2 wl2RoU4qzOn14hCxccR8M3bztXJgZ6MKissE8pDYt4PAxkw+n3OtV1JcFOsilWe3xP9v faN0SzCZ/nIPVk+9FOsFvIAOBFqcq9EbPrpL14EirEpQQLbT/GLzYREevFp7KT7vvDOb LH7FllfynhRJNVSTXJqWnc+qnKAgce4DZD16H5P8sDsorQnwMDqZ+/YozCKdNjkLoMcD IdEzBVYee0h6x0D9HvuWhLky1JaSoWsq/zGAAjlYp4M1hJ1/MDtbv/rPr31oqhpKXx2f 5YIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696598402; x=1697203202; 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=yWhhsdkDeaFIuTb/9tB3mwgwsDiB+8l3puInlWZGtSQ=; b=iqIEL1lLd2G1sfAd+EeldrOctUQCoKo63ldUGvW8hkl4CFcibgqDabXVycfbny3w6x oiYWud/cdD694b7ZAgclmrb0GbKPSHypEJYy/0RwgHKxGkWTcaGOxNl2zQQFUUkPw1bt +WrlFPnJCzSCP6uGQJAzKlf6EvXLdRYbN6epa4lQW1FGfAMvIAL07bdThpnSgcqUPXTB oomCRERBhDvmEdjr2BmAezvncN3CnbiWC6ogTy/MjkT6m8fOK9OZuF2Ez+7s2heGjtQv 2577dr8BijV0+hGpY/a4NYSaBWqE+r0Thp+KkoHUs+rihFsWtWfOBqScJx71+BAd/9hN GI5A== X-Gm-Message-State: AOJu0YzIC1FaMTLcjse85IozHRVUGLWejjIg7OWBi7+XVnDlIZlnEydd 8yDtJ15i/vQW/WwNA+6D1/EaJcETwODLyfzGDg0lDA== X-Google-Smtp-Source: AGHT+IH5/weplZezGmoJcHhoaPIICwc9LriXGWyRKURF6QSSKwxyp/q8ZBQzSTxgCq0ZxktPT9OaQQ== X-Received: by 2002:adf:e491:0:b0:320:b2a:4ea6 with SMTP id i17-20020adfe491000000b003200b2a4ea6mr6888820wrm.9.1696598402020; Fri, 06 Oct 2023 06:20:02 -0700 (PDT) Received: from localhost.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id m8-20020a056000180800b00321773bb933sm1639478wrh.77.2023.10.06.06.20.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 06:20:01 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Fri, 6 Oct 2023 14:19:45 +0100 Message-Id: <20231006132000.23504-6-naush@raspberrypi.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231006132000.23504-1-naush@raspberrypi.com> References: <20231006132000.23504-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 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 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;