{"id":11663,"url":"https://patchwork.libcamera.org/api/patches/11663/?format=json","web_url":"https://patchwork.libcamera.org/patch/11663/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/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":"<20210323122739.680560-7-naush@raspberrypi.com>","date":"2021-03-23T12:27:38","name":"[libcamera-devel,v2,6/7] ipa: raspberrypi: Rationalise parameters to ipa::start()","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"754fc4df8e3c826b1f6485d165995fd563d0db6d","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/?format=json","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/11663/mbox/","series":[{"id":1821,"url":"https://patchwork.libcamera.org/api/series/1821/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1821","date":"2021-03-23T12:27:32","name":"Raspberry Pi: ipa::init() restructuring","version":2,"mbox":"https://patchwork.libcamera.org/series/1821/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/11663/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/11663/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 325E4C32E5\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 23 Mar 2021 12:27:55 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B90B468D75;\n\tTue, 23 Mar 2021 13:27:54 +0100 (CET)","from mail-ed1-x534.google.com (mail-ed1-x534.google.com\n\t[IPv6:2a00:1450:4864:20::534])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0D6D668D63\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 23 Mar 2021 13:27:50 +0100 (CET)","by mail-ed1-x534.google.com with SMTP id e7so23158316edu.10\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 23 Mar 2021 05:27:50 -0700 (PDT)","from naush-laptop.patuck.local ([88.97.76.4])\n\tby smtp.gmail.com with ESMTPSA id\n\tu13sm11082295ejy.31.2021.03.23.05.27.48\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 23 Mar 2021 05:27:49 -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=\"L7HSBC7B\"; 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=6qT0xpw199Qo1K/XH0auRp8A0Asf+uacqMTPUf1Eap0=;\n\tb=L7HSBC7BmRs8vwKBz3ULs0qkUhZKds4NPSAFXITh0NPDLva3j1DphwdMV5AYQbBVT0\n\tD5/6loT/tIGm/PMf0OJOKGxXPHm9+wbK4OvO1sTrOD5gUCoz7Gh9hv4BXuG08JOkDWQx\n\tGIbAr9BgUYaBpD5hVQXcf8pAOIybgS+sbc3wkQlsHiJqz64BfTHJI1wp5nLf6Dw70YIk\n\t67z8MAhJd5ywTmI1QeQGwWIjAvoAu2VcsHqu3LgFhpF4U+OZr6xzTKEAAzQNggeBBqt6\n\tYfsjTXzgSEdw5DG/UtW9aEevxHj2p5CcaikiMDS/+Sq+lMRzOYqvaWXB7H4s1oNKw3CW\n\tXz3Q==","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=6qT0xpw199Qo1K/XH0auRp8A0Asf+uacqMTPUf1Eap0=;\n\tb=lrELRiWmPv1hLRz9Oo4A+mcOcbWNHEWOTIPQP58Dp2hPW0JV+gOhh0nnEc8om13CUk\n\tUaaMwo+sMkWtHMEv0lxt9qkjybaBdSYQAui+bYgpC6RlyRs+1o9yk9IKvb+aa3Nkt7w/\n\tz6+1kQVuWhA43fKtBW0hsarJ1HnLfZb50AGICn/NdZ1gvmt/0eBgnuGiMdfweOtpW0cX\n\ty3X8R+nxJSEt+URDSlHV/9GO0x5mCh+o4k23UncA0WorQuV/mEVkJ1a4TvboEYUCoQkv\n\t0ZnSTkUnwJsvSK9xmriRNxiDUgbEsCozOUA7FLOpjrwbzKdxFjOd+RHdfKId54M3qGVN\n\ta+VA==","X-Gm-Message-State":"AOAM533znKr+um80G/1uJfxgO45QdAKilAoATqDwqCzQdbOiw+wLr2hg\n\t7LPKYTM4lOTaOReIMq7ArWJGspO2K0KNRA==","X-Google-Smtp-Source":"ABdhPJwVstSz+Gt8arui1MX5HiQ4dLMeEueJMsMfqSM8xmQiQJGx44KUSu5cTfCIvVHRk1QguiaUew==","X-Received":"by 2002:aa7:c14a:: with SMTP id\n\tr10mr4218914edp.132.1616502469398; \n\tTue, 23 Mar 2021 05:27:49 -0700 (PDT)","From":"Naushir Patuck <naush@raspberrypi.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Tue, 23 Mar 2021 12:27:38 +0000","Message-Id":"<20210323122739.680560-7-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.25.1","In-Reply-To":"<20210323122739.680560-1-naush@raspberrypi.com>","References":"<20210323122739.680560-1-naush@raspberrypi.com>","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH v2 6/7] ipa: raspberrypi: Rationalise\n\tparameters to ipa::start()","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":"Separate out the in and out parameters in ipa::start() as they are not\nthe same. This function now takes in a ControlList and returns out a\nstruct StartConfig which holds a ControlList and drop frame count for\nthe pipeline handler to action.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\nTested-by: David Plowman <david.plowman@raspberrypi.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n include/libcamera/ipa/raspberrypi.mojom          |  4 ++--\n src/ipa/raspberrypi/raspberrypi.cpp              | 16 +++++++---------\n .../pipeline/raspberrypi/raspberrypi.cpp         | 15 +++++----------\n 3 files changed, 14 insertions(+), 21 deletions(-)","diff":"diff --git a/include/libcamera/ipa/raspberrypi.mojom b/include/libcamera/ipa/raspberrypi.mojom\nindex fafbd6c0cff3..55824eebb700 100644\n--- a/include/libcamera/ipa/raspberrypi.mojom\n+++ b/include/libcamera/ipa/raspberrypi.mojom\n@@ -39,14 +39,14 @@ struct ConfigOutput {\n \tControlList controls;\n };\n \n-struct StartControls {\n+struct StartConfig {\n \tControlList controls;\n \tint32 dropFrameCount;\n };\n \n interface IPARPiInterface {\n \tinit(IPASettings settings) => (int32 ret, SensorConfig sensorConfig);\n-\tstart(StartControls controls) => (StartControls result);\n+\tstart(ControlList controls) => (StartConfig startConfig);\n \tstop();\n \n \t/**\ndiff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp\nindex 93e43f0626fb..b717a83e14b5 100644\n--- a/src/ipa/raspberrypi/raspberrypi.cpp\n+++ b/src/ipa/raspberrypi/raspberrypi.cpp\n@@ -79,8 +79,7 @@ public:\n \t}\n \n \tint init(const IPASettings &settings, ipa::RPi::SensorConfig *sensorConfig) override;\n-\tvoid start(const ipa::RPi::StartControls &data,\n-\t\t   ipa::RPi::StartControls *result) override;\n+\tvoid start(const ControlList &controls, ipa::RPi::StartConfig *startConfig) override;\n \tvoid stop() override {}\n \n \tint configure(const CameraSensorInfo &sensorInfo,\n@@ -192,15 +191,14 @@ int IPARPi::init(const IPASettings &settings, ipa::RPi::SensorConfig *sensorConf\n \treturn 0;\n }\n \n-void IPARPi::start(const ipa::RPi::StartControls &data,\n-\t\t   ipa::RPi::StartControls *result)\n+void IPARPi::start(const ControlList &controls, ipa::RPi::StartConfig *startConfig)\n {\n \tRPiController::Metadata metadata;\n \n-\tASSERT(result);\n-\tif (!data.controls.empty()) {\n+\tASSERT(startConfig);\n+\tif (!controls.empty()) {\n \t\t/* We have been given some controls to action before start. */\n-\t\tqueueRequest(data.controls);\n+\t\tqueueRequest(controls);\n \t}\n \n \tcontroller_.SwitchMode(mode_, &metadata);\n@@ -215,7 +213,7 @@ void IPARPi::start(const ipa::RPi::StartControls &data,\n \tif (agcStatus.shutter_time != 0.0 && agcStatus.analogue_gain != 0.0) {\n \t\tControlList ctrls(sensorCtrls_);\n \t\tapplyAGC(&agcStatus, ctrls);\n-\t\tresult->controls = std::move(ctrls);\n+\t\tstartConfig->controls = std::move(ctrls);\n \t}\n \n \t/*\n@@ -262,7 +260,7 @@ void IPARPi::start(const ipa::RPi::StartControls &data,\n \t\tmistrustCount_ = helper_->MistrustFramesModeSwitch();\n \t}\n \n-\tresult->dropFrameCount = dropFrame;\n+\tstartConfig->dropFrameCount = dropFrame;\n \n \tfirstStart_ = false;\n }\ndiff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex 4a3f7cbe3065..1e4861a0c121 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -815,20 +815,15 @@ int PipelineHandlerRPi::start(Camera *camera, const ControlList *controls)\n \t\tdata->applyScalerCrop(*controls);\n \n \t/* Start the IPA. */\n-\tipa::RPi::StartControls ipaData;\n-\tipa::RPi::StartControls result;\n-\tif (controls)\n-\t\tipaData.controls = *controls;\n-\tdata->ipa_->start(ipaData, &result);\n+\tipa::RPi::StartConfig startConfig;\n+\tdata->ipa_->start(controls ? *controls : ControlList{}, &startConfig);\n \n \t/* Apply any gain/exposure settings that the IPA may have passed back. */\n-\tif (!result.controls.empty()) {\n-\t\tControlList &ctrls = result.controls;\n-\t\tdata->unicam_[Unicam::Image].dev()->setControls(&ctrls);\n-\t}\n+\tif (!startConfig.controls.empty())\n+\t\tdata->unicam_[Unicam::Image].dev()->setControls(&startConfig.controls);\n \n \t/* Configure the number of dropped frames required on startup. */\n-\tdata->dropFrameCount_ = result.dropFrameCount;\n+\tdata->dropFrameCount_ = startConfig.dropFrameCount;\n \n \t/* We need to set the dropFrameCount_ before queueing buffers. */\n \tret = queueAllBuffers(camera);\n","prefixes":["libcamera-devel","v2","6/7"]}