From patchwork Wed Oct 21 00:24:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 10150 X-Patchwork-Delegate: laurent.pinchart@ideasonboard.com 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 5F126BDB1F for ; Wed, 21 Oct 2020 00:25:12 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 30AB661DC5; Wed, 21 Oct 2020 02:25:12 +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="NU+Dzrcm"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B940261D92 for ; Wed, 21 Oct 2020 02:25:08 +0200 (CEST) Received: from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 59372555 for ; Wed, 21 Oct 2020 02:25:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1603239908; bh=Kamq1K8iHixKPlkVVwGI0Hk9LT/rvb4X/fWxthYA57E=; h=From:To:Subject:Date:In-Reply-To:References:From; b=NU+Dzrcm5Kmapywm7sJfoVBbYkYIZ4HJMTxOCGQzGAwH92SnQsqI4CzknY0l/KsMx utGliy/dh5LhEgGdRIqs7xl1uCovBXqEsQ8bVP8GCBKn2O3WJQtOuhGI2Q3bmTEnoT j/rLscsafiI6dLYm5fX400/zUcX84G3WSbkHUHOw= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Wed, 21 Oct 2020 03:24:18 +0300 Message-Id: <20201021002418.21764-3-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201021002418.21764-1-laurent.pinchart@ideasonboard.com> References: <20201021002418.21764-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 2/2] libcamera: pipeline: simple: Set format on sink pad during propagation 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" When propagating formats through the media controller pipeline, the simple pipeline handler retrieves the format on sink pads and sets it on source pads. This assumes that subdevs will propagate formats internally, as required by the V4L2 subdev API. However, in some cases, propagation isn't properly handled by the subdev driver. When can work around this issue by setting the format on source pads instead of getting it. This will have the effect of trying to propgate the same format through the pipeline, possibly overriding the default format propagated by subdev drivers. It will however not cause the pipeline configuration to be invalid, as subdevs are required to constraint the format set on their sources based on the configuration of the sources, and this requirement is better implemented in kernel driver than the format propagation requirement. Signed-off-by: Laurent Pinchart Reviewed-by: Jacopo Mondi Reviewed-by: Niklas Söderlund --- src/libcamera/pipeline/simple/simple.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp index 4b6f708e8fee..45ecefc59851 100644 --- a/src/libcamera/pipeline/simple/simple.cpp +++ b/src/libcamera/pipeline/simple/simple.cpp @@ -386,7 +386,7 @@ int SimpleCameraData::setupFormats(V4L2SubdeviceFormat *format, if (source->entity() != sensor_->entity()) { V4L2Subdevice *subdev = pipe->subdev(source->entity()); - ret = subdev->getFormat(source->index(), format, whence); + ret = subdev->setFormat(source->index(), format, whence); if (ret < 0) return ret; }