From patchwork Fri Oct 11 09:22:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 21587 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 A827CC3260 for ; Fri, 11 Oct 2024 09:22:44 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id CF69C65375; Fri, 11 Oct 2024 11:22:40 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Y/+N9dfZ"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 157366536C for ; Fri, 11 Oct 2024 11:22:37 +0200 (CEST) Received: from umang.jain (unknown [IPv6:2405:201:2015:f873:55d7:c02e:b2eb:ee3f]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 7C6CDCDB; Fri, 11 Oct 2024 11:20:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1728638458; bh=xW2uqmk5kvlornICxBmL4hpFoKO9QCloAsflcEgzTVA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y/+N9dfZ6fDpMdtpNoGzvnr1d7cNuKoe6XrM8twaV1IL12Yd8EhQfE14m3T7bh0b0 D95hgPTYSgpKsZpDnFI2q+Jhd1HZzG9wpndTaJHUtHlIk3Mfbj42a1r1JJLeokffQw ae8oHz44ViN0ri1c7UU3KRmpMKQezUH3n8NXdiaY= From: Umang Jain To: libcamera-devel@lists.libcamera.org Cc: Jacopo Mondi , Kieran Bingham , Laurent Pinchart , Stefan Klug , Umang Jain Subject: [PATCH 1/3] libcamera: rkisp1: Use const reference for sensor configuration Date: Fri, 11 Oct 2024 14:52:20 +0530 Message-ID: <20241011092222.537322-2-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241011092222.537322-1-umang.jain@ideasonboard.com> References: <20241011092222.537322-1-umang.jain@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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" User-provided sensor configuration is never meant to be altered, hence pass SensorConfiguration by `const` reference in RkISP1Path::validate(). Signed-off-by: Umang Jain Reviewed-by: Kieran Bingham Reviewed-by: Stefan Klug --- src/libcamera/pipeline/rkisp1/rkisp1_path.cpp | 2 +- src/libcamera/pipeline/rkisp1/rkisp1_path.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp index 1999094e..4a3b779c 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp +++ b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp @@ -253,7 +253,7 @@ RkISP1Path::generateConfiguration(const CameraSensor *sensor, const Size &size, CameraConfiguration::Status RkISP1Path::validate(const CameraSensor *sensor, - std::optional &sensorConfig, + const std::optional &sensorConfig, StreamConfiguration *cfg) { const std::vector &mbusCodes = sensor->mbusCodes(); diff --git a/src/libcamera/pipeline/rkisp1/rkisp1_path.h b/src/libcamera/pipeline/rkisp1/rkisp1_path.h index ce9a5666..8461071f 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1_path.h +++ b/src/libcamera/pipeline/rkisp1/rkisp1_path.h @@ -45,7 +45,7 @@ public: const Size &resolution, StreamRole role); CameraConfiguration::Status validate(const CameraSensor *sensor, - std::optional &sensorConfig, + const std::optional &sensorConfig, StreamConfiguration *cfg); int configure(const StreamConfiguration &config, From patchwork Fri Oct 11 09:22:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 21588 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 2F99BC3260 for ; Fri, 11 Oct 2024 09:22:47 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id CCAD565378; Fri, 11 Oct 2024 11:22:46 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="iTWX0qCH"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A0FF16536C for ; Fri, 11 Oct 2024 11:22:39 +0200 (CEST) Received: from umang.jain (unknown [IPv6:2405:201:2015:f873:55d7:c02e:b2eb:ee3f]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id E29D3220; Fri, 11 Oct 2024 11:20:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1728638460; bh=beO8Ri0fxMAK2tCgCswVJDzfzzcfFrF4dIzLD6cbgAk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iTWX0qCHIxLX8YXjSoNSR6BhycUEFmA2AUQAM5q4Oqw1E8q1riejNBlkEhXQM4NZE QPHII+dghqZ4wyRqQR4mrxMcrV1IANQOYeN6+VtOv/Or1ZqC4lqxLtBovB3G77RpP4 +ZQ0p9Mk8wfdy1PYwcH5XLlp+c7ML7DD1/lOtXgs= From: Umang Jain To: libcamera-devel@lists.libcamera.org Cc: Jacopo Mondi , Kieran Bingham , Laurent Pinchart , Stefan Klug , Umang Jain Subject: [PATCH 2/3] libcamera: rkisp1: Rectify SensorConfiguration check Date: Fri, 11 Oct 2024 14:52:21 +0530 Message-ID: <20241011092222.537322-3-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241011092222.537322-1-umang.jain@ideasonboard.com> References: <20241011092222.537322-1-umang.jain@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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The 'found' flag was mistakenly understood that a compatible sensor format has been found when a sensor configuration is passed in. However, 'found' related to the stream configuration's pixelformat, whether it is supported by the RkISP1Path video node or not. It does not relate to the sensor format, hence the check: if (sensorConfig && !found) doesn't make sense. Rectify the above check with: if (sensorConfig && !rawFormat.isValid()) to ensure a sensor format compatible with sensor configuration has been set to rawFormat. Fixes: 047d647452c4 ("libcamera: rkisp1: Integrate SensorConfiguration support") Signed-off-by: Umang Jain Reviewed-by: Kieran Bingham Reviewed-by: Stefan Klug --- src/libcamera/pipeline/rkisp1/rkisp1_path.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp index 4a3b779c..236d05af 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp +++ b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp @@ -304,7 +304,7 @@ RkISP1Path::validate(const CameraSensor *sensor, } } - if (sensorConfig && !found) + if (sensorConfig && !rawFormat.isValid()) return CameraConfiguration::Invalid; bool isRaw = PixelFormatInfo::info(cfg->pixelFormat).colourEncoding == From patchwork Fri Oct 11 09:22:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 21589 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 837FCC3260 for ; Fri, 11 Oct 2024 09:22:49 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B3B6E6536F; Fri, 11 Oct 2024 11:22:48 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="kKbwzAaR"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E875B6536F for ; Fri, 11 Oct 2024 11:22:39 +0200 (CEST) Received: from umang.jain (unknown [IPv6:2405:201:2015:f873:55d7:c02e:b2eb:ee3f]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 51A42CDB; Fri, 11 Oct 2024 11:21:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1728638461; bh=8dEQVK472YHpbKOagFk135zcldiaSb5wXgO8VjrfJLY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kKbwzAaRQlLC1uvWDipaqlAsvziI6RPhZSOaXsL2Z87Ne5iqoOnjiU4AP1NYweuOl 7Xx2FKOvtB/ichmTGQ2ucGn53Er8cDh+XKKF/CNwMlEkpA0T+ZpqYSINn8Hml3Ue8N hrk7/lsVSv0fexrkYJUD+I4BsRMWRVyCJll5aN1o= From: Umang Jain To: libcamera-devel@lists.libcamera.org Cc: Jacopo Mondi , Kieran Bingham , Laurent Pinchart , Stefan Klug , Umang Jain Subject: [PATCH 3/3] libcamera: rkisp1: Maintain alphabetical order of forward declarations Date: Fri, 11 Oct 2024 14:52:22 +0530 Message-ID: <20241011092222.537322-4-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241011092222.537322-1-umang.jain@ideasonboard.com> References: <20241011092222.537322-1-umang.jain@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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Alphabetical order of Forward declarations should be maintained hence, 'class V4L2Subdevice' should come after 'class SensorConfiguration'. Fix it. Signed-off-by: Umang Jain Reviewed-by: Kieran Bingham Reviewed-by: Stefan Klug --- src/libcamera/pipeline/rkisp1/rkisp1_path.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcamera/pipeline/rkisp1/rkisp1_path.h b/src/libcamera/pipeline/rkisp1/rkisp1_path.h index 8461071f..45be8476 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1_path.h +++ b/src/libcamera/pipeline/rkisp1/rkisp1_path.h @@ -26,8 +26,8 @@ namespace libcamera { class CameraSensor; class MediaDevice; -class V4L2Subdevice; class SensorConfiguration; +class V4L2Subdevice; struct StreamConfiguration; struct V4L2SubdeviceFormat;