From patchwork Mon Jun 6 08:58:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 16177 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 AB965C326B for ; Mon, 6 Jun 2022 08:58:55 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0F3A56563D; Mon, 6 Jun 2022 10:58:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1654505935; bh=mlEbzloUCfOHmap+OJtdXrzJm5Q6nU6PeeLrf0cS7ws=; 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=mlooGETvlco68Ni2UjOePMkyR5I9le4iyFs/OWWEl+0/AyD7Ci/qSPfGHvOIUE57E RvIPwGFwSMlNoWpWzzCHARf+w9K4lea5aF1MuZNDFtnS93cFRH6yf1Olfr87W2z3jC 7VQKDO8dHoCKEsVbQxD+5wSbKny9g9L9BZXGwwCMcS+J6MouSWEwGUPpL567CfOZe+ zh3QX3ya7L87uUQu69yUf83XreunUo+C9zCtsmb0CqcKMrGCYiFY90cdD5OSbIJM+m TvJdM0uH32nEUTQsLI+tcQfaHfGBHsY4nODI/JpoI/MRpw5tL/eX/7xpdCBaEQJ+Tr LgGLziuY4eueg== Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0153365633 for ; Mon, 6 Jun 2022 10:58:53 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="PFZaWLjC"; dkim-atps=neutral Received: by mail-wr1-x42b.google.com with SMTP id q26so8553052wra.1 for ; Mon, 06 Jun 2022 01:58:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TwZ9q8R2jtEVzc/oXMZe9zQnwVFeDOp8WcEV7te+Cqk=; b=PFZaWLjCwOcZWBeRENYq+RyIubOkvisn0IcCZSEcAt9OklJFwmQ4InTcPerUWtRcWf ++krs0XxWlctr7D1JlIYowa4oGfKVMur7WfSCYtR9ZOBMhybW3N2Ue/NJsJRX+U/GwWP eTv7iPwh1nsesKBC0mPHphKoICiZEp9qcMtNFmy3CId3bkSbhRZcR2430bBhBWQG9fYE TCeQLn8KUHQuW+DeJqj6UT+Q55VYW33gXRJSz5RhYVnowZVppFgkPqs0OXaowATaSKVG 2NE74jISwt4heg0GS0SeSfju6OAdwPR9jgT9H57Irhd06DPfM1yLKS1hhi0W3F3I7uXH nGJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TwZ9q8R2jtEVzc/oXMZe9zQnwVFeDOp8WcEV7te+Cqk=; b=vLKVOKcP3A9S1T6HN5nQ494N3P9mD8vtVWcDM1+MIUXAv/tRsyvOQLbwXB1hsTtevA ptkj4DmDuP+fwYMzCGEGiAJ6GijniJy99RFKRtoniMsTGiwuUX9wNKnPDcCJi5ml8iXt RHBSwD9lB3lnLfqpqX0e+4Fua6qpRw4NPghZwmpxM+Oz/ojfEloVe00u+cU2VSpt9qZ7 EHvK5QwNTLt/Lw7gJe8FwKfPmss6sAgZi/q0dMNc2xdqcSRDoGK9RGxw7Yt5qM1wT79g Ffnc6azLJZRugBoQEASyFFTJF/0oE4R92kC2qW/GbGCG5gjoP8C2mix26EfNjjWS3yCj NF/w== X-Gm-Message-State: AOAM5314E79qFmxf+TnfP0CVonbZSRz5c6054zuFncU768NZy2LgNU62 NtFu0c2VGqwepmJXVHoFjj0Vmk4q6NJpcg== X-Google-Smtp-Source: ABdhPJxKWZtxmvn7ctxrFZMgph2lQU1xvCPWvUBAVim0TO/70ziyOwt0q6eI+oag0Q0qlcvV4WCcfQ== X-Received: by 2002:adf:d84b:0:b0:212:1c7c:5790 with SMTP id k11-20020adfd84b000000b002121c7c5790mr19593221wrl.366.1654505933326; Mon, 06 Jun 2022 01:58:53 -0700 (PDT) Received: from naush-laptop.pitowers.org ([2a00:1098:3142:14:e73c:a66f:e321:48cf]) by smtp.gmail.com with ESMTPSA id p8-20020a1c5448000000b003942a244ed7sm16315565wmi.28.2022.06.06.01.58.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jun 2022 01:58:52 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Mon, 6 Jun 2022 09:58:25 +0100 Message-Id: <20220606085825.1145654-2-naush@raspberrypi.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220606085825.1145654-1-naush@raspberrypi.com> References: <20220606085825.1145654-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 1/1] camera_sensor: Suppress error message if test patterns are unavailable 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 sensor driver does not support test patterns (e.g. IMX477), libcamera throws an unnecessary error message during initialisation when it sets the test pattern to off. Fix this by moving the error message into setTestPatternMode() where the pipeline handler explicitly requests to set a test pattern. Signed-off-by: Naushir Patuck Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- src/libcamera/camera_sensor.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp index 4bb2066f0fd4..d055c16a4885 100644 --- a/src/libcamera/camera_sensor.cpp +++ b/src/libcamera/camera_sensor.cpp @@ -582,16 +582,19 @@ int CameraSensor::setTestPatternMode(controls::draft::TestPatternModeEnum mode) if (testPatternMode_ == mode) return 0; + if (testPatternModes_.empty()) { + LOG(CameraSensor, Error) + << "Camera sensor does not support test pattern modes."; + return -EINVAL; + } + return applyTestPatternMode(mode); } int CameraSensor::applyTestPatternMode(controls::draft::TestPatternModeEnum mode) { - if (testPatternModes_.empty()) { - LOG(CameraSensor, Error) - << "Camera sensor does not support test pattern modes."; + if (testPatternModes_.empty()) return 0; - } auto it = std::find(testPatternModes_.begin(), testPatternModes_.end(), mode);