{"id":11606,"url":"https://patchwork.libcamera.org/api/1.1/patches/11606/?format=json","web_url":"https://patchwork.libcamera.org/patch/11606/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20210317100211.1067585-8-naush@raspberrypi.com>","date":"2021-03-17T10:02:11","name":"[libcamera-devel,7/7] ipa: raspberrypi: Rationalise parameters to ipa::configure()","commit_ref":null,"pull_url":null,"state":"changes-requested","archived":false,"hash":"9d5362d96893b0d12333debd117d1585080799da","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/1.1/people/34/?format=json","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/11606/mbox/","series":[{"id":1799,"url":"https://patchwork.libcamera.org/api/1.1/series/1799/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1799","date":"2021-03-17T10:02:06","name":"Raspberry Pi: ipa::init() restructuring","version":1,"mbox":"https://patchwork.libcamera.org/series/1799/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/11606/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/11606/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 94A6ABD80C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 17 Mar 2021 10:02:29 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 514F668D66;\n\tWed, 17 Mar 2021 11:02:29 +0100 (CET)","from mail-ej1-x635.google.com (mail-ej1-x635.google.com\n\t[IPv6:2a00:1450:4864:20::635])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 610C968D61\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 17 Mar 2021 11:02:24 +0100 (CET)","by mail-ej1-x635.google.com with SMTP id si25so1614408ejb.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 17 Mar 2021 03:02:24 -0700 (PDT)","from naush-laptop.patuck.local ([88.97.76.4])\n\tby smtp.gmail.com with ESMTPSA id\n\tp24sm12061179edt.5.2021.03.17.03.02.22\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 17 Mar 2021 03:02:23 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"IWb8hKTm\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=pWK9zy4d291lt9BeUusdrPtxdNtadrrurtsmDLh0kJQ=;\n\tb=IWb8hKTmtHtTwiulc6mf+ms9t4Yws8vFWHsAS9Vqow25MbMw6ECBMKfLE3VBXvIiaJ\n\tevO9R5F0T+L8w8JDyKIUT+OjEVJpZcBYzvTIIvBq97QgfKLTdTcOTwedTnqygjiP6GTU\n\tfiN79jfTe8MbVY95iNwcXbxlPRQKwYN6Il4ns9x6Zwrd7w3pjjFe83Y+nZlJnX/hhSN/\n\tn6eKfNVy9SgLccbYJgwX7GaRsGwenVhTzfh4Gk6GEB63RlZOQ+Sr1QueKsT6Mae63Oj1\n\t4a7R4ZKCZtPuDl2DQB9Y8dosxDWAdIIQrSDjTuaEV1ifotiKAXDkOKduluCUxiVuRi4r\n\t/4hg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=pWK9zy4d291lt9BeUusdrPtxdNtadrrurtsmDLh0kJQ=;\n\tb=EQGQrnlAzxKBsCzCXKLszuvFmLERvR5RchU9bMzSJqkX6j0FMA/Nhh1J26XfyRV8Ee\n\t0jtySelWByRqclnTSAFJUhq5lSve8qkBviLRRyoU+bvpgBlXjHa7Cn+3LYWWAdO7GsjD\n\tq37VDWPrm4w583KaekOdo5474iOyrDEyE9uqWn6vZY1KM6JCTjQuy+wJOv5OFIAWpn+v\n\trwSSJkH5MyipY7KV9zPFt6QCS0YmXMmMiRisbXN2Q3tH+Hn9FESfNNMqYM4w8LLmUCvU\n\tKgh4aJfF1ADw8m8gncpGrHsBgHaIq/ELLjPrvK2Wn4syBVal1tPsT2aqB1fwWifEdQq0\n\tj5rw==","X-Gm-Message-State":"AOAM533jkhUwHZ2GtQ+sU1Cp4nhoN6CdjmP7Mk9rPt10/Yn2dqYp4cn+\n\t73uIjlfgAk2WllDfWrRwtrEkjRJkPObQig==","X-Google-Smtp-Source":"ABdhPJwCB5NMcVUq66bzy8edhm65qrGXxi/iV9V3SEKnRj1r3jtbYLBTjKa01ZYJ3Zm7ovaUjO/h8w==","X-Received":"by 2002:a17:906:3b47:: with SMTP id\n\th7mr33982401ejf.377.1615975343782; \n\tWed, 17 Mar 2021 03:02:23 -0700 (PDT)","From":"Naushir Patuck <naush@raspberrypi.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Wed, 17 Mar 2021 10:02:11 +0000","Message-Id":"<20210317100211.1067585-8-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.25.1","In-Reply-To":"<20210317100211.1067585-1-naush@raspberrypi.com>","References":"<20210317100211.1067585-1-naush@raspberrypi.com>","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH 7/7] ipa: raspberrypi: Rationalise\n\tparameters to ipa::configure()","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Rename ConfigInput to IPAConfig to be more consistent with the naming,\nand remove ConfigInput::op, as it is never used.\n\nReplace ConfigOutput with a ControlList type, as that is the only return\ntype from ipa::configure().\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n---\n include/libcamera/ipa/raspberrypi.mojom          | 16 +++++-----------\n src/ipa/raspberrypi/raspberrypi.cpp              | 13 ++++++-------\n .../pipeline/raspberrypi/raspberrypi.cpp         | 13 +++++--------\n 3 files changed, 16 insertions(+), 26 deletions(-)","diff":"diff --git a/include/libcamera/ipa/raspberrypi.mojom b/include/libcamera/ipa/raspberrypi.mojom\nindex 7549397a27c4..f38c22611cc4 100644\n--- a/include/libcamera/ipa/raspberrypi.mojom\n+++ b/include/libcamera/ipa/raspberrypi.mojom\n@@ -29,17 +29,11 @@ struct ISPConfig {\n \tControlList controls;\n };\n \n-struct ConfigInput {\n-\tuint32 op;\n+struct IPAConfig {\n \tuint32 transform;\n \tFileDescriptor lsTableHandle;\n };\n \n-struct ConfigOutput {\n-\tuint32 params;\n-\tControlList controls;\n-};\n-\n struct StartConfig {\n \tControlList controls;\n \tint32 dropFrameCount;\n@@ -57,7 +51,7 @@ interface IPARPiInterface {\n \t * \\param[in] streamConfig Configuration of all active streams\n \t * \\param[in] entityControls Controls provided by the pipeline entities\n \t * \\param[in] ipaConfig Pipeline-handler-specific configuration data\n-\t * \\param[out] results Pipeline-handler-specific configuration result\n+\t * \\param[out] controls Controls to apply by the pipeline entity\n \t *\n \t * This method shall be called when the camera is configured to inform\n \t * the IPA of the camera's streams and the sensor settings.\n@@ -65,14 +59,14 @@ interface IPARPiInterface {\n \t * The \\a sensorInfo conveys information about the camera sensor settings that\n \t * the pipeline handler has selected for the configuration.\n \t *\n-\t * The \\a ipaConfig and \\a results parameters carry data passed by the\n+\t * The \\a ipaConfig and \\a controls parameters carry data passed by the\n \t * pipeline handler to the IPA and back.\n \t */\n \tconfigure(CameraSensorInfo sensorInfo,\n \t\t  map<uint32, IPAStream> streamConfig,\n \t\t  map<uint32, ControlInfoMap> entityControls,\n-\t\t  ConfigInput ipaConfig)\n-\t\t=> (int32 ret, ConfigOutput results);\n+\t\t  IPAConfig ipaConfig)\n+\t\t=> (int32 ret, ControlList controls);\n \n \t/**\n \t * \\fn mapBuffers()\ndiff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp\nindex 417a7922c3bd..1c928b72fbd0 100644\n--- a/src/ipa/raspberrypi/raspberrypi.cpp\n+++ b/src/ipa/raspberrypi/raspberrypi.cpp\n@@ -85,8 +85,8 @@ public:\n \tint configure(const CameraSensorInfo &sensorInfo,\n \t\t      const std::map<unsigned int, IPAStream> &streamConfig,\n \t\t      const std::map<unsigned int, ControlInfoMap> &entityControls,\n-\t\t      const ipa::RPi::ConfigInput &data,\n-\t\t      ipa::RPi::ConfigOutput *response) override;\n+\t\t      const ipa::RPi::IPAConfig &data,\n+\t\t      ControlList *controls) override;\n \tvoid mapBuffers(const std::vector<IPABuffer> &buffers) override;\n \tvoid unmapBuffers(const std::vector<unsigned int> &ids) override;\n \tvoid signalStatReady(const uint32_t bufferId) override;\n@@ -313,16 +313,14 @@ void IPARPi::setMode(const CameraSensorInfo &sensorInfo)\n int IPARPi::configure(const CameraSensorInfo &sensorInfo,\n \t\t      [[maybe_unused]] const std::map<unsigned int, IPAStream> &streamConfig,\n \t\t      const std::map<unsigned int, ControlInfoMap> &entityControls,\n-\t\t      const ipa::RPi::ConfigInput &ipaConfig,\n-\t\t      ipa::RPi::ConfigOutput *result)\n+\t\t      const ipa::RPi::IPAConfig &ipaConfig,\n+\t\t      ControlList *controls)\n {\n \tif (entityControls.size() != 2) {\n \t\tLOG(IPARPI, Error) << \"No ISP or sensor controls found.\";\n \t\treturn -1;\n \t}\n \n-\tresult->params = 0;\n-\n \tsensorCtrls_ = entityControls.at(0);\n \tispCtrls_ = entityControls.at(1);\n \n@@ -379,7 +377,8 @@ int IPARPi::configure(const CameraSensorInfo &sensorInfo,\n \t\tagcStatus.analogue_gain = DefaultAnalogueGain;\n \t\tapplyAGC(&agcStatus, ctrls);\n \n-\t\tresult->controls = std::move(ctrls);\n+\t\tASSERT(controls);\n+\t\t*controls = std::move(ctrls);\n \t}\n \n \treturn 0;\ndiff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex 16568d56f31c..1f8307a3c1c5 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -1240,7 +1240,7 @@ int RPiCameraData::configureIPA(const CameraConfiguration *config)\n \n \tstd::map<unsigned int, IPAStream> streamConfig;\n \tstd::map<unsigned int, ControlInfoMap> entityControls;\n-\tipa::RPi::ConfigInput ipaConfig;\n+\tipa::RPi::IPAConfig ipaConfig;\n \n \t/* Get the device format to pass to the IPA. */\n \tV4L2DeviceFormat sensorFormat;\n@@ -1283,19 +1283,16 @@ int RPiCameraData::configureIPA(const CameraConfiguration *config)\n \t}\n \n \t/* Ready the IPA - it must know about the sensor resolution. */\n-\tipa::RPi::ConfigOutput result;\n-\n+\tControlList controls;\n \tret = ipa_->configure(sensorInfo_, streamConfig, entityControls, ipaConfig,\n-\t\t\t      &result);\n+\t\t\t      &controls);\n \tif (ret < 0) {\n \t\tLOG(RPI, Error) << \"IPA configuration failed!\";\n \t\treturn -EPIPE;\n \t}\n \n-\tif (!result.controls.empty()) {\n-\t\tControlList &ctrls = result.controls;\n-\t\tunicam_[Unicam::Image].dev()->setControls(&ctrls);\n-\t}\n+\tif (!controls.empty())\n+\t\tunicam_[Unicam::Image].dev()->setControls(&controls);\n \n \t/*\n \t * Configure the H/V flip controls based on the combination of\n","prefixes":["libcamera-devel","7/7"]}