From patchwork Fri Apr 16 16:03:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 11968 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 CA67ABD235 for ; Fri, 16 Apr 2021 16:03:30 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4E9526880A; Fri, 16 Apr 2021 18:03:30 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="gVndJcQg"; 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 BFC8568806 for ; Fri, 16 Apr 2021 18:03:28 +0200 (CEST) Received: from Q.local (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 4931F5A5; Fri, 16 Apr 2021 18:03:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1618589008; bh=61Ss0ftl3CmD40PQomIOF9Y4/JUDpVrWK7m8N3bRE3s=; h=From:To:Cc:Subject:Date:From; b=gVndJcQgMGDwtN6c8CoRxIkW5VRzzc4UqBNvwjOOw8A/I1V5AaAdFk+ZIBP/sQxdb N1NuyFYhZPR5F12WdyH3kgbGI9+zCQdaAK7jLkh31UBRThkJ1yvvrCBQyaUHTZBIrB XBaWNaCwPdoXkAKk0ovCfEgstf3ex+VJ4RoQnbxw= From: Kieran Bingham To: libcamera devel Date: Fri, 16 Apr 2021 17:03:20 +0100 Message-Id: <20210416160320.68125-1-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] libcamera: pipeline: ipu3: Check for failures when loading IPA 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 ipa_->init() method can fail if the IPA can't load correctly. This should be caught by the pipeline handler to prevent continuing with an invalid IPA. Signed-off-by: Kieran Bingham Reviewed-by: Jean-Michel Hautbois Reviewed-by: Niklas Söderlund Reviewed-by: Laurent Pinchart Reviewed-by: Hirokazu Honda --- src/libcamera/pipeline/ipu3/ipu3.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index 519cad4f8148..51446fcf5bc1 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -1145,7 +1145,11 @@ int IPU3CameraData::loadIPA() ipa_->queueFrameAction.connect(this, &IPU3CameraData::queueFrameAction); CameraSensor *sensor = cio2_.sensor(); - ipa_->init(IPASettings{ "", sensor->model() }); + int ret = ipa_->init(IPASettings{ "", sensor->model() }); + if (ret) { + LOG(IPU3, Error) << "Failed to initialise the IPU3 IPA"; + return ret; + } return 0; }