{"id":16488,"url":"https://patchwork.libcamera.org/api/patches/16488/?format=json","web_url":"https://patchwork.libcamera.org/patch/16488/","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":"<20220630143543.39599-7-dse@thaumatec.com>","date":"2022-06-30T14:35:41","name":"[libcamera-devel,6/8] ipa: rkisp1: Pass requests setting AF controls to the AF algorithm","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"3638d38d5d8dfb6ae62f2c96ac00136a51a04b6a","submitter":{"id":126,"url":"https://patchwork.libcamera.org/api/people/126/?format=json","name":"Daniel Semkowicz","email":"dse@thaumatec.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/16488/mbox/","series":[{"id":3239,"url":"https://patchwork.libcamera.org/api/series/3239/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3239","date":"2022-06-30T14:35:35","name":"ipa: rkisp1: Add autofocus algorithm","version":1,"mbox":"https://patchwork.libcamera.org/series/3239/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/16488/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/16488/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 0D379BE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 30 Jun 2022 14:36:05 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B1A996564E;\n\tThu, 30 Jun 2022 16:36:04 +0200 (CEST)","from mail-wm1-x335.google.com (mail-wm1-x335.google.com\n\t[IPv6:2a00:1450:4864:20::335])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6E55F65657\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 30 Jun 2022 16:36:01 +0200 (CEST)","by mail-wm1-x335.google.com with SMTP id\n\to16-20020a05600c379000b003a02eaea815so2751580wmr.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 30 Jun 2022 07:36:01 -0700 (PDT)","from localhost.localdomain (ip092042140082.rev.nessus.at.\n\t[92.42.140.82]) by smtp.gmail.com with ESMTPSA id\n\tr5-20020a05600c320500b0039db500714fsm6405945wmp.6.2022.06.30.07.36.00\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 30 Jun 2022 07:36:00 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1656599764;\n\tbh=8AicMXYKV9hDctL83gvVRZlocz4NCdSpDdvYqi6X+ME=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=sBgclG8RGyPStTxsJGpAL8e1wiNqpp+6z6BGgp+gt17JpduxgNx3nv3lMi2t5qODb\n\tr3G1ycs8f6ZmPdUF3aBS0STsTgbjYy6SupjekMYyKJ3JXYTpFPS/AmwTEPdUEeM/8z\n\t0PdcwiGpRj1lS30SaTHB6oMTsVR+B0dpTQfrXJyWmFAWTKZrSXf5BnseAt1Qg8IqEP\n\tPY0wUW8CVjSIMU6Rs+C6bRRqV7jcRVFFDeOq6br7VH4PiWyRuK5Rzb+ctP9eCy8fTo\n\t2WCVhwF+NtgSdw+iunkvzx4D9NvBEzxquvaOwrHChXgqwwoqmnv2FqxXh9vUYLF2IG\n\tf5zF3c3yUvH1g==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=thaumatec-com.20210112.gappssmtp.com; s=20210112;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=WLYgX0MOK5dxYWvj13HoLuJzqbo6TzjvgYk9MSezfsA=;\n\tb=hVQ5qB/QYpBBC4/0Hjj+Q/EUKDKXy4OXGVAQTdBaEjNysa59hmG5dbrpA8AXhDxEcm\n\toGMDtorol7AZMesjJ4Vu3C2ctrMOXPUvPkZxwbcXw39kMmilaSi020n0e9PAYzRt8zRJ\n\tfUBACUkgnCrGed/C3hEI3Ycrfc/FJT7gKlcNU8rOzKSkTAcuXwjnSBQdLwJtv0Vgs0Yu\n\tAztsuUJPPaj5X6WsfNwqww/4pym7uzKX5bOXhov4g2o2GrsTSLxq7x8caLrJ5aGP9W1E\n\ti8QbTOYWFI4V5cDQ7eIE7/TvtW7T2ObfFPOWxUjVtIzVU5bSjUqF/szsIqZdVOCAikD5\n\tCkhA=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected)\n\theader.d=thaumatec-com.20210112.gappssmtp.com\n\theader.i=@thaumatec-com.20210112.gappssmtp.com header.b=\"hVQ5qB/Q\"; \n\tdkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\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=WLYgX0MOK5dxYWvj13HoLuJzqbo6TzjvgYk9MSezfsA=;\n\tb=nYiU6bgogYNv1Fh237v4RRbMRBqsCpXTR/nWqvhv0CtWpda1Xf1nug8DhitOmU4PDR\n\tTtrc7bQrcsj9Ub1p2SLr9jcindNm1w6OzL6LaWyfmXgKTuxC/VXzqGxz2tx0ZyBanaIf\n\tzCpOTQLssi9HqG4mzQOFsQMa+Jy9OQCY/cDnhVYwMMJAXk5/ie0IWHbbUjzcZC62lhC3\n\t5aMdNSYN9Vd7sA91ngFfsIkpKexmtsVgtQmXEG+/Wt9loZ8CqTzT8j6t8AwH83SSpOW0\n\tvu2xly7KajHMVCgMT3gQFASMnsNF3dOwiLVL2Xcr6mOExf6/2GeDY0DHYtBph/CaAHw2\n\t75Nw==","X-Gm-Message-State":"AJIora+iPFetd5xsEJKVlv8w+eHphXZlo+06HKLz2PA9+PjbNH1OCt0c\n\tbAxnbqrQ3tGr1whSEsy1ITlral8ftI7Qgw==","X-Google-Smtp-Source":"AGRyM1ujyMr63jZD745Vx9rWXilAiRp06oj9CHO5tnf7+on1a2znNB+hXVsOHOviTb/joSkL0C9aRw==","X-Received":"by 2002:a7b:c003:0:b0:39c:5642:e415 with SMTP id\n\tc3-20020a7bc003000000b0039c5642e415mr12198498wmb.111.1656599761227; \n\tThu, 30 Jun 2022 07:36:01 -0700 (PDT)","To":"libcamera-devel@lists.libcamera.org","Date":"Thu, 30 Jun 2022 16:35:41 +0200","Message-Id":"<20220630143543.39599-7-dse@thaumatec.com>","X-Mailer":"git-send-email 2.34.1","In-Reply-To":"<20220630143543.39599-1-dse@thaumatec.com>","References":"<20220630143543.39599-1-dse@thaumatec.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 6/8] ipa: rkisp1: Pass requests setting AF\n\tcontrols to the AF algorithm","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>","From":"Daniel Semkowicz via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Daniel Semkowicz <dse@thaumatec.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Pass the controls set by top level API to the AF algorithm if it\nwas enabled.\n\nSigned-off-by: Daniel Semkowicz <dse@thaumatec.com>\n---\n src/ipa/rkisp1/rkisp1.cpp | 52 +++++++++++++++++++++++++++++++++++++--\n 1 file changed, 50 insertions(+), 2 deletions(-)","diff":"diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\nindex 01bb54fb..53b53f12 100644\n--- a/src/ipa/rkisp1/rkisp1.cpp\n+++ b/src/ipa/rkisp1/rkisp1.cpp\n@@ -28,6 +28,7 @@\n #include \"libcamera/internal/mapped_framebuffer.h\"\n #include \"libcamera/internal/yaml_parser.h\"\n \n+#include \"algorithms/af.h\"\n #include \"algorithms/agc.h\"\n #include \"algorithms/algorithm.h\"\n #include \"algorithms/awb.h\"\n@@ -295,9 +296,56 @@ void IPARkISP1::unmapBuffers(const std::vector<unsigned int> &ids)\n }\n \n void IPARkISP1::queueRequest([[maybe_unused]] const uint32_t frame,\n-\t\t\t     [[maybe_unused]] const ControlList &controls)\n+\t\t\t     const ControlList &controls)\n {\n-\t/* \\todo Start processing for 'frame' based on 'controls'. */\n+\tusing namespace algorithms;\n+\n+\tfor (auto const &ctrl : controls) {\n+\t\tunsigned int ctrlEnum = ctrl.first;\n+\t\tconst ControlValue &ctrlValue = ctrl.second;\n+\n+\t\tLOG(IPARkISP1, Debug) << \"Request ctrl: \"\n+\t\t\t\t      << controls::controls.at(ctrlEnum)->name()\n+\t\t\t\t      << \" = \" << ctrlValue.toString();\n+\n+\t\tswitch (ctrlEnum) {\n+\t\tcase controls::AF_MODE: {\n+\t\t\tAf *af = getAlgorithm<Af>();\n+\t\t\tif (!af) {\n+\t\t\t\tLOG(IPARkISP1, Warning) << \"Could not set AF_MODE - no AF algorithm\";\n+\t\t\t\tbreak;\n+\t\t\t}\n+\n+\t\t\taf->setMode(static_cast<controls::AfModeEnum>(ctrlValue.get<int32_t>()));\n+\t\t\tbreak;\n+\t\t}\n+\t\tcase controls::AF_TRIGGER: {\n+\t\t\tAf *af = getAlgorithm<Af>();\n+\t\t\tif (!af) {\n+\t\t\t\tLOG(IPARkISP1, Warning) << \"Could not set AF_TRIGGER - no AF algorithm\";\n+\t\t\t\tbreak;\n+\t\t\t}\n+\n+\t\t\taf->setTrigger(static_cast<controls::AfTriggerEnum>(ctrlValue.get<int32_t>()));\n+\t\t\tbreak;\n+\t\t}\n+\t\tcase controls::AF_PAUSE: {\n+\t\t\tAf *af = getAlgorithm<Af>();\n+\t\t\tif (!af) {\n+\t\t\t\tLOG(IPARkISP1, Warning) << \"Could not set AF_TRIGGER - no AF algorithm\";\n+\t\t\t\tbreak;\n+\t\t\t}\n+\n+\t\t\taf->setPause(static_cast<controls::AfPauseEnum>(ctrlValue.get<int32_t>()));\n+\t\t\tbreak;\n+\t\t}\n+\t\tdefault:\n+\t\t\tLOG(IPARkISP1, Warning)\n+\t\t\t\t<< \"Ctrl \" << controls::controls.at(ctrlEnum)->name()\n+\t\t\t\t<< \" is not handled.\";\n+\t\t\tbreak;\n+\t\t}\n+\t}\n }\n \n void IPARkISP1::fillParamsBuffer(const uint32_t frame, const uint32_t bufferId)\n","prefixes":["libcamera-devel","6/8"]}