From patchwork Fri Mar 1 21:21:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 19615 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 82A27BD160 for ; Fri, 1 Mar 2024 21:21:57 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 386B862873; Fri, 1 Mar 2024 22:21:57 +0100 (CET) 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="IKmk01+j"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 3E5EE6295D for ; Fri, 1 Mar 2024 22:21:55 +0100 (CET) Received: from pendragon.ideasonboard.com (89-27-53-110.bb.dnainternet.fi [89.27.53.110]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id CEB153372; Fri, 1 Mar 2024 22:21:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1709328101; bh=ZUpjYlW9wGcZZwE1ZW6TDDGbT2XWigdxfyoyDQwt30E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IKmk01+jSf11ru0RJ/E+OATcu87r3iIx10umthpeOhi56SeiSEpF7hNwGOyl/ypft uZmQafMDFJmYid79bVyyvH4xS+EcrvBNk52LxLBHiTG2w0ZAdn3eV9AoE/eC/JDo9H sqmtZYopUx75IxwqrNbdXYaUhmKv5IJxk2RHcMZM= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Subject: [PATCH/RFC 24/32] pipeline: raspberrypi: common: Configure sensor embedded data Date: Fri, 1 Mar 2024 23:21:13 +0200 Message-ID: <20240301212121.9072-25-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240301212121.9072-1-laurent.pinchart@ideasonboard.com> References: <20240301212121.9072-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 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: , Cc: Sakari Ailus Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Now that the CameraSensor class implements support for embedded data, use the corresponding API to enable or disable the embedded data stream. This changes requires sensor kernel drivers that implement the upstream embedded data API based on V4L2 streams. As the API is under development and not merged in the upstream kernel yet, this breaks compatibility with the downstream Raspberry Pi kernel. Signed-off-by: Laurent Pinchart --- src/libcamera/pipeline/rpi/common/pipeline_base.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp index d662c8f12145..9a2b8b90d5af 100644 --- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp +++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp @@ -527,6 +527,18 @@ int PipelineHandlerBase::configure(Camera *camera, CameraConfiguration *config) if (ret) return ret; + /* + * Configure embedded data on the sensor. Only check for errors when + * enabling embedded data, as some sensors don't support disabling it, + * and Unicam will simply drop the embedded data packets if we don't + * capture them. + */ + ret = data->sensor_->setEmbeddedDataEnabled(data->sensorMetadata_); + if (ret && data->sensorMetadata_) { + LOG(RPI, Error) << "Unable to enable embedded data: " << ret; + return ret; + } + /* * Platform specific internal stream configuration. This also assigns * external streams which get configured below.