From patchwork Sat Mar 18 23:40:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Scally X-Patchwork-Id: 18410 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 E2F8FC3264 for ; Sat, 18 Mar 2023 23:40:37 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D98D8626F5; Sun, 19 Mar 2023 00:40:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1679182834; bh=Pi26qg3X2ZaTtBbo5MzbKdHCyNv/oEf2/r1dRWGGZIg=; 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=pCTNwWWz/DQcQZAI+DHA2xOcy/DxE4LduedMkEoT7JiI3FDZIv3iFi75dhAxvAgSW 8owFXlK2nBjIIsGkzl5ea1hQKo0lplsQwF5NhXLLsXD8N1aSW1WjzQT3L88N1ARPYW aJd5DX+jYluLp2KxCa8P+c6gS1ACjfaf9Cn3kkPrvVmrH8MlFWJB1hKHvasseElHoc B9lS4Zu1IgG2fjn2nYZSlkUQorZcEAsFKHCpcYv/o0jhqkWHkd/MzU03wjBk/0zu+i sfPub8Bk4CrQKiQL1ZjFa4536m1X+/uHLOPiKYXWQdhsq3EurqQOoqVR11qav0vav0 yEk88ERYaa/yw== 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 45008626DB for ; Sun, 19 Mar 2023 00:40:32 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="dRA3lQCr"; dkim-atps=neutral Received: from mail.ideasonboard.com (cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net [86.13.91.161]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id B2DC7DF7; Sun, 19 Mar 2023 00:40:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1679182831; bh=Pi26qg3X2ZaTtBbo5MzbKdHCyNv/oEf2/r1dRWGGZIg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dRA3lQCr7Yy/s34+Ry77JygBA3PwnLmExEA3MOGfLDAh7ttLBaB5ml4GYLiNi+7hJ xYqk51L/WEFh4qRn7V/OMwbFqqJDmKYp+C9ZyURCa771oDeQvIkJD21Dod44mQIn+c AbJ7SYTAybCcPZtQcZ+4Balzhy9D7xwfUx65vpXE= To: libcamera-devel@lists.libcamera.org Date: Sat, 18 Mar 2023 23:40:04 +0000 Message-Id: <20230318234014.29506-2-dan.scally@ideasonboard.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230318234014.29506-1-dan.scally@ideasonboard.com> References: <20230318234014.29506-1-dan.scally@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 01/11] pipeline: ipu3: Check if sensor supports test pattern control 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: Daniel Scally via libcamera-devel From: Dan Scally Reply-To: Daniel Scally Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The IPU3 pipeline calls CameraSensor::setTestPatternMode() in ::start(). That control is not a libcamera mandatory control and so might not be present for a sensor. Check for its presence before trying to set the control to avoid uneccessary failures. Fixes: acf8d028e ("libcamera: pipeline: ipu3: Apply a requested test pattern mode") Signed-off-by: Daniel Scally --- I'll patch this control into the ov7251 driver upstream as the sensor does have a test pattern mode, but still - it's not mandatory! src/libcamera/pipeline/ipu3/ipu3.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index 355cb0cb..d0d55651 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -722,10 +722,14 @@ int PipelineHandlerIPU3::start(Camera *camera, [[maybe_unused]] const ControlLis int ret; /* Disable test pattern mode on the sensor, if any. */ - ret = cio2->sensor()->setTestPatternMode( - controls::draft::TestPatternModeEnum::TestPatternModeOff); - if (ret) - return ret; + const ControlInfoMap &sensorControls = cio2->sensor()->controls(); + + if (sensorControls.find(&controls::draft::TestPatternMode) != sensorControls.end()) { + ret = cio2->sensor()->setTestPatternMode( + controls::draft::TestPatternModeEnum::TestPatternModeOff); + if (ret) + return ret; + } /* Allocate buffers for internal pipeline usage. */ ret = allocateBuffers(camera); From patchwork Sat Mar 18 23:40:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Scally X-Patchwork-Id: 18411 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 69A9ABD80A for ; Sat, 18 Mar 2023 23:40:39 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 6C745626F9; Sun, 19 Mar 2023 00:40:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1679182836; bh=oo8X+cGG9tHHVj4fuR+PKrUebc2UBZtJTY6LkTiyfDc=; 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=TR00Nw3I5I7rGUQaCDvvCpIuN3rYBdtm2oTQTycEdi+zlU2DsBQdRcUtIN0vaCRR+ Vwi7/T3C3lBch8bqc4cOhPQPLj2S7CO7LIFhiAGe/BHM5lGy1A/YAKmlucv7WxPu1l 9k0T/4AP0lUBBVgup5/rbTzJEnFk6xgxtGGul8p1j4WoADqFz/6aLtBqcuuS1kiN8B 9XJACDn0ltdGc+VFYRnzTFIzfT+FxR1yUTruKBnF22w6MwXFNRJzkFe3IFaH4Hlwyg WOYUfhcw3vQZRIoPRDTy4dX0O4Xm35o9JK7tsf+f35wLZGNh3ntU7Z6gI9Kdnm1v5B 5zuusGpcniuSQ== 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 80651626E4 for ; Sun, 19 Mar 2023 00:40:32 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="nXfXHNXK"; dkim-atps=neutral Received: from mail.ideasonboard.com (cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net [86.13.91.161]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 0B45EDFB; Sun, 19 Mar 2023 00:40:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1679182832; bh=oo8X+cGG9tHHVj4fuR+PKrUebc2UBZtJTY6LkTiyfDc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nXfXHNXKqeX5fH5ypWI0+O4KI+Q/QB8O684TaaF+Sho+rdeLZBmDfKJ4Z8IoN2l6w +q1wQYePpX6lP+0MGUayxkN5jfhDqlcgiGzVOWXncNjsM8TmaG9eIpZ6YN/2APn03I lOwlusfmFE/MFeLNEOyeng1Jf9ialQB2wEOKdilk= To: libcamera-devel@lists.libcamera.org Date: Sat, 18 Mar 2023 23:40:05 +0000 Message-Id: <20230318234014.29506-3-dan.scally@ideasonboard.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230318234014.29506-1-dan.scally@ideasonboard.com> References: <20230318234014.29506-1-dan.scally@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 02/11] include: drm_fourcc: Add Y10 format 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: Daniel Scally via libcamera-devel From: Dan Scally Reply-To: Daniel Scally Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Add a FourCC entry for the V4L2_PIX_FMT_Y10 image data format. Signed-off-by: Daniel Scally --- include/linux/drm_fourcc.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/drm_fourcc.h b/include/linux/drm_fourcc.h index 1496e097..b181a534 100644 --- a/include/linux/drm_fourcc.h +++ b/include/linux/drm_fourcc.h @@ -98,6 +98,9 @@ extern "C" { /* Reserve 0 for the invalid format specifier */ #define DRM_FORMAT_INVALID 0 +/* 10 bpp greyscale */ +#define DRM_FORMAT_Y10 fourcc_code('Y', '1', '0', ' ') /* [15:0] Y-only little endian*/ + /* color index */ #define DRM_FORMAT_C8 fourcc_code('C', '8', ' ', ' ') /* [7:0] C */ From patchwork Sat Mar 18 23:40:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Scally X-Patchwork-Id: 18412 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 E6FC2C329C for ; Sat, 18 Mar 2023 23:40:39 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C3DFE626E9; Sun, 19 Mar 2023 00:40:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1679182837; bh=37dnXqw6W2GjXsnIbwOLep9TZNkKb8wAqCTSbsuFSR4=; 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=JvYdfZoNs2C5Q2Cczk+QrsVWhQ9HOoZUE0gDt3Qu/Oz3zrMkXXkWv4ZPwVH+sLq+w iOnzaz3kdXNiYjT3iJ6UiA8Q7Mrd9p/MDri3wvvzVWTR2/oQc1xWkoRjJ0YOn03dcp cQH2g/x86kGLptMXy0/MRVMTPq2rgrSQZS8sAldpYnjb/gj7SEbBHlKoTMxWfUhZsi UxDQ1ANuqPYd2QkqeWnnqXUZpWnWXQ0kjty0+8AGL13dEyPxxHBcOMU5w/CaBaSH4c k/sFd0TpRA2Eeuw+Y8wdCNx9N3EaxIpW9Lopdkrf/zhS6kk5VHEPsvI40p6GYWbQVP rTEvWsX5FsQYA== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C4B87626E7 for ; Sun, 19 Mar 2023 00:40:32 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="CtB8sZ67"; dkim-atps=neutral Received: from mail.ideasonboard.com (cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net [86.13.91.161]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 62AA8B6C; Sun, 19 Mar 2023 00:40:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1679182832; bh=37dnXqw6W2GjXsnIbwOLep9TZNkKb8wAqCTSbsuFSR4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CtB8sZ67Il6MJgfU2jQTdGPIZ001d6x7HcgN5Kn2l2bQqYNDbcKJ8bic3WA3J/gdx +59S/VAK7iR1kMbgbJ7QonqoPKx8nNpry3rPm3ZqX16lHm/v+Vh2pC8+4w3uewHhn9 WpuZ4BNYuUdNCKGlrKIgJjUUHlaPNxzcspO+v6Tw= To: libcamera-devel@lists.libcamera.org Date: Sat, 18 Mar 2023 23:40:06 +0000 Message-Id: <20230318234014.29506-4-dan.scally@ideasonboard.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230318234014.29506-1-dan.scally@ideasonboard.com> References: <20230318234014.29506-1-dan.scally@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 03/11] libcamera/formats: Add IPU3_Y10 format 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: Daniel Scally via libcamera-devel From: Dan Scally Reply-To: Daniel Scally Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Add entries to libcamera's pixelFormatInfo map describing the IPU3_Y10 format which is exposed by the CIO2 device when connected to certain camera sensors, such as the OmniVision 7251 IR Camera. Signed-off-by: Daniel Scally --- src/libcamera/formats.cpp | 10 ++++++++++ src/libcamera/formats.yaml | 3 +++ 2 files changed, 13 insertions(+) diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp index f5769c48..eda657c5 100644 --- a/src/libcamera/formats.cpp +++ b/src/libcamera/formats.cpp @@ -517,6 +517,16 @@ const std::map pixelFormatInfo{ .pixelsPerGroup = 4, .planes = {{ { 5, 1 }, { 0, 0 }, { 0, 0 } }}, } }, + { formats::Y10_IPU3, { + .name = "Y10_IPU3", + .format = formats::Y10_IPU3, + .v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_IPU3_Y10), }, + .bitsPerPixel = 10, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + .packed = true, + .pixelsPerGroup = 25, + .planes = {{ { 32, 1 }, { 0, 0 }, { 0, 0 } }}, + } }, /* Bayer formats. */ { formats::SBGGR8, { diff --git a/src/libcamera/formats.yaml b/src/libcamera/formats.yaml index e586cde1..36d3016d 100644 --- a/src/libcamera/formats.yaml +++ b/src/libcamera/formats.yaml @@ -161,4 +161,7 @@ formats: - SBGGR10_IPU3: fourcc: DRM_FORMAT_SBGGR10 mod: IPU3_FORMAT_MOD_PACKED + - Y10_IPU3: + fourcc: DRM_FORMAT_Y10 + mod: IPU3_FORMAT_MOD_PACKED ... From patchwork Sat Mar 18 23:40:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Scally X-Patchwork-Id: 18413 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 31F90C329D for ; Sat, 18 Mar 2023 23:40:40 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 440A662704; Sun, 19 Mar 2023 00:40:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1679182838; bh=mg3vg7yK637j32aLnAVSbE70YKXnTFJtwb5a4rprn7k=; 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=Tn5LVuLP4D4pvNNg67wTWfy0IhhU2A5/d5FO2UP9qwJdnDNGV6MA0yg1T5G4a5k+d x9kAIjgXkrUYvEm1RE3GrYz+Yps5VVGbzZEwcXoQsOdddvCBlidLwGb0eH0W3He7Lk D08EzDswVs5reHHdRxXoXCUDsc37wjsVoZY4L/cOZMPZ4CUOpfIYxTPmZKT8mXV+Bk HUV6lAf0F9n+FLqiZ5trYV+9bgk0anHTOjvQsnDN3cmzHh3bSznfqqtElrFEfHSN+H kDg3ZgVM6VsQ5wYE3UopN8HzM01uMbnve/M6ZqTAbwH1VtSue0SZkDAuLNZS0nnrCO lEB204yYhDjrw== 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 153F8626E9 for ; Sun, 19 Mar 2023 00:40:33 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Pgq8SAg6"; dkim-atps=neutral Received: from mail.ideasonboard.com (cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net [86.13.91.161]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id ADD7FDF7; Sun, 19 Mar 2023 00:40:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1679182832; bh=mg3vg7yK637j32aLnAVSbE70YKXnTFJtwb5a4rprn7k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Pgq8SAg6pUzcOdrHUaW2uqMW+jXdMONgcvdOTlYnKX5gl3dtklv7g/r40y3ya2Q9s QGrCjKoz/Mj7WUVPtfTGDYogGQt0Oke7lOVGgHtZulLUSX2ahLzinSp3Xx7e/Vnd1t voW4F+6Szfa1KhqOF3o0bW40U2CrCZjXH6wRTjBQ= To: libcamera-devel@lists.libcamera.org Date: Sat, 18 Mar 2023 23:40:07 +0000 Message-Id: <20230318234014.29506-5-dan.scally@ideasonboard.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230318234014.29506-1-dan.scally@ideasonboard.com> References: <20230318234014.29506-1-dan.scally@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 04/11] pipeline: ipu3: Identify sensors that do not need the Imgu 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: Daniel Scally via libcamera-devel From: Dan Scally Reply-To: Daniel Scally Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Some sensors connected to the CIO2 device do not need to be connected to the Imgu - for example the OmniVision 7251 outputs Y10 data which needn't be debayered and which is unsupported by the kernel's ipu3-imgu driver. To be able to handle those sensors we need to be able to skip the Imgu related parts of the processing in the IPU3 pipeline. As a preliminary step, check whether the sensor needs the Imgu during CIO2Device::init() and provide a method to check that later. Signed-off-by: Daniel Scally --- src/libcamera/pipeline/ipu3/cio2.cpp | 20 ++++++++++++++++++++ src/libcamera/pipeline/ipu3/cio2.h | 4 ++++ 2 files changed, 24 insertions(+) diff --git a/src/libcamera/pipeline/ipu3/cio2.cpp b/src/libcamera/pipeline/ipu3/cio2.cpp index 7400cb0b..d100df57 100644 --- a/src/libcamera/pipeline/ipu3/cio2.cpp +++ b/src/libcamera/pipeline/ipu3/cio2.cpp @@ -17,6 +17,7 @@ #include #include +#include "libcamera/internal/bayer_format.h" #include "libcamera/internal/camera_sensor.h" #include "libcamera/internal/framebuffer.h" #include "libcamera/internal/media_device.h" @@ -160,6 +161,25 @@ int CIO2Device::init(const MediaDevice *media, unsigned int index) return -EINVAL; } + /* + * A camera sensor connected to the CIO2 device need not necessarily be + * connected to the Imgu. This is the case for some IR cameras for + * example, which output IPU3-packed Y10 data rather than packed data in + * bayer patterns. In the case of those sensors we need to be able to + * skip dealing with the Imgu during the pipeline, so we need to be able + * to identify them. + * + * Check whether this sensor needs to be connected to the Imgu. + */ + needsImgu_ = false; + for (unsigned int mbusCode : sensorCodes) { + const BayerFormat &bayerFormat = BayerFormat::fromMbusCode(mbusCode); + if (bayerFormat.isValid() && bayerFormat.order < BayerFormat::MONO) { + needsImgu_ = true; + break; + } + } + /* * \todo Define when to open and close video device nodes, as they * might impact on power consumption. diff --git a/src/libcamera/pipeline/ipu3/cio2.h b/src/libcamera/pipeline/ipu3/cio2.h index bbd87eb8..064673d9 100644 --- a/src/libcamera/pipeline/ipu3/cio2.h +++ b/src/libcamera/pipeline/ipu3/cio2.h @@ -63,6 +63,8 @@ public: Signal<> bufferAvailable; + bool needsImgu() { return needsImgu_; } + private: void freeBuffers(); @@ -74,6 +76,8 @@ private: std::vector> buffers_; std::queue availableBuffers_; + + bool needsImgu_; }; } /* namespace libcamera */ From patchwork Sat Mar 18 23:40:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Scally X-Patchwork-Id: 18414 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 83261C329E for ; Sat, 18 Mar 2023 23:40:40 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C5D89626FC; Sun, 19 Mar 2023 00:40:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1679182838; bh=ou8m4oAvy23Fg+JQdD6YTRdMNnldKcSO4Jo/9JkQvJw=; 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=gMZkxFYLIXq7c3mE3mcHI/X7oWDTcQ2BfQyHPKNStGsMvUH8MYn+hvqRYJ/9GDg1K 2G1DWEGJZ3cMJEcgQNh9ax5tUfDei6D2aloVhQw9BAxW71vvXA10jh7ARnzQ8HEY4B xxt3Bj2UGmd33caDJQTqo2qZ1yb9ak1qM+5qtHhQLiYYQ1Au7OGwh/0gjj9Bw6JBP8 f2a0d0BdpTVzq6+YjGsGq08WfG7++RIRct7P5wReCwK9VUWLdhrCZDvnpyv5U5V2s3 lDCASLaAd5Szqy/V5TyQd9xcctKwOKVKkotv+ba4w4cT0v6aaqqrwuPXPxRvWOAsG2 jreZah79KCEgg== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 68E69626EC for ; Sun, 19 Mar 2023 00:40:33 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="kRl3g7s8"; dkim-atps=neutral Received: from mail.ideasonboard.com (cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net [86.13.91.161]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 04F28B6C; Sun, 19 Mar 2023 00:40:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1679182833; bh=ou8m4oAvy23Fg+JQdD6YTRdMNnldKcSO4Jo/9JkQvJw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kRl3g7s8c8cORarYmGPiTIa68Ntd+VtUWgVu3CCDYuQp4Wvr41R/EIUzjXiA4Zogn jWzev7w8sizGTh1KlMWc4+Gh2TOazKROAUgV2mkKsY7U5ncoz2aWu2kD5vzlZDFAsH /xDY3AgF/oQMES/mn8vuzbQtMLK9o385VgrLTGTk= To: libcamera-devel@lists.libcamera.org Date: Sat, 18 Mar 2023 23:40:08 +0000 Message-Id: <20230318234014.29506-6-dan.scally@ideasonboard.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230318234014.29506-1-dan.scally@ideasonboard.com> References: <20230318234014.29506-1-dan.scally@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 05/11] pipeline: ipu3: Add needsImgu flag to IPU3Frames 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: Daniel Scally via libcamera-devel From: Dan Scally Reply-To: Daniel Scally Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Some sensors using the IPU3 pipeline do not transfer data to the Imgu, so we need the ability to disable the related processing from this class. Add a boolean flag denoting whether or not to run the Imgu related processing. For now, hard code this to true in IPU3CameraData::queuePendingRequests(). Signed-off-by: Daniel Scally --- src/libcamera/pipeline/ipu3/frames.cpp | 45 +++++++++++++++----------- src/libcamera/pipeline/ipu3/frames.h | 3 +- src/libcamera/pipeline/ipu3/ipu3.cpp | 2 +- 3 files changed, 29 insertions(+), 21 deletions(-) diff --git a/src/libcamera/pipeline/ipu3/frames.cpp b/src/libcamera/pipeline/ipu3/frames.cpp index a4c3477c..55b90e9d 100644 --- a/src/libcamera/pipeline/ipu3/frames.cpp +++ b/src/libcamera/pipeline/ipu3/frames.cpp @@ -40,28 +40,32 @@ void IPU3Frames::clear() availableStatBuffers_ = {}; } -IPU3Frames::Info *IPU3Frames::create(Request *request) +IPU3Frames::Info *IPU3Frames::create(Request *request, bool needsImgu) { unsigned int id = request->sequence(); + FrameBuffer *paramBuffer = nullptr; + FrameBuffer *statBuffer = nullptr; - if (availableParamBuffers_.empty()) { - LOG(IPU3, Debug) << "Parameters buffer underrun"; - return nullptr; - } + if (needsImgu) { + if (availableParamBuffers_.empty()) { + LOG(IPU3, Debug) << "Parameters buffer underrun"; + return nullptr; + } - if (availableStatBuffers_.empty()) { - LOG(IPU3, Debug) << "Statistics buffer underrun"; - return nullptr; - } + if (availableStatBuffers_.empty()) { + LOG(IPU3, Debug) << "Statistics buffer underrun"; + return nullptr; + } - FrameBuffer *paramBuffer = availableParamBuffers_.front(); - FrameBuffer *statBuffer = availableStatBuffers_.front(); + paramBuffer = availableParamBuffers_.front(); + statBuffer = availableStatBuffers_.front(); - paramBuffer->_d()->setRequest(request); - statBuffer->_d()->setRequest(request); + paramBuffer->_d()->setRequest(request); + statBuffer->_d()->setRequest(request); - availableParamBuffers_.pop(); - availableStatBuffers_.pop(); + availableParamBuffers_.pop(); + availableStatBuffers_.pop(); + } /* \todo Remove the dynamic allocation of Info */ std::unique_ptr info = std::make_unique(); @@ -73,6 +77,7 @@ IPU3Frames::Info *IPU3Frames::create(Request *request) info->statBuffer = statBuffer; info->paramDequeued = false; info->metadataProcessed = false; + info->needsImgu = needsImgu; frameInfo_[id] = std::move(info); @@ -96,11 +101,13 @@ bool IPU3Frames::tryComplete(IPU3Frames::Info *info) if (request->hasPendingBuffers()) return false; - if (!info->metadataProcessed) - return false; + if (info->needsImgu) { + if (!info->metadataProcessed) + return false; - if (!info->paramDequeued) - return false; + if (!info->paramDequeued) + return false; + } remove(info); diff --git a/src/libcamera/pipeline/ipu3/frames.h b/src/libcamera/pipeline/ipu3/frames.h index 6e3cb915..d58fd998 100644 --- a/src/libcamera/pipeline/ipu3/frames.h +++ b/src/libcamera/pipeline/ipu3/frames.h @@ -40,6 +40,7 @@ public: bool paramDequeued; bool metadataProcessed; + bool needsImgu; }; IPU3Frames(); @@ -48,7 +49,7 @@ public: const std::vector> &statBuffers); void clear(); - Info *create(Request *request); + Info *create(Request *request, bool needsImgu); void remove(Info *info); bool tryComplete(Info *info); diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index d0d55651..3077c6bb 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -806,7 +806,7 @@ void IPU3CameraData::queuePendingRequests() while (!pendingRequests_.empty()) { Request *request = pendingRequests_.front(); - IPU3Frames::Info *info = frameInfos_.create(request); + IPU3Frames::Info *info = frameInfos_.create(request, true); if (!info) break; From patchwork Sat Mar 18 23:40:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Scally X-Patchwork-Id: 18415 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 B854CC329F for ; Sat, 18 Mar 2023 23:40:40 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 506B262742; Sun, 19 Mar 2023 00:40:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1679182839; bh=qGIT2CBv0+7CHNkyZokcI9Z9R0gjeu37xWvNHSRIRXQ=; 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=bPSuoyjNiJaESwvTlLm4Sowb8euT+yK/CIVA8cjS0VKHjpul6DYYt+DMv6FwL/Zmm vHTMgvJLpqthpteonPNRpWAcoWwlQ+FVSrXTd/g8/LrN5P0EkQHdq40llu456Z0gop f7LKzvBYsIIkYBYczENUG2Z1eRaSt8nMXeE3IqgqI4laoYlq69LZVpChnKIpwcdwIy 1efwqKzfhSyV44OhKqPW/JmZZKTs1zPPRSJSqLXnVKDSROUsQ/MHQFHi1A3HdwZ1z7 qssn6u1en3GblmzhaI/+tQDpL4W6ETStpxaQlINVW234bJRFNc/Rz9pNRvB1mztyGP pHrhQO6Byheng== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B730C626EC for ; Sun, 19 Mar 2023 00:40:33 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="F/5tjym8"; dkim-atps=neutral Received: from mail.ideasonboard.com (cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net [86.13.91.161]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 53832DF7; Sun, 19 Mar 2023 00:40:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1679182833; bh=qGIT2CBv0+7CHNkyZokcI9Z9R0gjeu37xWvNHSRIRXQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F/5tjym8zV8rrhVMN2cOWvEoKTlh5Itu2x/PHnQiR/mkQ6GLgZ1nlYTXViqDYa6uR nJsNMwEWoRfLhy6RS39JHUtaOWh/OEBYKmbolAdMrvaoXUl+ybVG7HVCkCurvQz1Sm tBXN4MTKBMNOMoPu7rtRPj7LRXqhJdadY51u9RrU= To: libcamera-devel@lists.libcamera.org Date: Sat, 18 Mar 2023 23:40:09 +0000 Message-Id: <20230318234014.29506-7-dan.scally@ideasonboard.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230318234014.29506-1-dan.scally@ideasonboard.com> References: <20230318234014.29506-1-dan.scally@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 06/11] pipeline: ipu3: Support sensors using only CIO2 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: Daniel Scally via libcamera-devel From: Dan Scally Reply-To: Daniel Scally Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Some sensors that need to be supported by the IPU3 pipeline are not supported by the Imgu's kernel driver, but can be used by simply treating the CIO2's capture device as the source of image data. In that case much of the processing in the IPU3 pipeline needs to be disabled. Guard it behind checks that query the CIO2Device::needsImgu field. Signed-off-by: Daniel Scally --- src/libcamera/pipeline/ipu3/ipu3.cpp | 214 +++++++++++++++------------ 1 file changed, 118 insertions(+), 96 deletions(-) diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index 3077c6bb..cc7da299 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -489,6 +489,34 @@ int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c) V4L2DeviceFormat outputFormat; int ret; + /* + * Pass the requested stream size to the CIO2 unit and get back the + * adjusted format to be propagated to the ImgU output devices. + */ + const Size &sensorSize = config->cio2Format().size; + V4L2DeviceFormat cio2Format; + ret = cio2->configure(sensorSize, config->combinedTransform_, &cio2Format); + if (ret) + return ret; + + IPACameraSensorInfo sensorInfo; + cio2->sensor()->sensorInfo(&sensorInfo); + data->cropRegion_ = sensorInfo.analogCrop; + + /* + * If the ImgU gets configured, its driver seems to expect that + * buffers will be queued to its outputs, as otherwise the next + * capture session that uses the ImgU fails when queueing + * buffers to its input. + * + * If no ImgU configuration has been computed, it means only a RAW + * stream has been requested: return here to skip the ImgU configuration + * part. + */ + ImgUDevice::PipeConfig imguConfig = config->imguConfig(); + if (imguConfig.isNull()) + return 0; + /* * FIXME: enabled links in one ImgU pipe interfere with capture * operations on the other one. This can be easily triggered by @@ -531,34 +559,6 @@ int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c) if (ret) return ret; - /* - * Pass the requested stream size to the CIO2 unit and get back the - * adjusted format to be propagated to the ImgU output devices. - */ - const Size &sensorSize = config->cio2Format().size; - V4L2DeviceFormat cio2Format; - ret = cio2->configure(sensorSize, config->combinedTransform_, &cio2Format); - if (ret) - return ret; - - IPACameraSensorInfo sensorInfo; - cio2->sensor()->sensorInfo(&sensorInfo); - data->cropRegion_ = sensorInfo.analogCrop; - - /* - * If the ImgU gets configured, its driver seems to expect that - * buffers will be queued to its outputs, as otherwise the next - * capture session that uses the ImgU fails when queueing - * buffers to its input. - * - * If no ImgU configuration has been computed, it means only a RAW - * stream has been requested: return here to skip the ImgU configuration - * part. - */ - ImgUDevice::PipeConfig imguConfig = config->imguConfig(); - if (imguConfig.isNull()) - return 0; - ret = imgu->configure(imguConfig, &cio2Format); if (ret) return ret; @@ -660,36 +660,39 @@ int PipelineHandlerIPU3::exportFrameBuffers(Camera *camera, Stream *stream, int PipelineHandlerIPU3::allocateBuffers(Camera *camera) { IPU3CameraData *data = cameraData(camera); + CIO2Device *cio2 = &data->cio2_; ImgUDevice *imgu = data->imgu_; unsigned int bufferCount; int ret; - bufferCount = std::max({ - data->outStream_.configuration().bufferCount, - data->vfStream_.configuration().bufferCount, - data->rawStream_.configuration().bufferCount, - }); + if (cio2->needsImgu()) { + bufferCount = std::max({ + data->outStream_.configuration().bufferCount, + data->vfStream_.configuration().bufferCount, + data->rawStream_.configuration().bufferCount, + }); - ret = imgu->allocateBuffers(bufferCount); - if (ret < 0) - return ret; + ret = imgu->allocateBuffers(bufferCount); + if (ret < 0) + return ret; - /* Map buffers to the IPA. */ - unsigned int ipaBufferId = 1; + /* Map buffers to the IPA. */ + unsigned int ipaBufferId = 1; - for (const std::unique_ptr &buffer : imgu->paramBuffers_) { - buffer->setCookie(ipaBufferId++); - ipaBuffers_.emplace_back(buffer->cookie(), buffer->planes()); - } + for (const std::unique_ptr &buffer : imgu->paramBuffers_) { + buffer->setCookie(ipaBufferId++); + ipaBuffers_.emplace_back(buffer->cookie(), buffer->planes()); + } - for (const std::unique_ptr &buffer : imgu->statBuffers_) { - buffer->setCookie(ipaBufferId++); - ipaBuffers_.emplace_back(buffer->cookie(), buffer->planes()); - } + for (const std::unique_ptr &buffer : imgu->statBuffers_) { + buffer->setCookie(ipaBufferId++); + ipaBuffers_.emplace_back(buffer->cookie(), buffer->planes()); + } - data->ipa_->mapBuffers(ipaBuffers_); + data->ipa_->mapBuffers(ipaBuffers_); + data->frameInfos_.init(imgu->paramBuffers_, imgu->statBuffers_); + } - data->frameInfos_.init(imgu->paramBuffers_, imgu->statBuffers_); data->frameInfos_.bufferAvailable.connect( data, &IPU3CameraData::queuePendingRequests); @@ -699,17 +702,20 @@ int PipelineHandlerIPU3::allocateBuffers(Camera *camera) int PipelineHandlerIPU3::freeBuffers(Camera *camera) { IPU3CameraData *data = cameraData(camera); + CIO2Device *cio2 = &data->cio2_; data->frameInfos_.clear(); - std::vector ids; - for (IPABuffer &ipabuf : ipaBuffers_) - ids.push_back(ipabuf.id); + if (cio2->needsImgu()) { + std::vector ids; + for (IPABuffer &ipabuf : ipaBuffers_) + ids.push_back(ipabuf.id); - data->ipa_->unmapBuffers(ids); - ipaBuffers_.clear(); + data->ipa_->unmapBuffers(ids); + data->imgu_->freeBuffers(); - data->imgu_->freeBuffers(); + ipaBuffers_.clear(); + } return 0; } @@ -736,10 +742,6 @@ int PipelineHandlerIPU3::start(Camera *camera, [[maybe_unused]] const ControlLis if (ret) return ret; - ret = data->ipa_->start(); - if (ret) - goto error; - data->delayedCtrls_->reset(); /* @@ -750,16 +752,24 @@ int PipelineHandlerIPU3::start(Camera *camera, [[maybe_unused]] const ControlLis if (ret) goto error; - ret = imgu->start(); - if (ret) - goto error; + if (cio2->needsImgu()) { + ret = data->ipa_->start(); + if (ret) + goto error; + + ret = imgu->start(); + if (ret) + goto error; + } return 0; error: - imgu->stop(); cio2->stop(); - data->ipa_->stop(); + if (cio2->needsImgu()) { + imgu->stop(); + data->ipa_->stop(); + } freeBuffers(camera); LOG(IPU3, Error) << "Failed to start camera " << camera->id(); @@ -773,9 +783,11 @@ void PipelineHandlerIPU3::stopDevice(Camera *camera) data->cancelPendingRequests(); - data->ipa_->stop(); + if (data->cio2_.needsImgu()) { + data->ipa_->stop(); + ret |= data->imgu_->stop(); + } - ret |= data->imgu_->stop(); ret |= data->cio2_.stop(); if (ret) LOG(IPU3, Warning) << "Failed to stop camera " << camera->id(); @@ -806,7 +818,7 @@ void IPU3CameraData::queuePendingRequests() while (!pendingRequests_.empty()) { Request *request = pendingRequests_.front(); - IPU3Frames::Info *info = frameInfos_.create(request, true); + IPU3Frames::Info *info = frameInfos_.create(request, cio2_.needsImgu()); if (!info) break; @@ -829,7 +841,8 @@ void IPU3CameraData::queuePendingRequests() info->rawBuffer = rawBuffer; - ipa_->queueRequest(info->id, request->controls()); + if (cio2_.needsImgu()) + ipa_->queueRequest(info->id, request->controls()); pendingRequests_.pop(); processingRequests_.push(request); @@ -1070,10 +1083,6 @@ int PipelineHandlerIPU3::registerCameras() if (ret) continue; - ret = data->loadIPA(); - if (ret) - continue; - /* Initialize the camera properties. */ data->properties_ = cio2->sensor()->properties(); @@ -1104,36 +1113,44 @@ int PipelineHandlerIPU3::registerCameras() << cio2->sensor()->id() << ". Assume rotation 0"; - /** - * \todo Dynamically assign ImgU and output devices to each - * stream and camera; as of now, limit support to two cameras - * only, and assign imgu0 to the first one and imgu1 to the - * second. - */ - data->imgu_ = numCameras ? &imgu1_ : &imgu0_; - /* * Connect video devices' 'bufferReady' signals to their * slot to implement the image processing pipeline. - * - * Frames produced by the CIO2 unit are passed to the - * associated ImgU input where they get processed and - * returned through the ImgU main and secondary outputs. */ data->cio2_.bufferReady().connect(data.get(), - &IPU3CameraData::cio2BufferReady); + &IPU3CameraData::cio2BufferReady); data->cio2_.bufferAvailable.connect( data.get(), &IPU3CameraData::queuePendingRequests); - data->imgu_->input_->bufferReady.connect(&data->cio2_, - &CIO2Device::tryReturnBuffer); - data->imgu_->output_->bufferReady.connect(data.get(), - &IPU3CameraData::imguOutputBufferReady); - data->imgu_->viewfinder_->bufferReady.connect(data.get(), - &IPU3CameraData::imguOutputBufferReady); - data->imgu_->param_->bufferReady.connect(data.get(), - &IPU3CameraData::paramBufferReady); - data->imgu_->stat_->bufferReady.connect(data.get(), - &IPU3CameraData::statBufferReady); + + if (cio2->needsImgu()) { + ret = data->loadIPA(); + if (ret) + continue; + + /** + * \todo Dynamically assign ImgU and output devices to each + * stream and camera; as of now, limit support to two cameras + * only, and assign imgu0 to the first one and imgu1 to the + * second. + */ + data->imgu_ = numCameras ? &imgu1_ : &imgu0_; + + /* + * Frames produced by the CIO2 unit are passed to the + * associated ImgU input where they get processed and + * returned through the ImgU main and secondary outputs. + */ + data->imgu_->input_->bufferReady.connect(&data->cio2_, + &CIO2Device::tryReturnBuffer); + data->imgu_->output_->bufferReady.connect(data.get(), + &IPU3CameraData::imguOutputBufferReady); + data->imgu_->viewfinder_->bufferReady.connect(data.get(), + &IPU3CameraData::imguOutputBufferReady); + data->imgu_->param_->bufferReady.connect(data.get(), + &IPU3CameraData::paramBufferReady); + data->imgu_->stat_->bufferReady.connect(data.get(), + &IPU3CameraData::statBufferReady); + } /* Create and register the Camera instance. */ const std::string &cameraId = cio2->sensor()->id(); @@ -1330,10 +1347,15 @@ void IPU3CameraData::cio2BufferReady(FrameBuffer *buffer) info->effectiveSensorControls = delayedCtrls_->get(buffer->metadata().sequence); - if (request->findBuffer(&rawStream_)) + if (request->findBuffer(&rawStream_)) { pipe()->completeBuffer(request, buffer); - ipa_->fillParamsBuffer(info->id, info->paramBuffer->cookie()); + if (frameInfos_.tryComplete(info)) + pipe()->completeRequest(request); + } + + if (cio2_.needsImgu()) + ipa_->fillParamsBuffer(info->id, info->paramBuffer->cookie()); } void IPU3CameraData::paramBufferReady(FrameBuffer *buffer) From patchwork Sat Mar 18 23:40:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Scally X-Patchwork-Id: 18416 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 E4A28C32A0 for ; Sat, 18 Mar 2023 23:40:40 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C5EEC62749; Sun, 19 Mar 2023 00:40:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1679182839; bh=TOB8NzOJQZVy9wXQwy2irZUghPdzOZyRJ0vbM+Gp+m8=; 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=PIsKPHzBimUAiqvd0ccbmvYD8FXpZqVeVT/MJNnBKMCr2IRT8hVZxQ2bp6OBOcA1u e3F06QPTBnYUp+wagOrXkMwMMtvKSrJIwcu7iKBqdQxgRGHZLDnxK98dYjJx+dH5mC k/cM8tbAh1ReegIe2vCy368Lh8Q93e/xvuiU8SanXQbmf4NRaJ+P3GZIRejhUbvST/ oVUr2m1EP2sLLri+PqJ/ubO/VkLo8Sx9uNDOOiDjIk6t62jsNkwVIfDe6FI375OwHA MHCt00STYUYNLU/iyGi8gyeaYdwb1X4Qej//J941JnWNB5NiWfN50bVgbSUIoscaoD w54Ady6U5rq8A== 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 0ABE4626F0 for ; Sun, 19 Mar 2023 00:40:34 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="m1KoJGm9"; dkim-atps=neutral Received: from mail.ideasonboard.com (cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net [86.13.91.161]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id A2241B6C; Sun, 19 Mar 2023 00:40:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1679182833; bh=TOB8NzOJQZVy9wXQwy2irZUghPdzOZyRJ0vbM+Gp+m8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m1KoJGm9WI3+Jdqhg8wGu8kc0vtLzmcoOPFOZxm1f0+8W2bA+VNU7aHp67JKGO2yA hd1bC0eAGMsyRZldUNibdDLvVsb5RWN6TJq4Kk7upceoXhtTKk3wJKWhqfRBHeI77y LFBcEJCOtH8Jr+hMqxZAxJH9veLoD2/AYCKHpYTA= To: libcamera-devel@lists.libcamera.org Date: Sat, 18 Mar 2023 23:40:10 +0000 Message-Id: <20230318234014.29506-8-dan.scally@ideasonboard.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230318234014.29506-1-dan.scally@ideasonboard.com> References: <20230318234014.29506-1-dan.scally@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 07/11] pipeline: ipu3: Allow raw-only streams in IPU3 pipeline 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: Daniel Scally via libcamera-devel From: Dan Scally Reply-To: Daniel Scally Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Sensors not connected to the Imgu produce raw-only streams. Allow that configuration to proceed in the IPU3 pipeline, but warn about the lack of sensor controls for other sensors. Signed-off-by: Daniel Scally --- src/libcamera/pipeline/ipu3/ipu3.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index cc7da299..b9228a59 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -232,18 +232,18 @@ CameraConfiguration::Status IPU3CameraConfiguration::validate() return Invalid; } else if (rawCount && !yuvCount) { /* - * Disallow raw-only camera configuration. Currently, ImgU does - * not get configured for raw-only streams and has early return - * in configure(). To support raw-only stream, we do need the IPA - * to get configured since it will setup the sensor controls for - * the capture. + * Currently, ImgU does not get configured for raw-only streams + * and has early return in configure(). To support raw-only stream, + * we do need the IPA to get configured since it will setup the + * sensor controls for the capture. As some sensors _only_ output + * raw streams though we need to allow the configuration to + * continue here. * * \todo Configure the ImgU with internal buffers which will enable * the IPA to get configured for the raw-only camera configuration. */ LOG(IPU3, Debug) - << "Camera configuration cannot support raw-only streams"; - return Invalid; + << "Sensor controls not supported for raw-only stream"; } /* From patchwork Sat Mar 18 23:40:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Scally X-Patchwork-Id: 18417 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 54780C32A1 for ; Sat, 18 Mar 2023 23:40:41 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 6CCD562750; Sun, 19 Mar 2023 00:40:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1679182840; bh=ZcmnUqsaLS21mmmDY3aDXsWohFTWidfx4B4UM87Qy6g=; 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=T5VW67T8CuDy1F5bp68f4vDA2OW/xxCG5JRabji5Pph2/xN0FoEgb2rDJmsvK0EV+ iGHKz5u/Dt/m36soVj70mUZ4wZ+MVPdypWbB55shUuKJHYRsvAmBY+EZc/XMKwLVu4 XYMb0EgsDKvFE+1nZVGXukMDHA5hryUr6rnUVqE9t662HG1c17yK13CvFX2zRblWQf ZPFbVEWnzjGX2Gd6ANWwVTUecHbpDoZt337tR692mxiKOGBUK7sC19RGbZWwzRQvEp AxO/K/lfR/oByfbcO04tAq5rozW2mdjD7CvsNGZreCRatvE2WRUY8dbcHI0aB7ie8L FEQEwW11qWYDw== 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 5EE65626F1 for ; Sun, 19 Mar 2023 00:40:34 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="fArzacrB"; dkim-atps=neutral Received: from mail.ideasonboard.com (cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net [86.13.91.161]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id EC58ADF7; Sun, 19 Mar 2023 00:40:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1679182834; bh=ZcmnUqsaLS21mmmDY3aDXsWohFTWidfx4B4UM87Qy6g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fArzacrBdaVegHaFm82UqdYdH+mSIRwGccj3cpXxz9f5XkTuA7Z2/mWnia+m1gTCH JXhI1d68P80COfLQlN43DfycPNeHk3oenvH7qsv85isjxfhnGhzQ3vCE3Io/DbEkfb RcqyqLUQMloD0ayD+eWCAn6d4Bq2OYXYUJWUtWZQ= To: libcamera-devel@lists.libcamera.org Date: Sat, 18 Mar 2023 23:40:11 +0000 Message-Id: <20230318234014.29506-9-dan.scally@ideasonboard.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230318234014.29506-1-dan.scally@ideasonboard.com> References: <20230318234014.29506-1-dan.scally@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 08/11] pipeline: ipu3: Support IPU3_Y10 format 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: Daniel Scally via libcamera-devel From: Dan Scally Reply-To: Daniel Scally Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Add support for the IPU3_Y10 format to the IPU3 pipeline. Signed-off-by: Daniel Scally Reviewed-by: Laurent Pinchart --- src/libcamera/pipeline/ipu3/cio2.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libcamera/pipeline/ipu3/cio2.cpp b/src/libcamera/pipeline/ipu3/cio2.cpp index d100df57..d619afe2 100644 --- a/src/libcamera/pipeline/ipu3/cio2.cpp +++ b/src/libcamera/pipeline/ipu3/cio2.cpp @@ -34,6 +34,7 @@ const std::map mbusCodesToPixelFormat = { { MEDIA_BUS_FMT_SGBRG10_1X10, formats::SGBRG10_IPU3 }, { MEDIA_BUS_FMT_SGRBG10_1X10, formats::SGRBG10_IPU3 }, { MEDIA_BUS_FMT_SRGGB10_1X10, formats::SRGGB10_IPU3 }, + { MEDIA_BUS_FMT_Y10_1X10, formats::Y10_IPU3 }, }; } /* namespace */ From patchwork Sat Mar 18 23:40:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Scally X-Patchwork-Id: 18418 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 0F7C7C3264 for ; Sat, 18 Mar 2023 23:40:42 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A5400626E4; Sun, 19 Mar 2023 00:40:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1679182841; bh=C37Hro6tCy34wIVwFypxMDCtp37LTHZR+pvMjoVAx+I=; 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=JsudmhWNe5KEgYP4tfbNUjju6m1Yob6MwEB8fCTU2GGkfFMFzS00Bhrq83WSSmGr9 1hlyuB6QiDQxt6JqsmcxplwZfhmcPgn2SK6m8E0WAyr0FBmfz9Gwql8w3dwp4plcpr 5qCAdA8ZzgupXjeFi6zcAUu4Q3zIsWMaQVbBiiNb+IJPErAla6iAp+8T1e8eGjyyqX UJkjZfxbA2J//YTNiVZWyBQmxu2KQ9oXWoNCy/5twPWTF1DcfkhYZ6pZmRtC1nWg9L EfJVeOboCPRDPZU7cHige0u1uUTXYRf/so/H2z3ezsXAZM2qWvWa2Tc2sIZmgFg5xj qanlwinnffxrw== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id ABA6D626F3 for ; Sun, 19 Mar 2023 00:40:34 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="nnmxLe98"; dkim-atps=neutral Received: from mail.ideasonboard.com (cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net [86.13.91.161]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 4B35DB6C; Sun, 19 Mar 2023 00:40:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1679182834; bh=C37Hro6tCy34wIVwFypxMDCtp37LTHZR+pvMjoVAx+I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nnmxLe98vM8MyrdGmtIk4vMjwM9VSmIJe6ZiJtIzjlIDTHZcnG5qGX4NwW3YqULlz 2qmdh6fqj0hv+Pd+rAo/nj+fsA56crrxrQvu4QmxCue9ybUgnEDIXtLUimf53IFfqY xS/f1kJcq8J+CSevtHkm1tUkwHu47mjce5sUiMhU= To: libcamera-devel@lists.libcamera.org Date: Sat, 18 Mar 2023 23:40:12 +0000 Message-Id: <20230318234014.29506-10-dan.scally@ideasonboard.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230318234014.29506-1-dan.scally@ideasonboard.com> References: <20230318234014.29506-1-dan.scally@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 09/11] apps: qcam: Add support for IPU3_Y10 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: Daniel Scally via libcamera-devel From: Dan Scally Reply-To: Daniel Scally Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Add support for the IPU3_Y10 format to the FormatConverter. Signed-off-by: Daniel Scally --- src/apps/qcam/format_converter.cpp | 50 ++++++++++++++++++++++++++++++ src/apps/qcam/format_converter.h | 2 ++ 2 files changed, 52 insertions(+) diff --git a/src/apps/qcam/format_converter.cpp b/src/apps/qcam/format_converter.cpp index de76b32c..7f5648f3 100644 --- a/src/apps/qcam/format_converter.cpp +++ b/src/apps/qcam/format_converter.cpp @@ -169,6 +169,10 @@ int FormatConverter::configure(const libcamera::PixelFormat &format, formatFamily_ = MJPEG; break; + case libcamera::formats::Y10_IPU3: + formatFamily_ = IPU3Packed; + break; + default: return -EINVAL; }; @@ -199,6 +203,9 @@ void FormatConverter::convert(const Image *src, size_t size, QImage *dst) case YUVPlanar: convertYUVPlanar(src, dst->bits()); break; + case IPU3Packed: + convertIPU3Packed(src, dst->bits(), size); + break; }; } @@ -357,3 +364,46 @@ void FormatConverter::convertYUVSemiPlanar(const Image *srcImage, unsigned char } } } + +void FormatConverter::convertIPU3Packed(const Image *srcImage, unsigned char *dst, size_t size) +{ + const unsigned char *src = srcImage->data(0).data(); + unsigned int bytesprocessed = 0; + unsigned int lsb_shift; + unsigned int msb_shift; + unsigned int index; + unsigned int x = 0; + uint16_t pixel; + + while (bytesprocessed < size) { + for (unsigned int i = 0; i < 25; ++i) { + index = (i * 10) / 8; + lsb_shift = (i * 10) % 8; + msb_shift = 8 - lsb_shift; + + /* + * The IPU3-packed format can result in padding at the + * end of a 32-byte block if the last pixel in a row is + * within that block. Check whether we're on the line's + * last pixel and skip the rest of the block if so. + */ + if (x == width_) { + x = 0; + dst += width_ * 4; + break; + } + + pixel = (((src + bytesprocessed)[index+1] << msb_shift) & 0x3ff) + | (((src + bytesprocessed)[index+0] >> lsb_shift) & 0x3ff); + + dst[4 * x + 0] = (pixel >> 2) & 0xff; + dst[4 * x + 1] = (pixel >> 2) & 0xff; + dst[4 * x + 2] = (pixel >> 2) & 0xff; + dst[4 * x + 3] = 0xff; + + x++; + } + + bytesprocessed += 32; + } +} diff --git a/src/apps/qcam/format_converter.h b/src/apps/qcam/format_converter.h index 37dbfae2..940f8b6b 100644 --- a/src/apps/qcam/format_converter.h +++ b/src/apps/qcam/format_converter.h @@ -31,12 +31,14 @@ private: YUVPacked, YUVPlanar, YUVSemiPlanar, + IPU3Packed, }; void convertRGB(const Image *src, unsigned char *dst); void convertYUVPacked(const Image *src, unsigned char *dst); void convertYUVPlanar(const Image *src, unsigned char *dst); void convertYUVSemiPlanar(const Image *src, unsigned char *dst); + void convertIPU3Packed(const Image *src, unsigned char *dst, size_t size); libcamera::PixelFormat format_; unsigned int width_; From patchwork Sat Mar 18 23:40:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Scally X-Patchwork-Id: 18419 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 027EBC32A2 for ; Sat, 18 Mar 2023 23:40:42 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A622B626E7; Sun, 19 Mar 2023 00:40:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1679182842; bh=kFdz5wZIRgm0bOgr4WvYOQWdWx74ZZ5b0C/N2dLaiGs=; 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=BnGRkYC455qm/tcwXi7zHtFKHC/a8J2zouJV79sLuJEoquTJYyBaD7ECf2+hSkWnV mi71q73OO1NuPEKq7+c5KchOrPJINWOUp6C7KyAS6ilPLkF9rc1NfnYmsK7W9e5YDH VKGfH0w9BcRO+qoj2gDL7eRGxM5EkoJ0ai4jcp6RrO9YZQed/79ds1KZ7LqeTTMYYv jottqhcb7g5OMZ88LkQPgyp3GLBbzvbKJfWbO3tsE+5M0sWDLkgdyaiL7RHhiLzjd3 3FL83RwlLggvfahLnkQrIOZY3nb6huf0eL1nCYnqDGE6FMmFKjBh1HCinSzgJtuzQv l3Vm/G/L90LLA== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 04F37626F8 for ; Sun, 19 Mar 2023 00:40:35 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="r6Ld8JkJ"; dkim-atps=neutral Received: from mail.ideasonboard.com (cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net [86.13.91.161]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 9A8B0DF7; Sun, 19 Mar 2023 00:40:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1679182834; bh=kFdz5wZIRgm0bOgr4WvYOQWdWx74ZZ5b0C/N2dLaiGs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r6Ld8JkJ5F35iC0NPf5jadMskKfznIT8+6gFneMYkBoisgaAzjP0wS0Z3j75x8E9B RHZWYy45EJ7abhWexJJHTUPk7IoG0UgUJfHmQTMKURFI3BbDdEJq9WgWQvfIMYha2E S9uoDFZ/o3v/TbJ9XTxQEtMOeggpmNtNnN8MMvSI= To: libcamera-devel@lists.libcamera.org Date: Sat, 18 Mar 2023 23:40:13 +0000 Message-Id: <20230318234014.29506-11-dan.scally@ideasonboard.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230318234014.29506-1-dan.scally@ideasonboard.com> References: <20230318234014.29506-1-dan.scally@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 10/11] apps: qcam: Remove restriction on raw-only streams 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: Daniel Scally via libcamera-devel From: Dan Scally Reply-To: Daniel Scally Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" qcam currently will not allow a single stream with the Raw role. If the format output by a Camera's Raw configuration is supported by the viewfinder there doesn't seem to be a reason not to allow it. Remove the restriction. Signed-off-by: Daniel Scally --- src/apps/qcam/main_window.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/apps/qcam/main_window.cpp b/src/apps/qcam/main_window.cpp index fb2db4aa..a9bb733e 100644 --- a/src/apps/qcam/main_window.cpp +++ b/src/apps/qcam/main_window.cpp @@ -367,12 +367,6 @@ int MainWindow::startCapture() /* Verify roles are supported. */ switch (roles.size()) { - case 1: - if (roles[0] != StreamRole::Viewfinder) { - qWarning() << "Only viewfinder supported for single stream"; - return -EINVAL; - } - break; case 2: if (roles[0] != StreamRole::Viewfinder || roles[1] != StreamRole::Raw) { From patchwork Sat Mar 18 23:40:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Scally X-Patchwork-Id: 18420 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 94BF2C32A3 for ; Sat, 18 Mar 2023 23:40:43 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 2960B6273E; Sun, 19 Mar 2023 00:40:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1679182843; bh=QXB8/VXAUtlndnSFT7OmZnvdgTA71caXTMEse3FGvQs=; 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=ol8QNCR2rzbpaZ+21lRnWejsoGNyc9FyVZYSINasFiAp5gfLr13xc5vIWN9oBv5o7 IEl7iCtzBVsigjAJVzZEPO2dttDhO4MD3QrO5WqdmvO/TIugixW3C6cMVZWS+dEDa9 h8/72nmBugLTY0+0VcZuqm8xQZpwo3t7Q8Vo23DiIP7DkbyYWRLfH3oe4Mi0C0ZwlJ 0fn+CMoue9u5cTr5sbqqgLcT773v25bn36V+L6Q76m+GnPRaYaEz/QQdxjKBTBkg/e 8wqYjUttnjk32bZmuBVYQFxeznf57QNIDOU8azOq6u9udhsOx2gups5g/Cn07U2FGH OaWFVytLjKJFA== 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 58CE7626EB for ; Sun, 19 Mar 2023 00:40:35 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="EwzV0+d+"; dkim-atps=neutral Received: from mail.ideasonboard.com (cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net [86.13.91.161]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id E682FB6C; Sun, 19 Mar 2023 00:40:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1679182835; bh=QXB8/VXAUtlndnSFT7OmZnvdgTA71caXTMEse3FGvQs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EwzV0+d+7RmxIMSL4h531OSZOZQfA3W/8DYtXeXxgNdCBLZh3GSXn79X0m3irI7qH JyjH72R/veE47E2874u+Y+Qod9EGymmPi6pxJp6Sb3B3VWdjqpIgK2eGDayNkvr8pn 8JgQV5r4vLNvKYwuaZulH8eJYPOLBCoXSc4De3R0= To: libcamera-devel@lists.libcamera.org Date: Sat, 18 Mar 2023 23:40:14 +0000 Message-Id: <20230318234014.29506-12-dan.scally@ideasonboard.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230318234014.29506-1-dan.scally@ideasonboard.com> References: <20230318234014.29506-1-dan.scally@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 11/11] pipeline: ipu3: Increase maximum connected cameras 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: Daniel Scally via libcamera-devel From: Dan Scally Reply-To: Daniel Scally Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The IPU3 pipeline currently will only connect two cameras at most. Configure the pipeline to accept 3 cameras instead. Signed-off-by: Daniel Scally --- src/libcamera/pipeline/ipu3/ipu3.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index b9228a59..538e8095 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -1069,7 +1069,7 @@ int PipelineHandlerIPU3::registerCameras() * in a compatible format. */ unsigned int numCameras = 0; - for (unsigned int id = 0; id < 4 && numCameras < 2; ++id) { + for (unsigned int id = 0; id < 4 && numCameras < 3; ++id) { std::unique_ptr data = std::make_unique(this); std::set streams = {