{"id":17562,"url":"https://patchwork.libcamera.org/api/patches/17562/?format=json","web_url":"https://patchwork.libcamera.org/patch/17562/","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":"<20221009044440.21499-2-laurent.pinchart@ideasonboard.com>","date":"2022-10-09T04:44:39","name":"[libcamera-devel,1/2] ipa: rkisp1: Drop use of utils::defopt","commit_ref":"603a4d60f6ac4dbc2474700943dd1a0066ee1f23","pull_url":null,"state":"accepted","archived":false,"hash":"77f3f51cc7ec1dadaea21342c2bfcbb2007e378c","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/17562/mbox/","series":[{"id":3543,"url":"https://patchwork.libcamera.org/api/series/3543/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3543","date":"2022-10-09T04:44:38","name":"libcamera: Fix compilation with gcc 8.3.0","version":1,"mbox":"https://patchwork.libcamera.org/series/3543/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/17562/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/17562/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 F1D4FBD16B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun,  9 Oct 2022 04:44:51 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B5A8D62D52;\n\tSun,  9 Oct 2022 06:44:51 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5758462D49\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun,  9 Oct 2022 06:44:48 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id AF3F79C4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun,  9 Oct 2022 06:44:47 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1665290691;\n\tbh=mboVyrXr+3MIU/mUf+w7XxCKHp0dSH6gPDbX4nn2D/M=;\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=l+H/+t1AnE8V7ll4xC0Yy0edYLS1wdvPW9JI17KCE7zuD2cA9fFbuBCXcEIup67dB\n\tchGCaLkCX7zbLB9SuNCUcQSb1VVOAaXK0mG9H+iOAxPQx9YYIUMkV2bBkYYrS1X+9V\n\tpTUEB4SgCoZibSmpDp2ogccBDwbASifWwMD4Ug/Gfi1l8MSMg0i0BKcGvmCIMpZTmy\n\tkQ9Xr82lONYYeKJ/ppFmYEdXFRwsBSUf7GKpHkHXMuczKJpndfQCmD1RRENJKuhXmc\n\tZA7Bk/oHS3qYG2oarZkuORIFkNthxEIVz8jTJ4AMgN0/woykF0+HKEuQg6daxrqMNE\n\tfqvAdhjFM4EXQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1665290687;\n\tbh=mboVyrXr+3MIU/mUf+w7XxCKHp0dSH6gPDbX4nn2D/M=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=tkf/MLA3+gKOw4YYHOaRf+v1vf7rz7Whg/eI/AlaRIyyEGKhEAafieMiuXW+Q2fmF\n\tvrVeu7POOCQvHiwLCs7fS9McnugQnw2JyBomEdovZ7WgT90QoPTZAOa96oDiXPtBQP\n\ti8CaEcvCesxxrberpse4dfqWe+T6+DgdtU3JkuT4="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"tkf/MLA3\"; dkim-atps=neutral","To":"libcamera-devel@lists.libcamera.org","Date":"Sun,  9 Oct 2022 07:44:39 +0300","Message-Id":"<20221009044440.21499-2-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.35.1","In-Reply-To":"<20221009044440.21499-1-laurent.pinchart@ideasonboard.com>","References":"<20221009044440.21499-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 1/2] ipa: rkisp1: Drop use of utils::defopt","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":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"utils::defopt causes compilation issues on gcc 8.0.0 to gcc 8.3.0,\nlikely due to bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86521\nthat was fixed in gcc 8.4.0. gcc 8.3.0 may be considered old (libcamera\nrequires gcc-8 or newer), but it is shipped by Debian 10 that has LTS\nsupport until mid-2024.\n\nAs no workaround has been found to fix compilation on gcc 8.3.0 while\nstill retaining the functionality of utils::defopt, stop using it in the\nRkISP1 IPA module.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/ipa/rkisp1/algorithms/dpf.cpp | 6 +++---\n src/ipa/rkisp1/algorithms/gsl.cpp | 8 ++++----\n src/ipa/rkisp1/algorithms/lsc.cpp | 4 ++--\n 3 files changed, 9 insertions(+), 9 deletions(-)","diff":"diff --git a/src/ipa/rkisp1/algorithms/dpf.cpp b/src/ipa/rkisp1/algorithms/dpf.cpp\nindex 82d4f7fecc67..5bd7e59f651c 100644\n--- a/src/ipa/rkisp1/algorithms/dpf.cpp\n+++ b/src/ipa/rkisp1/algorithms/dpf.cpp\n@@ -70,7 +70,7 @@ int Dpf::init([[maybe_unused]] IPAContext &context,\n \t *    +---------|--------> X\n \t *     -4....-1 0 1 2 3 4\n \t */\n-\tvalues = dFObject[\"g\"].getList<uint8_t>().value_or(utils::defopt);\n+\tvalues = dFObject[\"g\"].getList<uint8_t>().value_or(std::vector<uint8_t>{});\n \tif (values.size() != RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS) {\n \t\tLOG(RkISP1Dpf, Error)\n \t\t\t<< \"Invalid 'DomainFilter:g': expected \"\n@@ -106,7 +106,7 @@ int Dpf::init([[maybe_unused]] IPAContext &context,\n \t * For a 9x9 kernel, columns -6 and 6 are dropped, so coefficient\n \t * number 6 is not used.\n \t */\n-\tvalues = dFObject[\"rb\"].getList<uint8_t>().value_or(utils::defopt);\n+\tvalues = dFObject[\"rb\"].getList<uint8_t>().value_or(std::vector<uint8_t>{});\n \tif (values.size() != RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS &&\n \t    values.size() != RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS - 1) {\n \t\tLOG(RkISP1Dpf, Error)\n@@ -135,7 +135,7 @@ int Dpf::init([[maybe_unused]] IPAContext &context,\n \tconst YamlObject &rFObject = tuningData[\"NoiseLevelFunction\"];\n \n \tstd::vector<uint16_t> nllValues;\n-\tnllValues = rFObject[\"coeff\"].getList<uint16_t>().value_or(utils::defopt);\n+\tnllValues = rFObject[\"coeff\"].getList<uint16_t>().value_or(std::vector<uint16_t>{});\n \tif (nllValues.size() != RKISP1_CIF_ISP_DPF_MAX_NLF_COEFFS) {\n \t\tLOG(RkISP1Dpf, Error)\n \t\t\t<< \"Invalid 'RangeFilter:coeff': expected \"\ndiff --git a/src/ipa/rkisp1/algorithms/gsl.cpp b/src/ipa/rkisp1/algorithms/gsl.cpp\nindex a80fed589bb2..b9f879124633 100644\n--- a/src/ipa/rkisp1/algorithms/gsl.cpp\n+++ b/src/ipa/rkisp1/algorithms/gsl.cpp\n@@ -59,7 +59,7 @@ int GammaSensorLinearization::init([[maybe_unused]] IPAContext &context,\n \t\t\t\t   const YamlObject &tuningData)\n {\n \tstd::vector<uint16_t> xIntervals =\n-\t\ttuningData[\"x-intervals\"].getList<uint16_t>().value_or(utils::defopt);\n+\t\ttuningData[\"x-intervals\"].getList<uint16_t>().value_or(std::vector<uint16_t>{});\n \tif (xIntervals.size() != kDegammaXIntervals) {\n \t\tLOG(RkISP1Gsl, Error)\n \t\t\t<< \"Invalid 'x' coordinates: expected \"\n@@ -83,7 +83,7 @@ int GammaSensorLinearization::init([[maybe_unused]] IPAContext &context,\n \t\treturn -EINVAL;\n \t}\n \n-\tcurveYr_ = yObject[\"red\"].getList<uint16_t>().value_or(utils::defopt);\n+\tcurveYr_ = yObject[\"red\"].getList<uint16_t>().value_or(std::vector<uint16_t>{});\n \tif (curveYr_.size() != RKISP1_CIF_ISP_DEGAMMA_CURVE_SIZE) {\n \t\tLOG(RkISP1Gsl, Error)\n \t\t\t<< \"Invalid 'y:red' coordinates: expected \"\n@@ -92,7 +92,7 @@ int GammaSensorLinearization::init([[maybe_unused]] IPAContext &context,\n \t\treturn -EINVAL;\n \t}\n \n-\tcurveYg_ = yObject[\"green\"].getList<uint16_t>().value_or(utils::defopt);\n+\tcurveYg_ = yObject[\"green\"].getList<uint16_t>().value_or(std::vector<uint16_t>{});\n \tif (curveYg_.size() != RKISP1_CIF_ISP_DEGAMMA_CURVE_SIZE) {\n \t\tLOG(RkISP1Gsl, Error)\n \t\t\t<< \"Invalid 'y:green' coordinates: expected \"\n@@ -101,7 +101,7 @@ int GammaSensorLinearization::init([[maybe_unused]] IPAContext &context,\n \t\treturn -EINVAL;\n \t}\n \n-\tcurveYb_ = yObject[\"blue\"].getList<uint16_t>().value_or(utils::defopt);\n+\tcurveYb_ = yObject[\"blue\"].getList<uint16_t>().value_or(std::vector<uint16_t>{});\n \tif (curveYb_.size() != RKISP1_CIF_ISP_DEGAMMA_CURVE_SIZE) {\n \t\tLOG(RkISP1Gsl, Error)\n \t\t\t<< \"Invalid 'y:blue' coordinates: expected \"\ndiff --git a/src/ipa/rkisp1/algorithms/lsc.cpp b/src/ipa/rkisp1/algorithms/lsc.cpp\nindex 102535bd11a4..de2de0139747 100644\n--- a/src/ipa/rkisp1/algorithms/lsc.cpp\n+++ b/src/ipa/rkisp1/algorithms/lsc.cpp\n@@ -43,7 +43,7 @@ static std::vector<double> parseSizes(const YamlObject &tuningData,\n \t\t\t\t      const char *prop)\n {\n \tstd::vector<double> sizes =\n-\t\ttuningData[prop].getList<double>().value_or(utils::defopt);\n+\t\ttuningData[prop].getList<double>().value_or(std::vector<double>{});\n \tif (sizes.size() != RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE) {\n \t\tLOG(RkISP1Lsc, Error)\n \t\t\t<< \"Invalid '\" << prop << \"' values: expected \"\n@@ -76,7 +76,7 @@ static std::vector<uint16_t> parseTable(const YamlObject &tuningData,\n \t\tRKISP1_CIF_ISP_LSC_SAMPLES_MAX * RKISP1_CIF_ISP_LSC_SAMPLES_MAX;\n \n \tstd::vector<uint16_t> table =\n-\t\ttuningData[prop].getList<uint16_t>().value_or(utils::defopt);\n+\t\ttuningData[prop].getList<uint16_t>().value_or(std::vector<uint16_t>{});\n \tif (table.size() != kLscNumSamples) {\n \t\tLOG(RkISP1Lsc, Error)\n \t\t\t<< \"Invalid '\" << prop << \"' values: expected \"\n","prefixes":["libcamera-devel","1/2"]}