From patchwork Wed Jun 14 12:13:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 18735 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 73A1DBD78E for ; Wed, 14 Jun 2023 12:13:37 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id ECA7861E4D; Wed, 14 Jun 2023 14:13:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1686744816; bh=jyOG+pkUuiM5ZSdAKjBHTFewwH3mA4DXdIhU0OMg1sc=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=tFVWWHZzvEXhJietgJoaibQslF/LoFA03A7iKTuGo2GTOqpNpDRJ5LT5oL02W3Xpc qGrtgEV4DEn6AS5vQUzApmf7s3YjnEfiX7KsH0r1lE92l3F01dD4YBuRpBX0q2ELsR wwmQZbFSpRvMM+JMsOKUkRQPWat1HE5Osf9jd1UnADBjm7dJ1WQRv1EzdTTEkzde5a BQZiC4c1l8f8g0sz3JFKYqX7mF3cbKjLlWogJPZvfy7C+SKCwlDI8PchjfO1fdAGsp +DRICYrqGg1oqeFDlzOPiOBhXM1wRnC/4fVZlI1mX6hH0bHj4qz1s9TKSY+U1JYKdn +u7B6SSnyecyA== Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8E2BC61E4A for ; Wed, 14 Jun 2023 14:13:35 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="h3Ff6Hsv"; dkim-atps=neutral Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-30e412a852dso4674814f8f.0 for ; Wed, 14 Jun 2023 05:13:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1686744815; x=1689336815; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=F+FlLXeWk9PioJLrs78mtuIXRBwYuREBf/c9qXacqZk=; b=h3Ff6HsvmBocODsO4v4qIRp93bD2u9okAuho9M0JhoRXLZr45L5FMnyYu2NEu7LIoa oom1nt8bBr/0+c2QQmudEdIyJespAvDe4TD75QumsClNZZKmMrg2qsjOfjhPrlXzyUib yqBn2tTDs6qqRROr8v22LELMgeIUAFyG14pn+c/aKSCdxulFxoeXEBzHANQPZkvDVvFT 3qq/TiBET4ReASNbDys4J2y7UeEIJRYFBumGP8s76s8JBkE1jP1rnOhLSrVEfdJlRMOL LvSQRj9x4V1GhpH5xonSdRDqi94P5mMBbOlNGqH9GRJia4rnSuBN660/sSeqal8fEhri NgZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686744815; x=1689336815; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=F+FlLXeWk9PioJLrs78mtuIXRBwYuREBf/c9qXacqZk=; b=ff3Y8qVFt3Wn9cZzO/NUPilWW4Q2xwPqyqQNICtAdXeBNBrySPbicfsr4Mhkqz32O9 nYYwTbLSwVX0eTlBmcXb+3ek+iRo7idqY4QmkL54EAA8CXH532nuj31918tpa33GaBp8 1slf1ocgF29Gx3RBK88ZJAbUGdGRXhNHhoGgf6VOPpvElrj2Josr3iKz59ePY5NR2b4U hjq24bIdOZohZyU+Jdb1vDH+sBpXxrCZTQ5miuxJ/1GHbNwpen8/hXRY0gFwO/F0czix PGwcoV0feKC71ejBZKyzqDGffnJ0cbcuEdJ8AVu+Z+8XaljjJA/osYYQhrdsZ9WDl0RB OEgQ== X-Gm-Message-State: AC+VfDx77GnXczLgGC4pbyu2GzG/0Ly7qmuaVeBpJzSjcYBxXjWmErqQ k2juOa83Vv9o1bErIIUOemrEQZIzR03XGG5W2wmIsQ== X-Google-Smtp-Source: ACHHUZ7HLLuVwurCpoFwOxqR+pf76OcGG9YwIf9Ey3DdzAZinJ+CMJd4660M7YLib6HBaofjQ/B5og== X-Received: by 2002:adf:f68c:0:b0:30d:43ca:55ab with SMTP id v12-20020adff68c000000b0030d43ca55abmr7953002wrp.38.1686744814548; Wed, 14 Jun 2023 05:13:34 -0700 (PDT) Received: from localhost.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id i7-20020adffc07000000b0030631a599a0sm18275129wrr.24.2023.06.14.05.13.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jun 2023 05:13:33 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Wed, 14 Jun 2023 13:13:32 +0100 Message-Id: <20230614121332.15484-1-naush@raspberrypi.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] pipeline: rpi: Do not return an error from pipeline config file handling 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: Naushir Patuck via libcamera-devel From: Naushir Patuck Reply-To: Naushir Patuck Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" If a user provided pipeline config file is not present, or if the version reported in the file is invalid, do not return with an error when creating the pipeline handler. Instead, log a warning message and return success with default pipeline config values used. This now matches the behaviour when the pipeline config file could not be parsed correctly, and we revert to default values. Signed-off-by: Naushir Patuck Reviewed-by: Jacopo Mondi Reviewed-by: David Plowman --- src/libcamera/pipeline/rpi/common/pipeline_base.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp index 1e20fc2d8cb8..df7482920e75 100644 --- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp +++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp @@ -1093,8 +1093,9 @@ int CameraData::loadPipelineConfiguration() File file(filename); if (!file.open(File::OpenModeFlag::ReadOnly)) { - LOG(RPI, Error) << "Failed to open configuration file '" << filename << "'"; - return -EIO; + LOG(RPI, Warning) << "Failed to open configuration file '" << filename << "'" + << ", using defaults"; + return 0; } LOG(RPI, Info) << "Using configuration file '" << filename << "'"; @@ -1107,8 +1108,9 @@ int CameraData::loadPipelineConfiguration() std::optional ver = (*root)["version"].get(); if (!ver || *ver != 1.0) { - LOG(RPI, Error) << "Unexpected configuration file version reported"; - return -EINVAL; + LOG(RPI, Warning) << "Unexpected configuration file version reported: " + << *ver; + return 0; } const YamlObject &phConfig = (*root)["pipeline_handler"];