{"id":17355,"url":"https://patchwork.libcamera.org/api/1.1/patches/17355/?format=json","web_url":"https://patchwork.libcamera.org/patch/17355/","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":"<20220908184850.1874303-14-xavier.roumegue@oss.nxp.com>","date":"2022-09-08T18:48:49","name":"[libcamera-devel,13/14] libcamera: pipeline: rkisp1: Factorize errors handling path on start()","commit_ref":null,"pull_url":null,"state":"changes-requested","archived":false,"hash":"2848d4d72e77c6e3596aa53a1d2536953ee07aee","submitter":{"id":107,"url":"https://patchwork.libcamera.org/api/1.1/people/107/?format=json","name":"Xavier Roumegue","email":"xavier.roumegue@oss.nxp.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/17355/mbox/","series":[{"id":3477,"url":"https://patchwork.libcamera.org/api/1.1/series/3477/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3477","date":"2022-09-08T18:48:36","name":"Add dw100 dewarper support to simple/rkisp1 pipeline","version":1,"mbox":"https://patchwork.libcamera.org/series/3477/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/17355/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/17355/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 EA160C3282\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  8 Sep 2022 18:49:30 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A96B1620EE;\n\tThu,  8 Sep 2022 20:49:30 +0200 (CEST)","from EUR04-DB3-obe.outbound.protection.outlook.com\n\t(mail-eopbgr60053.outbound.protection.outlook.com [40.107.6.53])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4A010620B2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  8 Sep 2022 20:49:23 +0200 (CEST)","from PAXPR04MB8703.eurprd04.prod.outlook.com\n\t(2603:10a6:102:21e::22)\n\tby AS8PR04MB8852.eurprd04.prod.outlook.com (2603:10a6:20b:42f::14)\n\twith Microsoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.19;\n\tThu, 8 Sep 2022 18:49:22 +0000","from PAXPR04MB8703.eurprd04.prod.outlook.com\n\t([fe80::485:adba:7081:715a]) by\n\tPAXPR04MB8703.eurprd04.prod.outlook.com\n\t([fe80::485:adba:7081:715a%3]) with mapi id 15.20.5612.019;\n\tThu, 8 Sep 2022 18:49:22 +0000"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1662662970;\n\tbh=nBBTrKaYKbKVSnuwyNWWnmYMjMiwyIS2GIVgZfHEF+c=;\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=VJqVu1vG9im9HV6wC8a4iCYuBfRZozyMzcaz+CRkUYc6q9DP3osVnZkic9lwFh1m/\n\tYxgDRhQTw1GmLNpt6Xf7h7b2yvWVJycOwf2f+Fu2lnhpc91VVtr4iAhrW8VJ+ZFG6O\n\tT2Ms8kRL5xfWy0c442iuJ2ZMFYvll5azemHaNoBskjvEnC9I8DUG5q7lZ+MsWZJg1z\n\tWh03TApMlH3mCqOEyARQJkDSI01nrPY6BBrz6a3bK7MbnIqjlZuyMHlEmv+pbdxAJ/\n\tBgS3jkyyGHC194rNxyWYQHc5sKSOr/kCkVmN/U9alypotUmpB8z3OWYL9sjzPUS0ZI\n\tXiV2S6wR+W2Gw==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com;\n\ts=selector2-NXP1-onmicrosoft-com;\n\th=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n\tbh=AK/bi6rxdBbz8x6SIPHndU60DEbeSpBfsdLp6WoV1V8=;\n\tb=F0l2WaCi8C9J+fMgPxSoKjFH5lcg91lUKQE488a4mXx7ma9ALFUBair29stGoeFqGFToQTE4aNbA7pr4CpiM+B7K+1Vb/HKKvyIPRoa48C30NR0TzgFDIaAlycTybLLVOr8UPWrj3Ghu4bgHtnNqEAmwQhMwn6aupyoDje0T5jU="],"Authentication-Results":["lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=NXP1.onmicrosoft.com\n\theader.i=@NXP1.onmicrosoft.com\n\theader.b=\"F0l2WaCi\"; dkim-atps=neutral","dkim=none (message not signed)\n\theader.d=none;dmarc=none action=none header.from=oss.nxp.com;"],"ARC-Seal":"i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n\tb=G9E1EI1gsQQn40TDwbsSYA/KhV90jFffLeP5eJFvX+UsagKsAnBwmCobnN67y28pwD4DkB5x6yjuOWDOL4cdR2PEeGnUHnbkmjDG/cSGyG79VQlyDcdaFfz+HbluXLvN8aFsmpL9YOWptWXnTMWARJcUk9lFMFiE1cu9ORcx8HwmBmPAb49eue/+6OFHP6z5q4kgpNib/LhUQ7fm03ZmVmRBy/k+voYWFJ+cpg5imxQMx1g3dWGn/GhN+ByDxnipeqSurpw5iyvqgN2YaRcYLPLOQvX401S3SBFYHwmWi4RUi6xjkx1cY4OZ/M2GJcRmzb8PAgKgrEbB5GMJBwyA/w==","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n\ts=arcselector9901;\n\th=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;\n\tbh=AK/bi6rxdBbz8x6SIPHndU60DEbeSpBfsdLp6WoV1V8=;\n\tb=RgoHm8kydW/pcyn66uLZkubeU/BEJ7DPp2Z/g1f9VI6RPiaXZscMLxSSPjaeOmTXuift7j0kDFhVaDSv7gl+uDlv8ix4FwnHwwAD395W2V8pMLnu4oCU+DWPn51sQSQ/RWMYl4Hckfh8Qv5gtAbUo/6vLJPKB2gkpTKj7ecP+1a0+qezGcnUzR/726JG6BB1jYAW843jOZy26I4kLNDPcSBmR8VgTWFzM3SwCUHRGdQkQvpFzAF4FNL7dPUeEcEkNwkyDi4QQidaiW2Kt0wOVL/w4T6YiP5bjMgoqCWTlp88WzvKKHGRUPDd28144p1t3rrNVrLueSRi0wAAE4jGFw==","ARC-Authentication-Results":"i=1; mx.microsoft.com 1; spf=pass\n\tsmtp.mailfrom=oss.nxp.com;\n\tdmarc=pass action=none header.from=oss.nxp.com; \n\tdkim=pass header.d=oss.nxp.com; arc=none","To":"libcamera-devel@lists.libcamera.org","Date":"Thu,  8 Sep 2022 20:48:49 +0200","Message-Id":"<20220908184850.1874303-14-xavier.roumegue@oss.nxp.com>","X-Mailer":"git-send-email 2.37.3","In-Reply-To":"<20220908184850.1874303-1-xavier.roumegue@oss.nxp.com>","References":"<20220908184850.1874303-1-xavier.roumegue@oss.nxp.com>","Content-Transfer-Encoding":"8bit","Content-Type":"text/plain","X-ClientProxiedBy":"PR3P250CA0001.EURP250.PROD.OUTLOOK.COM\n\t(2603:10a6:102:57::6) To PAXPR04MB8703.eurprd04.prod.outlook.com\n\t(2603:10a6:102:21e::22)","MIME-Version":"1.0","X-MS-Exchange-MessageSentRepresentingType":"1","X-MS-PublicTrafficType":"Email","X-MS-TrafficTypeDiagnostic":"PAXPR04MB8703:EE_|AS8PR04MB8852:EE_","X-MS-Office365-Filtering-Correlation-Id":"3ae63976-5dec-476f-31e6-08da91cad816","X-MS-Exchange-SharedMailbox-RoutingAgent-Processed":"True","X-MS-Exchange-SenderADCheck":"1","X-MS-Exchange-AntiSpam-Relay":"0","X-Microsoft-Antispam":"BCL:0;","X-Microsoft-Antispam-Message-Info":"Z8QbVJzTwrTbfMN738DBQf657h7Us8TNVz6JOPa7qaXQKbz3F0Xn6sSozDoHDw4q4XkMe+S+2opia+HqKDZEvE0hYt9wlvs8tXtvUYEu/VL5RqT92jIThshUHTmRUslMC1A/Ar0nbd171vDFi/6ORpMdFZKYCnsXO90jIKpUuhFXZwm3KzTdsp2+X8Qhe9H27Q4I/sByoITkIK0rFemDV3CeLqx+kaqF76JC80tlVyEzen9/wGF2hcKtTXNqGZKWXKMbL2W67C22acHVFkdg/+OsPzLrTcsCVPWxA+vddY5PofpOX4sVBUgvYgBjAjZIiSW3+DefRkljuYG3CA2UEwsIE/g5tq/J8dX+WQU60LwxkRZRpDRzeEgy0Jzq7wwIUJvYFNZVYCc04zswRI8IsdsZiyuX79eIJ2SXTXuHtXQ4qG7+DnkjPZSe9DPjXAFVbbrYTMvEObM+tBGl9U7kY0AbfSzX6ILy+hGa2OTPUHuXhP7JxVr39IDvFGo2VFZabDWsV5v/uR7FHS9ZqPb1kFJJfjVVm1dND4msikHX27B+J9jUa5WVvq6JJJBekUXXrngRUNJ63bRV2DW7SIGx6PjPj1AUX7M3lxIaLCLYcsqM5LwbcVqP7XUo1sCxEjYr16JTsZfURux1d0SGpjAU1VqoQ3GNIBxKlUubYDYBovrRrAOE3LydLfeJIwvBAW4i5cgy86uUI4JnKp9YQnCAFA==","X-Forefront-Antispam-Report":"CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;\n\tIPV:NLI; SFV:NSPM; H:PAXPR04MB8703.eurprd04.prod.outlook.com; PTR:;\n\tCAT:NONE; \n\tSFS:(13230016)(4636009)(39860400002)(346002)(376002)(396003)(136003)(366004)(38100700002)(66556008)(66476007)(66946007)(8936002)(44832011)(5660300002)(4326008)(8676002)(6916009)(316002)(41300700001)(186003)(1076003)(2616005)(2906002)(478600001)(6666004)(86362001)(6512007)(52116002)(6506007)(83380400001)(6486002);\n\tDIR:OUT; SFP:1101; ","X-MS-Exchange-AntiSpam-MessageData-ChunkCount":"1","X-MS-Exchange-AntiSpam-MessageData-0":"cJGSrcPm6D18Dmc1rzFPJJAHiuxaqQk1viIwwxXt15ElJCGGe/xnGgkC3fJuwaOp8kthxiEl6GyM+Wfb+FN64cD5nREmZCv0VPYpmCkXgUNjoi9JWFZtAwdQ6rOGeBCy+LnSWg0absXYCg+adEAKvhT4xrtgw7UNLTCBV7D+GRm2gHAImQ04TSDDRlGWXJkWwkw5vq8ctk+ukfQ7prmlqLHzN1hgOVEDl5RXuT8hVJKZ7Z6e0XLAUujDS1MNxddY75tObN08Mwz6RJaGOX+udHVT9mAUau7qqieGbCsk2UYCDvS78tkMTgL6w7LeNtR+rljPF8H/7TqKJ0Fr7nrp2Mz5qCKyDpicTuAbiV4n7j6njsCo8wecEzvyEs4le4weuaap1TNA4Wm1hPe+pKiEnP4eAIazIIwrLzBl8CLiu4rd9/faQs2gylqi6bvQXnBEs2IoDn4QB1oujC01UnJdVy6ocMbrQlH5DDa7tDpozAIDsi3MtNfU+p6Dm/j53x0IB+eJYS7weXOqopI0F9in8etMWFoAXgozMu9N+TGt1rHxYjUNbRgoM4fsoYTuIETdsm+dLetyxBX2U3jH9xYK8eqZaGiPHx4CsLyGq17Zt+o/pzlRxGLjDztZStZ7y0l5XHmEAkcYVZosdpu1wM1aFR4H+VQQ4SAo2pAMUZIT5BnfYYcWH21L17accztb1QKXzPVJXcPBPEUe3L+L9maB3NI54Wh+CD7BTxOAD+G5ioX8NVMAn86NZjL15aq8Pb9khHJS5290E+FFb9t8+aflfrqJ7bcPhVU4RGObNPdZhoKKB59Q5NbYUs9qO8GQ0iui2/jzTB7BXzW/o2JdOjsjkIOrQASvNCzzS9S0khVow4VgUqChJ82zPFYKQrHmzcWqcNt+tFBJvMkExZx1+R1Xss33fFeuX4hYn+6GyKWb3mGXDYDCUP7zkFWl/7sfm0A3QsuWVYmHEhbOaRtPxfbZhvK0ppXx4L/b3LJxm3jAQvYXNIGqzy3AHT5fPXo2TV24vrFbhjkE5250h2HQPInbUYzsyLR5zj+FK2VP+fpED4eJOaGqK00T0r0ops6j2mR/4H0evOqeW/c/s3kuOCPRx3yIkfxhUeg4sXkm/y0V4R3pvVo106X+uTOIO6n0w5gBUVJX8dksM5b4VC/+ZAHrdlcbuFf9RVLITxuta9LCCteBRJ58cHGrjNb0yIeFOTvuoOfwKBGJFKjRl4fRhHlmcMN94C7Tue8zBZ+UKSvkE8m4N7MdguxYutCZL6w/hIBrWJpPv0ZCOtyCPzxKkg+Qi9d2gvsAez2m1KdUwJJ84DCZkbLA76tut2maczkoGG7XQLLUgSkSxS0RkgZsXpQg+nXEHAaB28KSSfXGXYX86McADxMNuYpSqXDmn8KXD5jRpWZ0FNkkmCOLJ1Ce0EwXl0Omtl7H2n+VQ1JPzX0gUO1SF+XGxfE2KgiGRRFDea6m6G+CBpl00XwdUBq3zGGofHhviqINShbQzTDdarrBhK98IYvDfp3iOorezEDlciF+uVNDiso2eNmPdqPrOKDOsi6eINRAs3GSOkx7Bhh5V/WcxUPPl8/ESSNuz5+ZLzMEH4xPY05B+zMejamVE4fMLIENeQL7nHHTXgyPvSAO467sLEWJ+3PTEbptdbo+NvyO74QZ9G+RPeqi7RYHVim4cg==","X-OriginatorOrg":"oss.nxp.com","X-MS-Exchange-CrossTenant-Network-Message-Id":"3ae63976-5dec-476f-31e6-08da91cad816","X-MS-Exchange-CrossTenant-AuthSource":"PAXPR04MB8703.eurprd04.prod.outlook.com","X-MS-Exchange-CrossTenant-AuthAs":"Internal","X-MS-Exchange-CrossTenant-OriginalArrivalTime":"08 Sep 2022 18:49:22.2038\n\t(UTC)","X-MS-Exchange-CrossTenant-FromEntityHeader":"Hosted","X-MS-Exchange-CrossTenant-Id":"686ea1d3-bc2b-4c6f-a92c-d99c5c301635","X-MS-Exchange-CrossTenant-MailboxType":"HOSTED","X-MS-Exchange-CrossTenant-UserPrincipalName":"3TcaSGIDF3qa1BN55oGHfXtkBQkmUt8vx1kK0oSS34o2iIxnEVCkPW1XzwAK777khrrZsHu0eXNsbT7tOBZBDg==","X-MS-Exchange-Transport-CrossTenantHeadersStamped":"AS8PR04MB8852","Subject":"[libcamera-devel] [PATCH 13/14] libcamera: pipeline: rkisp1:\n\tFactorize errors handling path on 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>","From":"Xavier Roumegue via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Xavier Roumegue <xavier.roumegue@oss.nxp.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Signed-off-by: Xavier Roumegue <xavier.roumegue@oss.nxp.com>\n---\n src/libcamera/pipeline/rkisp1/rkisp1.cpp | 45 +++++++++++-------------\n 1 file changed, 21 insertions(+), 24 deletions(-)","diff":"diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\nindex 25fbf9f1..c1522ca6 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n@@ -828,59 +828,56 @@ int PipelineHandlerRkISP1::start(Camera *camera, [[maybe_unused]] const ControlL\n \n \tret = data->ipa_->start();\n \tif (ret) {\n-\t\tfreeBuffers(camera);\n \t\tLOG(RkISP1, Error)\n \t\t\t<< \"Failed to start IPA \" << camera->id();\n-\t\treturn ret;\n+\t\tgoto ipa_err;\n \t}\n \n \tdata->frame_ = 0;\n \n \tret = param_->streamOn();\n \tif (ret) {\n-\t\tdata->ipa_->stop();\n-\t\tfreeBuffers(camera);\n \t\tLOG(RkISP1, Error)\n \t\t\t<< \"Failed to start parameters \" << camera->id();\n-\t\treturn ret;\n+\t\tgoto param_err;\n \t}\n \n \tret = stat_->streamOn();\n \tif (ret) {\n-\t\tparam_->streamOff();\n-\t\tdata->ipa_->stop();\n-\t\tfreeBuffers(camera);\n \t\tLOG(RkISP1, Error)\n \t\t\t<< \"Failed to start statistics \" << camera->id();\n-\t\treturn ret;\n+\t\tgoto stat_err;\n \t}\n \n \tif (data->mainPath_->isEnabled()) {\n \t\tret = mainPath_.start();\n-\t\tif (ret) {\n-\t\t\tparam_->streamOff();\n-\t\t\tstat_->streamOff();\n-\t\t\tdata->ipa_->stop();\n-\t\t\tfreeBuffers(camera);\n-\t\t\treturn ret;\n-\t\t}\n+\t\tif (ret)\n+\t\t\tgoto main_err;\n \t}\n \n \tif (hasSelfPath_ && data->selfPath_->isEnabled()) {\n \t\tret = selfPath_.start();\n-\t\tif (ret) {\n-\t\t\tmainPath_.stop();\n-\t\t\tparam_->streamOff();\n-\t\t\tstat_->streamOff();\n-\t\t\tdata->ipa_->stop();\n-\t\t\tfreeBuffers(camera);\n-\t\t\treturn ret;\n-\t\t}\n+\t\tif (ret)\n+\t\t\tgoto self_err;\n \t}\n \n \tisp_->setFrameStartEnabled(true);\n \n \tactiveCamera_ = camera;\n+\tgoto no_err;\n+\n+self_err:\n+\tif (data->mainPath_->isEnabled())\n+\t\tmainPath_.stop();\n+main_err:\n+\tstat_->streamOff();\n+stat_err:\n+\tparam_->streamOff();\n+param_err:\n+\tdata->ipa_->stop();\n+ipa_err:\n+\tfreeBuffers(camera);\n+no_err:\n \treturn ret;\n }\n \n","prefixes":["libcamera-devel","13/14"]}