From patchwork Mon Jan 23 15:49:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 18178 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 6F20FBEFBE for ; Mon, 23 Jan 2023 15:49:54 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id CEFA9625EE; Mon, 23 Jan 2023 16:49:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1674488992; 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=v0DOmZNl7nAOqU5c04w4uTvBlI8AlWytRkUqe2yVT0vphmY6ML9yKIquMpjHZXMId l1dNncS6Lcfzk0hxdskTmJc311sXt5aqGhQW2LdsOoN4ErQMGIwE//5DbxtDGMMKj3 sOV+vo/gAmKJ5bUaVMhOIqvyLZJb/HeK4H+2r0e0YYncOJwIYtloKfUYf+J2Zrrqod oDDQRCvfxYXteq19xhixR2ZEBRPcmXpvRnBglg5bKjN51fEsT6SmclpUaK3eHI0JHk bkOOfjXrCR0RO6C1CEeF/44g568NeutCSy8LKOx8VjafEQvLM0QYAYxid/6Unoykf6 Fducx15+5Rohg== Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9959E625D8 for ; Mon, 23 Jan 2023 16:49:49 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="rzco2uSL"; dkim-atps=neutral Received: by mail-wm1-x32d.google.com with SMTP id m15so9369177wms.4 for ; Mon, 23 Jan 2023 07:49:49 -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=rzco2uSLzQhu5bETsCie4Lt7cps+kM9mbYk4RkLOCNSEku0GoB3HAVvkcNi6pYWFS8 ivh+eSykBrWZUtgylSz68yS/i42FwY4+0nbwzhGqMosAvww6QNtLK9xE2lDDSa4M6XYE TFZrVcz754kgmTbS2waSCwODfJhfMPM8yPLQ1PehgKHOm15o6PJhQ87koI7sErLTYMaP EGqpUDUKQ4QoVtlyCKc6Ud6HwPKLEJs65zzC7U+UD1gft7dUIrwn70zi9jj801gff3CU i4NLOp+jKSXTVM5PTzZqKxlG3s6yT0f+acqlgZbj0CTFsVFnoQz8DQMqEJj5kOeEvK9b q35A== 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=cgueY9FTRgxd/K50dLCTwTjoqbiZY1objKVr+2BPvOQ8CyuKCGSKecvVSL5W43QKbg McHLJbU4aCRWZ6ibgLSlbUeLbx7kwqJSL2n2FnIeAKszD7KaQDKPMH6m6guskvWY8liE 2/vT376IAZ9tVcTbopKomThDVdPqINSMNsUTp66huSUv1zpiit82pPBg0x2KXi5gVe7l PpA9WhmefYAtpRMWNiZph48raYL8xlFiLhUt9+xoQsd8mkZg7u+W8UHXk+xVQAp7hsEm LsTVHAHcTZ7MJdOGKEhcfWJYAShHDDEhVqZ5aZPYdhPgvBYx+UAa49fBMtU8pUQWergA arnw== X-Gm-Message-State: AFqh2krxqNQi6peF+6cXHTFwrKtc9326bI/mXukoQIQhK5Rkra49e9hf UdqqF2/XQHrtdgDn+77qnZcWYjBoKLRJXFdzFgI= X-Google-Smtp-Source: AMrXdXuX1Q3Eko8QuPj/F7vOZKavApiRSJxVLuj5cVzNnNN5A5f4mH/FZ5lXwz8cAmRQfAN7H+FAhw== X-Received: by 2002:a05:600c:5028:b0:3db:1dea:75c9 with SMTP id n40-20020a05600c502800b003db1dea75c9mr16531071wmr.28.1674488989077; Mon, 23 Jan 2023 07:49:49 -0800 (PST) Received: from localhost.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id n16-20020a05600c181000b003d1de805de5sm10339689wmp.16.2023.01.23.07.49.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jan 2023 07:49:48 -0800 (PST) To: libcamera-devel@lists.libcamera.org Date: Mon, 23 Jan 2023 15:49:23 +0000 Message-Id: <20230123154934.27803-4-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230123154934.27803-1-naush@raspberrypi.com> References: <20230123154934.27803-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 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;