{"id":11672,"url":"https://patchwork.libcamera.org/api/1.1/patches/11672/?format=json","web_url":"https://patchwork.libcamera.org/patch/11672/","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":"<20210323143610.787760-7-naush@raspberrypi.com>","date":"2021-03-23T14:36:09","name":"[libcamera-devel,v3,6/7] ipa: raspberrypi: Rationalise parameters to ipa::start()","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"754fc4df8e3c826b1f6485d165995fd563d0db6d","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/11672/mbox/","series":[{"id":1823,"url":"https://patchwork.libcamera.org/api/1.1/series/1823/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1823","date":"2021-03-23T14:36:03","name":"Raspberry Pi: ipa::init() restructuring","version":3,"mbox":"https://patchwork.libcamera.org/series/1823/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/11672/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/11672/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 0FF72C32E5\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 23 Mar 2021 14:36:26 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9B6EF68D85;\n\tTue, 23 Mar 2021 15:36:25 +0100 (CET)","from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com\n\t[IPv6:2a00:1450:4864:20::62d])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A7CCA68D7D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 23 Mar 2021 15:36:22 +0100 (CET)","by mail-ej1-x62d.google.com with SMTP id jy13so27456033ejc.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 23 Mar 2021 07:36:22 -0700 (PDT)","from naush-laptop.patuck.local ([88.97.76.4])\n\tby smtp.gmail.com with ESMTPSA id\n\tn6sm11282430eji.37.2021.03.23.07.36.21\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 23 Mar 2021 07:36:21 -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=\"A3D5AS8z\"; 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=wLRxumWPRLBVEvwTd/U5tZ0D639aXVHsrXNw8yQchI4=;\n\tb=A3D5AS8zkIYYMyMq9UP1MGhqG492pS4EQXDpDNBr9SBuRb6zjBy/2eBQ0P7UZjen6X\n\tcicRhfbhCLc/7oTlGGDYQ4x2l8qCMjwyCN7uRFlZSh6cpHJlypg3wZEdyWrtFQ7OdjLv\n\tcXVzC4N6KCX84FsiP5Iy4vLj443iAgtH9d6X+8tpB8Kw4VbKoP4VncueMxTTQv3HOrWD\n\tPOgBsnosOpLwCQ/rMV7SmBSdUQs2LAXfPwTBKDrG9w+qppkv8ZlSgCq9qkxOLuoCbsXJ\n\tied6bSVozfTMCwJE3gyZtccjdCiBw6qRjF5UIaO0ogeHu1V1s12sozyDuElfz5U+Yovn\n\twE+w==","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=wLRxumWPRLBVEvwTd/U5tZ0D639aXVHsrXNw8yQchI4=;\n\tb=QXfuunBwmvSc3n755kVNsVafQuqke9KSMl8AvfzvM9QmvBF7+j4fewVpMFzW+9InIP\n\tbj58p6wqS7EpF7sfNUUDuDJUbA55eAQCdW+Aovs2lULx3n7mRvuzYY+jBfsj8nmIy2cg\n\tJQSahLl8xQf0a52n9mkZm4a4rNUMdOBjkw3fqzNtdmAwfk0NiI/25yhJoIL0A7pL5ot3\n\tAx12UmFAKeaTE/wwoitSBjCb8ChGOckpyGp2qub8NRfwfN0iUt5pVKWpTnvJv5+AFa/Z\n\tCjHWCLG+JddT+E7R2/5K6VCl3w1e431if8BU4FyfmvW2dQK753P1ROojAWfwW570FN3D\n\tHRAw==","X-Gm-Message-State":"AOAM533yhgMG1+sW2ZnzzAzghtl5B/ucVZfqKngm/tzA9r6VARyDGSkT\n\t4/szD83FnhOKob2rkEuXVgbc16L5zQ9+AA==","X-Google-Smtp-Source":"ABdhPJyz6VLYGraO3htHiR7xGlhocD75K1Omrc0wOyTfG+Gma8eaD5GF6DykWIQfOMnMSuKaMioKLg==","X-Received":"by 2002:a17:907:720a:: with SMTP id\n\tdr10mr5162634ejc.375.1616510182034; \n\tTue, 23 Mar 2021 07:36:22 -0700 (PDT)","From":"Naushir Patuck <naush@raspberrypi.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Tue, 23 Mar 2021 14:36:09 +0000","Message-Id":"<20210323143610.787760-7-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.25.1","In-Reply-To":"<20210323143610.787760-1-naush@raspberrypi.com>","References":"<20210323143610.787760-1-naush@raspberrypi.com>","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH v3 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 ed8cc4ead771..a65d53898362 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","v3","6/7"]}