From patchwork Wed Jun 16 14:34:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 12616 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 E1320BD78E for ; Wed, 16 Jun 2021 14:34:35 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9B2606029A; Wed, 16 Jun 2021 16:34:35 +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="uuiaxf/8"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 329B66029A for ; Wed, 16 Jun 2021 16:34:34 +0200 (CEST) Received: from Monstersaurus.local (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id C758B3E5; Wed, 16 Jun 2021 16:34:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1623854074; bh=v2ylNFep2roJpy+OcijcOLKwsjtEJEOUXxoeHuyO9DQ=; h=From:To:Cc:Subject:Date:From; b=uuiaxf/8KbjMQB05Pvh/AJVAyJkfBsCuFz8fsyQLX91vQzBdXgMQxONC+85jF/QVj rRci0PjryiNhg37rA4r09iGdJTlv6VZSDUhsWCSKQe30YM9NruOIqOGDr8lZQnfFDl CCxWAEwCrx0/XBPw6sRKYzNP29djvADasIuJ+ogs= From: Kieran Bingham To: libcamera devel Date: Wed, 16 Jun 2021 15:34:30 +0100 Message-Id: <20210616143430.3826175-1-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2] libcamera: pipeline: vimc: Fail without an 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 is required for VIMC so fail early if it can't be loaded. Reviewed-by: Umang Jain Reviewed-by: Laurent Pinchart Signed-off-by: Kieran Bingham --- src/libcamera/pipeline/vimc/vimc.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp index 1713dc0ca932..1c4135cc6daa 100644 --- a/src/libcamera/pipeline/vimc/vimc.cpp +++ b/src/libcamera/pipeline/vimc/vimc.cpp @@ -427,13 +427,14 @@ bool PipelineHandlerVimc::match(DeviceEnumerator *enumerator) return false; data->ipa_ = IPAManager::createIPA(this, 0, 0); - if (data->ipa_ != nullptr) { - std::string conf = data->ipa_->configurationFile("vimc.conf"); - data->ipa_->init(IPASettings{ conf, data->sensor_->model() }); - } else { - LOG(VIMC, Warning) << "no matching IPA found"; + if (!data->ipa_) { + LOG(VIMC, Error) << "no matching IPA found"; + return false; } + std::string conf = data->ipa_->configurationFile("vimc.conf"); + data->ipa_->init(IPASettings{ conf, data->sensor_->model() }); + /* Create and register the camera. */ std::set streams{ &data->stream_ }; std::shared_ptr camera =