From patchwork Tue Jun 25 19:04:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 20387 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 45515BDB1D for ; Tue, 25 Jun 2024 19:04:42 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 2B938654B1; Tue, 25 Jun 2024 21:04:39 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="jx3QZM+T"; 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 4E07F654A2 for ; Tue, 25 Jun 2024 21:04:36 +0200 (CEST) Received: from localhost.localdomain (93-61-96-190.ip145.fastwebnet.it [93.61.96.190]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 6DC25BEB; Tue, 25 Jun 2024 21:04:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1719342253; bh=B1Lv2Ur0rqNdwO7o95xpnCF7fCVJ2TWUMiC+sfgKslE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jx3QZM+T3Ldxox2sEwEOgD/ewM/cIn7QMQwo6wssIz/gnVzktdfxNt2Ys9c/JCEO7 cpOFi/HjfOHAY//7vP+JhbbuyY3E64c0tGeS3Z3y5SbdPshonDW4KMr9Yh4vdMFoG8 vY1t0c9rnkZ8hIiLnO4VRdr/YiZ7MkxN8qSRgdwM= From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Cc: Jacopo Mondi , Kieran Bingham Subject: [PATCH v2 1/6] libcamera: mali-c55: Limit max size to sensor resolution Date: Tue, 25 Jun 2024 21:04:14 +0200 Message-ID: <20240625190423.291429-2-jacopo.mondi@ideasonboard.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240625190423.291429-1-jacopo.mondi@ideasonboard.com> References: <20240625190423.291429-1-jacopo.mondi@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 Mali C55 ISP cannot upscale. The maximum allowed output size is the sensor's resolution. For RAW streams this is already handled in adjustRawSizes(), while for processed streams the maximum allowed resolution was wrongly set to the ISP maximum output size (8192x8192). Signed-off-by: Jacopo Mondi Signed-off-by: Daniel Scally Reviewed-by: Kieran Bingham --- src/libcamera/pipeline/mali-c55/mali-c55.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libcamera/pipeline/mali-c55/mali-c55.cpp b/src/libcamera/pipeline/mali-c55/mali-c55.cpp index 45c71c1dd619..1c1fef2337f0 100644 --- a/src/libcamera/pipeline/mali-c55/mali-c55.cpp +++ b/src/libcamera/pipeline/mali-c55/mali-c55.cpp @@ -342,7 +342,11 @@ CameraConfiguration::Status MaliC55CameraConfiguration::validate() rawConfig = &config; } - Size maxSize = kMaliC55MaxSize; + /* + * The C55 can not upscale. Limit the configuration to the ISP + * capabilities and the sensor resolution. + */ + Size maxSize = kMaliC55MaxSize.boundedTo(data_->resolution()); if (rawConfig) { /* * \todo Take into account the Bayer components ordering once From patchwork Tue Jun 25 19:04:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 20388 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 BA86ABDB1D for ; Tue, 25 Jun 2024 19:04:43 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id EE893654AC; Tue, 25 Jun 2024 21:04:39 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="TVDuC2vG"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7E9BF654A1 for ; Tue, 25 Jun 2024 21:04:36 +0200 (CEST) Received: from localhost.localdomain (93-61-96-190.ip145.fastwebnet.it [93.61.96.190]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id CB4EC512; Tue, 25 Jun 2024 21:04:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1719342254; bh=IBll4eALAwqey4L4XUudogs8XGInIa4oRRqbXq9kUQE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TVDuC2vGq7SCnH2FMAYhf8/2wrmlcZQxA4mgLKmTdAUXCGA4iXsJMM763HVn98/LR a0mIj/ZJKAVI6UhNk13ZAn0xsvu1aLYcePELXE53J4n67dGIqfg/uwGlrfg4/q+eHC Lg0BSCoww0ZdZ9X8t23M2jUtM3Ef3/opE8WJMW6Q= From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Cc: Jacopo Mondi Subject: [PATCH v2 2/6] libcamera: mali-c55: Limit ISP input size Date: Tue, 25 Jun 2024 21:04:15 +0200 Message-ID: <20240625190423.291429-3-jacopo.mondi@ideasonboard.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240625190423.291429-1-jacopo.mondi@ideasonboard.com> References: <20240625190423.291429-1-jacopo.mondi@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 Mali-C55 ISP has an input size limit of 640x480. Filter out resolutions smaller than this when selecting the sensor format. While at it, rename 'maxYuvSize' to a more appropriate 'minSensorSize'. Signed-off-by: Jacopo Mondi --- src/libcamera/pipeline/mali-c55/mali-c55.cpp | 37 ++++++++++++-------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/src/libcamera/pipeline/mali-c55/mali-c55.cpp b/src/libcamera/pipeline/mali-c55/mali-c55.cpp index 1c1fef2337f0..91f2ebd6fd26 100644 --- a/src/libcamera/pipeline/mali-c55/mali-c55.cpp +++ b/src/libcamera/pipeline/mali-c55/mali-c55.cpp @@ -79,6 +79,7 @@ const std::map maliC55FmtToCode = { { formats::SGRBG16, MEDIA_BUS_FMT_SGRBG16_1X16 }, }; +constexpr Size kMaliC55MinInputSize = { 640, 480 }; constexpr Size kMaliC55MinSize = { 128, 128 }; constexpr Size kMaliC55MaxSize = { 8192, 8192 }; constexpr unsigned int kMaliC55ISPInternalFormat = MEDIA_BUS_FMT_RGB121212_1X36; @@ -265,13 +266,16 @@ PixelFormat MaliC55CameraData::adjustRawFormat(const PixelFormat &rawFmt) const return rawFmt; } -Size MaliC55CameraData::adjustRawSizes(const PixelFormat &rawFmt, const Size &rawSize) const +Size MaliC55CameraData::adjustRawSizes(const PixelFormat &rawFmt, const Size &size) const { /* Just make sure the format is supported. */ auto it = maliC55FmtToCode.find(rawFmt); if (it == maliC55FmtToCode.end()) return {}; + /* Expand the RAW size to the minimum ISP input size. */ + Size rawSize = size.expandedTo(kMaliC55MinInputSize); + /* Check if the size is natively supported. */ unsigned int rawCode = it->second; const auto rawSizes = sizes(rawCode); @@ -282,14 +286,14 @@ Size MaliC55CameraData::adjustRawSizes(const PixelFormat &rawFmt, const Size &ra /* Or adjust it to the closest supported size. */ uint16_t distance = std::numeric_limits::max(); Size bestSize; - for (const Size &size : rawSizes) { + for (const Size &sz : rawSizes) { uint16_t dist = std::abs(static_cast(rawSize.width) - - static_cast(size.width)) + + static_cast(sz.width)) + std::abs(static_cast(rawSize.height) - - static_cast(size.height)); + static_cast(sz.height)); if (dist < distance) { dist = distance; - bestSize = size; + bestSize = sz; } } @@ -376,8 +380,13 @@ CameraConfiguration::Status MaliC55CameraConfiguration::validate() frPipeAvailable = false; } - /* Adjust processed streams. */ - Size maxYuvSize; + /* + * Adjust processed streams. + * + * Compute the minimum sensor size to be later used to select the + * sensor configuration. + */ + Size minSensorSize = kMaliC55MinInputSize; for (StreamConfiguration &config : config_) { if (isFormatRaw(config.pixelFormat)) continue; @@ -399,8 +408,8 @@ CameraConfiguration::Status MaliC55CameraConfiguration::validate() status = Adjusted; } - if (maxYuvSize < size) - maxYuvSize = size; + if (minSensorSize < size) + minSensorSize = size; if (frPipeAvailable) { config.setStream(const_cast(&data_->frStream_)); @@ -416,7 +425,7 @@ CameraConfiguration::Status MaliC55CameraConfiguration::validate() if (rawConfig) { const auto it = maliC55FmtToCode.find(rawConfig->pixelFormat); sensorFormat_.code = it->second; - sensorFormat_.size = rawConfig->size; + sensorFormat_.size = rawConfig->size.expandedTo(minSensorSize); return status; } @@ -431,13 +440,13 @@ CameraConfiguration::Status MaliC55CameraConfiguration::validate() Size bestSize; for (const auto &size : sizes) { /* Skip sensor sizes that are smaller than the max YUV size. */ - if (maxYuvSize.width > size.width || - maxYuvSize.height > size.height) + if (minSensorSize.width > size.width || + minSensorSize.height > size.height) continue; - uint16_t dist = std::abs(static_cast(maxYuvSize.width) - + uint16_t dist = std::abs(static_cast(minSensorSize.width) - static_cast(size.width)) + - std::abs(static_cast(maxYuvSize.height) - + std::abs(static_cast(minSensorSize.height) - static_cast(size.height)); if (dist < distance) { dist = distance; From patchwork Tue Jun 25 19:04:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 20389 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 9E366BDB1D for ; Tue, 25 Jun 2024 19:04:44 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C8DC7654B3; Tue, 25 Jun 2024 21:04:40 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="KoY1LjT1"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E82FA654A1 for ; Tue, 25 Jun 2024 21:04:36 +0200 (CEST) Received: from localhost.localdomain (93-61-96-190.ip145.fastwebnet.it [93.61.96.190]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 27EC4BEB; Tue, 25 Jun 2024 21:04:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1719342254; bh=bbpdqUEEbKi60HpXp9wyIAJWG8vuXO0xWMQMMOwRFos=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KoY1LjT1GXCtVTbAhCKHu4lWzWxwaUWX91jjNuI92oyx+mxbz2oxTm3Twk1du3EE0 gX2/9tYKQ2jKogEmsk/5PSflhEtRR9BD+XeUNziNaaGMaMYj0jqcElQkV3bVFJqEqQ 7JWkd3g0lQGjfn/+KNT0195tZklLmg4AHJJEz+W4= From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Cc: Jacopo Mondi , Daniel Scally , Kieran Bingham Subject: [PATCH v2 3/6] libcamera: mali-c55: Init camera properties Date: Tue, 25 Jun 2024 21:04:16 +0200 Message-ID: <20240625190423.291429-4-jacopo.mondi@ideasonboard.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240625190423.291429-1-jacopo.mondi@ideasonboard.com> References: <20240625190423.291429-1-jacopo.mondi@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" From: Daniel Scally Initialise the camera properties using the CameraSensor properties. Signed-off-by: Daniel Scally Signed-off-by: Jacopo Mondi Reviewed-by: Kieran Bingham --- src/libcamera/pipeline/mali-c55/mali-c55.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcamera/pipeline/mali-c55/mali-c55.cpp b/src/libcamera/pipeline/mali-c55/mali-c55.cpp index 91f2ebd6fd26..796e2ca60e94 100644 --- a/src/libcamera/pipeline/mali-c55/mali-c55.cpp +++ b/src/libcamera/pipeline/mali-c55/mali-c55.cpp @@ -966,7 +966,7 @@ bool PipelineHandlerMaliC55::registerSensorCamera(MediaLink *ispLink) if (data->init()) return false; - /* \todo: Init properties and controls. */ + data->properties_ = data->sensor_->properties(); registerMaliCamera(std::move(data), sensor->name()); } From patchwork Tue Jun 25 19:04:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 20390 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 94449BDB1D for ; Tue, 25 Jun 2024 19:04:45 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 329A7654B0; Tue, 25 Jun 2024 21:04:43 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="GAzV4Q+4"; 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 6E745654A1 for ; Tue, 25 Jun 2024 21:04:37 +0200 (CEST) Received: from localhost.localdomain (93-61-96-190.ip145.fastwebnet.it [93.61.96.190]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 94479512; Tue, 25 Jun 2024 21:04:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1719342254; bh=ObRRX/fwFXV2Ki9Jz9kflXj2hbhWSo5z5sSVCOrRi94=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GAzV4Q+4gYCjvyDlUsm5pMPYHQiZwNserQeriAnotRWCeYYgroIumBJi1WMWVcFw5 w3jHxQQR9sWumcE/xtbVFDOz2C4yrrt8j8AZAZtPo1w4eQ1BY4CEOnkv9fYtCkXbNl ZsJR9CJP0WPjhLqOLKkti4Gpw7P0CbWt/kcWP0wo= From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Cc: Jacopo Mondi , Daniel Scally , Kieran Bingham , Laurent Pinchart Subject: [PATCH v2 4/6] libcamera: mali-c55: Simplify bufferReady() Date: Tue, 25 Jun 2024 21:04:17 +0200 Message-ID: <20240625190423.291429-5-jacopo.mondi@ideasonboard.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240625190423.291429-1-jacopo.mondi@ideasonboard.com> References: <20240625190423.291429-1-jacopo.mondi@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" From: Daniel Scally The PipelineHandler::completeBuffer() base class function returns a boolean to indicate if there still are pending buffers in the Request. Simplify the bufferReady() function in the Mali-C55 pipeline handler using the completeBuffer() return value. Signed-off-by: Daniel Scally Signed-off-by: Jacopo Mondi Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- src/libcamera/pipeline/mali-c55/mali-c55.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/libcamera/pipeline/mali-c55/mali-c55.cpp b/src/libcamera/pipeline/mali-c55/mali-c55.cpp index 796e2ca60e94..ee73a092eb5b 100644 --- a/src/libcamera/pipeline/mali-c55/mali-c55.cpp +++ b/src/libcamera/pipeline/mali-c55/mali-c55.cpp @@ -895,12 +895,8 @@ void PipelineHandlerMaliC55::bufferReady(FrameBuffer *buffer) { Request *request = buffer->request(); - completeBuffer(request, buffer); - - if (request->hasPendingBuffers()) - return; - - completeRequest(request); + if (completeBuffer(request, buffer)) + completeRequest(request); } void PipelineHandlerMaliC55::registerMaliCamera(std::unique_ptr data, From patchwork Tue Jun 25 19:04:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 20391 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 82B26BDB1D for ; Tue, 25 Jun 2024 19:04:46 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 23710654B7; Tue, 25 Jun 2024 21:04:44 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="a6aU7Arw"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 29A52654B0 for ; Tue, 25 Jun 2024 21:04:37 +0200 (CEST) Received: from localhost.localdomain (93-61-96-190.ip145.fastwebnet.it [93.61.96.190]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 16036BEB; Tue, 25 Jun 2024 21:04:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1719342255; bh=wN50r+M/uOzdwSu5F0FIvJe74OsLmZASfJ5scGgYJ/Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a6aU7ArwwaAOpb7MpvjDChrebKV9rD2cDHonJGT9VoJTz9UXiS0CqaQSAczlEjRWv B9OnaD7dhc+CXVkBgYZ5D21NoMdysdIMst6xTHJuUAla0EPUXdnSFsJGAI7V7ZnIit 5pv40Xt3NZetAyaovsfy7HZS0wZiBvX72XxKdyjM= From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Cc: Jacopo Mondi , Daniel Scally , Kieran Bingham , Laurent Pinchart Subject: [PATCH v2 5/6] libcamera: mali-c55: Remove MaliC55CameraData::mbusCodes() Date: Tue, 25 Jun 2024 21:04:18 +0200 Message-ID: <20240625190423.291429-6-jacopo.mondi@ideasonboard.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240625190423.291429-1-jacopo.mondi@ideasonboard.com> References: <20240625190423.291429-1-jacopo.mondi@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" From: Daniel Scally The MaliC55CameraData::mbusCodes() function is unused. Remove it. Signed-off-by: Daniel Scally Signed-off-by: Jacopo Mondi Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- src/libcamera/pipeline/mali-c55/mali-c55.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/libcamera/pipeline/mali-c55/mali-c55.cpp b/src/libcamera/pipeline/mali-c55/mali-c55.cpp index ee73a092eb5b..f1c057c1aeb4 100644 --- a/src/libcamera/pipeline/mali-c55/mali-c55.cpp +++ b/src/libcamera/pipeline/mali-c55/mali-c55.cpp @@ -95,7 +95,6 @@ public: int init(); /* Deflect these functionalities to either TPG or CameraSensor. */ - const std::vector mbusCodes() const; const std::vector sizes(unsigned int mbusCode) const; const Size resolution() const; @@ -178,14 +177,6 @@ void MaliC55CameraData::initTPGData() tpgResolution_ = tpgSizes_.back(); } -const std::vector MaliC55CameraData::mbusCodes() const -{ - if (sensor_) - return sensor_->mbusCodes(); - - return tpgCodes_; -} - const std::vector MaliC55CameraData::sizes(unsigned int mbusCode) const { if (sensor_) From patchwork Tue Jun 25 19:04:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 20392 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 0845BC3295 for ; Tue, 25 Jun 2024 19:04:47 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E30A0654AD; Tue, 25 Jun 2024 21:04:44 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="e9AVpwrC"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 667C2654AD for ; Tue, 25 Jun 2024 21:04:38 +0200 (CEST) Received: from localhost.localdomain (93-61-96-190.ip145.fastwebnet.it [93.61.96.190]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 8990E512; Tue, 25 Jun 2024 21:04:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1719342255; bh=z0fQ94BgD27QSFx0jeQYKI/ofGLS64lYl/40iJ3biwY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e9AVpwrCdZiKw/zk9QwDYcE+mA6bpZpGYeh8mhwooqzA/g3GY45nk8JSxUx6no4kW 6M7dMxk2dPakI6GHx8MMtenlzRKsihMaDb911BR2xjNwkzqnRLdarnNivs38Ol73Tb mpxHxwhpctbLO4Tu+CDdZwJWMa1rSDa+UkyUlBVk= From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Cc: Jacopo Mondi , Daniel Scally Subject: [PATCH v2 6/6] libcamera: mali-c55: Add stride and size to rawConfig Date: Tue, 25 Jun 2024 21:04:19 +0200 Message-ID: <20240625190423.291429-7-jacopo.mondi@ideasonboard.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240625190423.291429-1-jacopo.mondi@ideasonboard.com> References: <20240625190423.291429-1-jacopo.mondi@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" From: Daniel Scally Complete the RAW StreamConfiguration by populating the frame stride and the frame size. Set the minimum required alignment to 4 bytes as the Mali C55 ISP output RAW formats expanded to 16 bits and a RAW Bayer macro-pixel requires two sample to be complete. Signed-off-by: Daniel Scally Signed-off-by: Jacopo Mondi Reviewed-by: Kieran Bingham --- src/libcamera/pipeline/mali-c55/mali-c55.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libcamera/pipeline/mali-c55/mali-c55.cpp b/src/libcamera/pipeline/mali-c55/mali-c55.cpp index f1c057c1aeb4..f52fc1e95a20 100644 --- a/src/libcamera/pipeline/mali-c55/mali-c55.cpp +++ b/src/libcamera/pipeline/mali-c55/mali-c55.cpp @@ -367,6 +367,10 @@ CameraConfiguration::Status MaliC55CameraConfiguration::validate() maxSize = rawSize; + const PixelFormatInfo &info = PixelFormatInfo::info(rawConfig->pixelFormat); + rawConfig->stride = info.stride(rawConfig->size.width, 0, 4); + rawConfig->frameSize = info.frameSize(rawConfig->size, 4); + rawConfig->setStream(const_cast(&data_->frStream_)); frPipeAvailable = false; }