From patchwork Thu Jan 19 10:45:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 18151 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 32662BD87C for ; Thu, 19 Jan 2023 10:46:01 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id ECF9F625FA; Thu, 19 Jan 2023 11:46:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1674125160; bh=xfPh4Disv4iEifN3/oiLgQOVZPel27wJl9JloUjFs6w=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=g7CAzrSyzZQAanKkyQXjkYzxClL93Kz9JrSPlH70HR4CTUGawnqBpDlU9xyXDTIzm 6qnBrz0Kz6Pvq9O0oYTiFBCxH76T8Sck7Y5RT0KdcFjwUKJDBiTqxWbaR0lJjV8S/B 0vX4CEIqTTeJN+KcDylSzvzuP2p8KecfUfTvyN+CBB8urb7Bg2+5Ne/N3gFu9BINbc eFPzMYrgGcwReOqSalWbAwo7JrrSXVNRKotwYeueL05SCEwVq9s8IGAFAM704KhB4d 5IPfQOJ7QMr+HjOFpv9oyYpJGp/dGFaB3WPoTLHo6qyj+154Zi+BfEkRPqEKOUBh8D iidpafIYTlgng== Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id D2AC7625EA for ; Thu, 19 Jan 2023 11:45:54 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="FbbEYBJL"; dkim-atps=neutral Received: by mail-wm1-x32b.google.com with SMTP id d4-20020a05600c3ac400b003db1de2aef0so929578wms.2 for ; Thu, 19 Jan 2023 02:45:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; 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=ezly2RwbrTh/0/n2/4eff8d0vIHmHXT728mYO/WrJoo=; b=FbbEYBJL7pmI5YNGBxf/07v08Lr3TE61GrMeMg3s5lZdYnTcrETDZUfoNEOrlNfHTY IloZdo/8GVHWArxvRSxLgbuBaGiEulbBQU4Y0qJv6rlE70idoOPC6BXExBfTdR01neiJ NuC/eByKQOCiZDDUfvNW0ZQS1XETCwJjWUbvpFrdx9Kw1d6oO3QMgTV+DM73Mmr55ELJ g7BaOGm7+OF0c4tel+sMWOPGwPtRghVc1M2A+st0rwOPBAUNLC3IR3E5Lf0Bf6/ZC/DW 9X42vqqZtqlqNVokuS63rI0AkDII1v09fx0d7fT7ij1sjYbdrnSSowINwf/Qm5GG9WtC y6Zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=ezly2RwbrTh/0/n2/4eff8d0vIHmHXT728mYO/WrJoo=; b=OPpRjqmIqwEeaoeDStJ66W7HG/CdLTxJu5COErHkD6s3JhU5B/z52IdvEDr4tP+F/t 6Kg9PsYIsV78PO00x9SumAIiDs4OyksCo8MB5J33NO2Lnm5DjMc35PkqAUuGAWo+sCC+ oyItiE+Hd1PgwphtdO23NafS2j/SJiGBGu3is6S6OLJ1s1RWEjf/GtJ1NNMHAFgxkeZ2 gRQG7nuE3n14S4HjXWacpdjWl51ZqjIGNBc6JS1gHwNLazhg5jSYepDOxsLt+Xz/UzEE ixGoYeEhRt2plpNyHtjE5gvTpd/+phSywH8pIFBpPH0JyMup2mHupZuKcWu9ml31IViV yE4g== X-Gm-Message-State: AFqh2koHphb/DfZfqc3gLoqKacv9ruc0Td+YyRnyvqpW9Sm1Egxv1XkI /gIEbYAM/8+NAHdAd2HwJx+9OS8TnM9NyXQh0Wc= X-Google-Smtp-Source: AMrXdXvCc40UAm8C7T0Z1zNusQ9VG5JdC/lXBUTDcxnqu09qSUJ2QsgFc4x3Ew+MIET1AYscyIfY8w== X-Received: by 2002:a05:600c:224b:b0:3d2:640:c4e5 with SMTP id a11-20020a05600c224b00b003d20640c4e5mr9842512wmm.8.1674125153842; Thu, 19 Jan 2023 02:45:53 -0800 (PST) Received: from localhost.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id be12-20020a05600c1e8c00b003db06224953sm5332029wmb.41.2023.01.19.02.45.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Jan 2023 02:45:53 -0800 (PST) To: libcamera-devel@lists.libcamera.org Date: Thu, 19 Jan 2023 10:45:33 +0000 Message-Id: <20230119104544.9456-4-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230119104544.9456-1-naush@raspberrypi.com> References: <20230119104544.9456-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v1 03/14] pipeline: ipa: raspberrypi: Replace entityControls 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 Cc: Nick Hollinghurst Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Replace the legacy entityControls map passed into ipa::configure() with explicit fields for sensor and ISP controls. This removes any ambiguity over which set of controls corresponds with specific integer keys. Signed-off-by: Naushir Patuck Reviewed-by: Nick Hollinghurst Reviewed-by: David Plowman --- include/libcamera/ipa/raspberrypi.mojom | 4 ++-- src/ipa/raspberrypi/raspberrypi.cpp | 17 ++++------------- .../pipeline/raspberrypi/raspberrypi.cpp | 7 +++---- 3 files changed, 9 insertions(+), 19 deletions(-) diff --git a/include/libcamera/ipa/raspberrypi.mojom b/include/libcamera/ipa/raspberrypi.mojom index 0732496968ed..2a4821fbc0ef 100644 --- a/include/libcamera/ipa/raspberrypi.mojom +++ b/include/libcamera/ipa/raspberrypi.mojom @@ -36,6 +36,8 @@ struct ISPConfig { struct IPAConfig { uint32 transform; libcamera.SharedFD lsTableHandle; + libcamera.ControlInfoMap sensorControls; + libcamera.ControlInfoMap ispControls; }; struct IPAConfigResult { @@ -59,7 +61,6 @@ interface IPARPiInterface { * \fn configure() * \brief Configure the IPA stream and sensor settings * \param[in] sensorInfo Camera sensor information - * \param[in] entityControls Controls provided by the pipeline entities * \param[in] ipaConfig Pipeline-handler-specific configuration data * \param[out] controls Controls to apply by the pipeline entity * \param[out] result Other results that the pipeline handler may require @@ -74,7 +75,6 @@ interface IPARPiInterface { * pipeline handler to the IPA and back. */ configure(libcamera.IPACameraSensorInfo sensorInfo, - map entityControls, IPAConfig ipaConfig) => (int32 ret, libcamera.ControlList controls, IPAConfigResult result); diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp index f748b6e2dac7..aa18ed750370 100644 --- a/src/ipa/raspberrypi/raspberrypi.cpp +++ b/src/ipa/raspberrypi/raspberrypi.cpp @@ -119,9 +119,7 @@ public: void start(const ControlList &controls, StartConfig *startConfig) override; void stop() override {} - int configure(const IPACameraSensorInfo &sensorInfo, - const std::map &entityControls, - const IPAConfig &data, + int configure(const IPACameraSensorInfo &sensorInfo, const IPAConfig &data, ControlList *controls, IPAConfigResult *result) override; void mapBuffers(const std::vector &buffers) override; void unmapBuffers(const std::vector &ids) override; @@ -380,18 +378,11 @@ void IPARPi::setMode(const IPACameraSensorInfo &sensorInfo) mode_.sensitivity = helper_->getModeSensitivity(mode_); } -int IPARPi::configure(const IPACameraSensorInfo &sensorInfo, - const std::map &entityControls, - const IPAConfig &ipaConfig, +int IPARPi::configure(const IPACameraSensorInfo &sensorInfo, const IPAConfig &ipaConfig, ControlList *controls, IPAConfigResult *result) { - if (entityControls.size() != 2) { - LOG(IPARPI, Error) << "No ISP or sensor controls found."; - return -1; - } - - sensorCtrls_ = entityControls.at(0); - ispCtrls_ = entityControls.at(1); + sensorCtrls_ = ipaConfig.sensorControls; + ispCtrls_ = ipaConfig.ispControls; if (!validateSensorControls()) { LOG(IPARPI, Error) << "Sensor control validation failed."; diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp index 272767b5263b..9dd36cbaea78 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -1615,8 +1615,8 @@ int RPiCameraData::configureIPA(const CameraConfiguration *config, ipa::RPi::IPA std::map entityControls; ipa::RPi::IPAConfig ipaConfig; - entityControls.emplace(0, sensor_->controls()); - entityControls.emplace(1, isp_[Isp::Input].dev()->controls()); + ipaConfig.sensorControls = sensor_->controls(); + ipaConfig.ispControls = isp_[Isp::Input].dev()->controls(); /* Always send the user transform to the IPA. */ ipaConfig.transform = static_cast(config->transform); @@ -1644,8 +1644,7 @@ int RPiCameraData::configureIPA(const CameraConfiguration *config, ipa::RPi::IPA /* Ready the IPA - it must know about the sensor resolution. */ ControlList controls; - ret = ipa_->configure(sensorInfo_, entityControls, ipaConfig, - &controls, result); + ret = ipa_->configure(sensorInfo_, ipaConfig, &controls, result); if (ret < 0) { LOG(RPI, Error) << "IPA configuration failed!"; return -EPIPE;