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: Daniel 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: Daniel 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);