From patchwork Wed May 31 14:39:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 18672 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 1C80DC32A2 for ; Wed, 31 May 2023 14:39:50 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9F93A6278F; Wed, 31 May 2023 16:39:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1685543988; bh=xIPrrDCNBeF433N6Y5+8Zw/9QHYqun04ahmKZgclQzs=; 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=nd8uT9Ul6ChBFlMacQMtlMNyErUtwIyTOrOcyWeuGB7rxuz6ifk08/ObCA95sdv8z B9og8QK3St400tMblHmOxrGXDwDlYCBX1HCadnqK76S3S2HlQYmE2XvWQ12xcs95JH j6YqASFWVnGvG1cAynrQHj2KeFw1xmcMb1TqM9fFy6D4jAlRQ+meVqthEpLAFz4JX7 LAqHYZw5r5Wfru1TEuh+9mNEGZPqnciiRweOzHYShk+6119My/6zp5vUpbjN8cVejN eQQ5EmInLZI88WB8YziiLuBF/83QanIeH5cmrqVDCYmCdg9A+uQrPcJZMvpqMYreaM pX9W5HYfoNvlw== Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4A27F626FA for ; Wed, 31 May 2023 16:39:47 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="mhvI7Hpu"; dkim-atps=neutral Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-30aef0499b6so2653482f8f.1 for ; Wed, 31 May 2023 07:39:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1685543986; x=1688135986; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tyXUDVu1LsN3DHz4TMrGFcmEle0ZihpV+mgI1mhlvL0=; b=mhvI7HpuCNfr7Drn96mVuc/Ul4HzPR9pSB586f85ePLa5gBdtHRXrClr3pEP7NDQ+B 7lx6cjmAg1h/zUNAvRsTFwCF27Sd6qoxzxmCi3ccBkv65BsQUADEfnrLJ7Z26wtTwzKo YKBgdGbQercv1+YRv2AAAb0IhCNA9L84j6j+WGWotgexOszgEfEi9GmqbqiptVnCVKNg AP8phXJuGne0bymdPCvd41Cn/GAn4FyuTp65edMsDBVXFOTR8tJTAUQ2QBnmhl3VFmgg Q7oDpD04ykKKVOEpVtZ5kOTEcyaf4aLYuXiSyDy/XMgdCrMoBy3Y1T/AOM6JY+EDjv2g NVJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685543986; x=1688135986; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tyXUDVu1LsN3DHz4TMrGFcmEle0ZihpV+mgI1mhlvL0=; b=KVQETYWodMkrOICUcZrriZir22NR/se9axHY6+9MCi0IiXwGzSrifKPJpp/L727WQ2 bHxd5cbg7EDcl56Lx9CIkGP7sMhh6nsTjodO+wJJiQJOgJ5lQq7vGIlj52EXDSunP3de zdP1U+I4RsBm4B7ECNHSkTP++j0wfrAU3yvIFylzOTtjvnW6w0BqCw27xO0RKYIRMBRB cFE9yqbfH+m7rGeMtoV/HcQVq5x2ZH+rdSa29WSlBvMH/BBuiHzc6en4LVHR9DesnTa6 XBhOTVIobs7Rwlszd2cLSo2fs/wP/N/bnoHdho1f832BMf4ej/qmzXx00b9FzQjR8879 CasQ== X-Gm-Message-State: AC+VfDxmh1Z37t2jIue4kh5KFKBfQKj8f0v22NR7fY0j4B1XqBTndKWg dPicB8MGAXCP3DteE2Ffr1v9EHD/CY/jh6YKrVAYPw== X-Google-Smtp-Source: ACHHUZ7KqKghn1zA3Rte2pC1D0uXxJAut/a7G3RDD/uJ6fWoFdRZcNtUuh/lHycXDZrWsofWrJt1LQ== X-Received: by 2002:a5d:5448:0:b0:30a:93ad:ab9f with SMTP id w8-20020a5d5448000000b0030a93adab9fmr3778456wrv.11.1685543986743; Wed, 31 May 2023 07:39:46 -0700 (PDT) Received: from localhost.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id bf3-20020a0560001cc300b00307b5376b2csm6950706wrb.90.2023.05.31.07.39.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 May 2023 07:39:46 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Wed, 31 May 2023 15:39:45 +0100 Message-Id: <20230531143946.23571-2-naush@raspberrypi.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230531143946.23571-1-naush@raspberrypi.com> References: <20230531143946.23571-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v1 1/2] pipeline: ipa: rpi: Flag if the sensor is a mono variant 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" Add a flag to the ipa->init() interface to indicate a mono sensor variant. This flag will be used in a future commit to handle controls that are invalid for mono sensors. Signed-off-by: Naushir Patuck Reviewed-by: David Plowman Reviewed-by: Laurent Pinchart --- include/libcamera/ipa/raspberrypi.mojom | 1 + src/ipa/rpi/common/ipa_base.cpp | 1 + src/ipa/rpi/common/ipa_base.h | 1 + src/libcamera/pipeline/rpi/common/pipeline_base.cpp | 4 +++- 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/libcamera/ipa/raspberrypi.mojom b/include/libcamera/ipa/raspberrypi.mojom index ba786e647ca1..d35289ee6229 100644 --- a/include/libcamera/ipa/raspberrypi.mojom +++ b/include/libcamera/ipa/raspberrypi.mojom @@ -21,6 +21,7 @@ struct SensorConfig { struct InitParams { bool lensPresent; + bool monoSensor; }; struct InitResult { diff --git a/src/ipa/rpi/common/ipa_base.cpp b/src/ipa/rpi/common/ipa_base.cpp index db7a0eb3a1ca..150fe433d0df 100644 --- a/src/ipa/rpi/common/ipa_base.cpp +++ b/src/ipa/rpi/common/ipa_base.cpp @@ -139,6 +139,7 @@ int32_t IpaBase::init(const IPASettings &settings, const InitParams ¶ms, Ini } lensPresent_ = params.lensPresent; + monoSensor_ = params.monoSensor; controller_.initialise(); diff --git a/src/ipa/rpi/common/ipa_base.h b/src/ipa/rpi/common/ipa_base.h index 6f9c46bb16b1..39d00760d012 100644 --- a/src/ipa/rpi/common/ipa_base.h +++ b/src/ipa/rpi/common/ipa_base.h @@ -87,6 +87,7 @@ private: std::map buffers_; bool lensPresent_; + bool monoSensor_; ControlList libcameraMetadata_; std::array rpiMetadata_; diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp index 3bb5ec531e4f..12698056cda1 100644 --- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp +++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp @@ -1131,6 +1131,7 @@ int CameraData::loadPipelineConfiguration() int CameraData::loadIPA(ipa::RPi::InitResult *result) { ipa_ = IPAManager::createIPA(pipe(), 1, 1); + bool monoSensor = isMonoSensor(sensor_); if (!ipa_) return -ENOENT; @@ -1143,7 +1144,7 @@ int CameraData::loadIPA(ipa::RPi::InitResult *result) char const *configFromEnv = utils::secure_getenv("LIBCAMERA_RPI_TUNING_FILE"); if (!configFromEnv || *configFromEnv == '\0') { std::string model = sensor_->model(); - if (isMonoSensor(sensor_)) + if (monoSensor) model += "_mono"; configurationFile = ipa_->configurationFile(model + ".json"); } else { @@ -1154,6 +1155,7 @@ int CameraData::loadIPA(ipa::RPi::InitResult *result) ipa::RPi::InitParams params; params.lensPresent = !!sensor_->focusLens(); + params.monoSensor = monoSensor; int ret = platformInitIpa(params); if (ret) return ret;