{"id":25407,"url":"https://patchwork.libcamera.org/api/1.1/patches/25407/?format=json","web_url":"https://patchwork.libcamera.org/patch/25407/","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":"<20251210003139.43606-12-bryan.odonoghue@linaro.org>","date":"2025-12-10T00:31:28","name":"[v4,11/20] libcamera: software_isp: Move param select code to Debayer base class","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"44bd0718fe6cad16f30dbbea9a4ea2d753665f5c","submitter":{"id":175,"url":"https://patchwork.libcamera.org/api/1.1/people/175/?format=json","name":"Bryan O'Donoghue","email":"bryan.odonoghue@linaro.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/25407/mbox/","series":[{"id":5644,"url":"https://patchwork.libcamera.org/api/1.1/series/5644/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=5644","date":"2025-12-10T00:31:17","name":"GPUISP precursor series","version":4,"mbox":"https://patchwork.libcamera.org/series/5644/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/25407/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/25407/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 180ECBD1F1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 10 Dec 2025 00:32:29 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CE70461450;\n\tWed, 10 Dec 2025 01:32:28 +0100 (CET)","from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com\n\t[IPv6:2607:f8b0:4864:20::1030])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id F0D5F61450\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 10 Dec 2025 01:32:26 +0100 (CET)","by mail-pj1-x1030.google.com with SMTP id\n\t98e67ed59e1d1-340ba29d518so4100522a91.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 09 Dec 2025 16:32:26 -0800 (PST)","from inspiron14p-linux (p96936b06.osaknt01.ap.so-net.ne.jp.\n\t[150.147.107.6]) by smtp.gmail.com with ESMTPSA id\n\t98e67ed59e1d1-34a70427ea6sm566580a91.3.2025.12.09.16.32.23\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 09 Dec 2025 16:32:24 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=linaro.org header.i=@linaro.org\n\theader.b=\"OtZ7+GoK\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=linaro.org; s=google; t=1765326745; x=1765931545;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=eHob+j+mTcN+DmZI0Jjd1599ddaYfYHVsPKAaDomjAg=;\n\tb=OtZ7+GoKJJTucO12XIPWPjnOhnwfac8xglOW9lsY7ebj49RvV82+0fLXgDp86R24kx\n\tyQKR3r+7pmSNZv9oAuAAFb4s0Ek0kCKIloSV7G63gWME4txgR6Nq5PeiU191yCT4lpsL\n\t9KR2rGjGyqpz9cfdS8xOG4uSDQvkhH1iFMGwYvIKPQY7WQcjtgM91kFZuLAoH9MX1Wdj\n\t2F6konzv1Us80bhIp3pruhUSb5Ai0akWFqaJDXwqqE1yHgyErhwOsV5xVn6G4/FdL5+a\n\tNI3B0tgpWqlwYzupNuf4jzMomQXxtPexXIYrTMVjRVQ0mJquIi/OD1J2CD8J3SUJOjU+\n\taPLw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1765326745; x=1765931545;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n\t:to:cc:subject:date:message-id:reply-to;\n\tbh=eHob+j+mTcN+DmZI0Jjd1599ddaYfYHVsPKAaDomjAg=;\n\tb=pTNozqNvZ5brEbhHg6Ztzwb7Qwi2ulHJtagt6+3OxafYAth03Z+duQT4+sCT7xKb/U\n\t6DIffqsk/vctrWNKcDqMGnZxnC3NTM1p8AsNNBLa5LdS+F537XXLkfm91fTCzK/PZjv6\n\t9bGdt7UXwUeTTrSOG6EYGCgkiMbtavwJpjpuGba8wesHwY4WoFxSId6LQvcJS2cqPWR+\n\tI8+xu0+3re4ILpmwuxObgL+Rc0EMjOIlaDKvGAlxUA7Uuk1YEPYP8LcVGNfHPlEr0n6z\n\tRAnIwh0w6GKCHjdIWHBib44bzyr062kjOXLnirKclkMIjrnkmYVvt+/OIFJz33eOvDKN\n\t3zYA==","X-Gm-Message-State":"AOJu0YyYTsEUHsZI4SQoo1GorJn0vpJVGQA1r/9l91ssPd8FOvTihM1Q\n\tD92fpJrVvLLiLHCqzclKypRp9iJQfSJibA4u0nkzoXrxdmg3i5RN1RcPJhi3yEwgWDv9prQw60s\n\twjcPF","X-Gm-Gg":"AY/fxX7WxELnKLvsyzf/HdaaxkWRMGgjMFSM1/wgZ4RazdXdyPBCurB1ezGpJ/ZPOsN\n\tHhd6boV3SBycQ/2iSI3BpoYOUXS5DPsUnqq/ikhUvXGdvhA+CLxXENE07HwMtIefREEzefdWkmU\n\tkgBD/thSkdFqEFxu+ueWRz9oLsQOl+0ETYuAhuTdrT/CWeIkxQ1otnuSx2tbJCi6MtJNOh4S8PP\n\tgNA8gGYjVgLQDLCWxNOIq7Ja4uASruj0xl2bZS8GWnkPb7s2DdgzWCuwK9to6eFH1A7vmGsKHky\n\tsr0ef4Xf3aVTMj6QUWyt7FocFApocdhE2E0sMbAcje0PrvURvl0ZytsAUuJ+SaLo2yXZDltHFDc\n\tRvfO8Tsbrl6mTt5ZaF8MhdFyjEumuKDAFP2bSFVDj9mVcrLzdUUNkKqQ4F1BnVgMw31G7fwdwjx\n\tPEuQOeizAPwAJiyJufwMzs5IUfpDtdqsMfx4Q0ii+AeBUt2U9PZJxclztZkYfJ/5vPbVk0MjplE\n\tqg=","X-Google-Smtp-Source":"AGHT+IEcbSoPTewzFYSYS2yxh+MQ7so0+W1Mg/l1AndVOaKsI4MoMrOEIneRPupbHpQ/yd6rub6oxg==","X-Received":"by 2002:a17:90b:2d4d:b0:349:3fe6:ab8b with SMTP id\n\t98e67ed59e1d1-34a7289e99amr440696a91.36.1765326745140; \n\tTue, 09 Dec 2025 16:32:25 -0800 (PST)","From":"Bryan O'Donoghue <bryan.odonoghue@linaro.org>","To":"libcamera-devel@lists.libcamera.org","Cc":"pavel@ucw.cz, Bryan O'Donoghue <bryan.odonoghue@linaro.org>,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>,\n\tMilan Zamazal <mzamazal@redhat.com>","Subject":"[PATCH v4 11/20] libcamera: software_isp: Move param select code to\n\tDebayer base class","Date":"Wed, 10 Dec 2025 00:31:28 +0000","Message-ID":"<20251210003139.43606-12-bryan.odonoghue@linaro.org>","X-Mailer":"git-send-email 2.52.0","In-Reply-To":"<20251210003139.43606-1-bryan.odonoghue@linaro.org>","References":"<20251210003139.43606-1-bryan.odonoghue@linaro.org>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Move the parameter selection code into the Debayer base class in-order to\nfacilitate reuse of the lookup tables in the eGL shaders.\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\nReviewed-by: Milan Zamazal <mzamazal@redhat.com>\nSigned-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>\n---\n src/libcamera/software_isp/debayer.cpp     | 28 ++++++++++++++++++++++\n src/libcamera/software_isp/debayer.h       |  3 +++\n src/libcamera/software_isp/debayer_cpu.cpp | 20 +---------------\n 3 files changed, 32 insertions(+), 19 deletions(-)","diff":"diff --git a/src/libcamera/software_isp/debayer.cpp b/src/libcamera/software_isp/debayer.cpp\nindex 8cadfaadc..cea30af67 100644\n--- a/src/libcamera/software_isp/debayer.cpp\n+++ b/src/libcamera/software_isp/debayer.cpp\n@@ -336,4 +336,32 @@ Debayer::~Debayer()\n  * debayer processing.\n  */\n \n+/**\n+ * \\fn void Debayer::setParams(DebayerParams &params)\n+ * \\brief Select the bayer params to use for the next frame debayer\n+ * \\param[in] params The parameters to be used in debayering\n+ */\n+void Debayer::setParams(DebayerParams &params)\n+{\n+\tgreen_ = params.green;\n+\tgreenCcm_ = params.greenCcm;\n+\tif (swapRedBlueGains_) {\n+\t\tred_ = params.blue;\n+\t\tblue_ = params.red;\n+\t\tredCcm_ = params.blueCcm;\n+\t\tblueCcm_ = params.redCcm;\n+\t\tfor (unsigned int i = 0; i < 256; i++) {\n+\t\t\tstd::swap(redCcm_[i].r, redCcm_[i].b);\n+\t\t\tstd::swap(greenCcm_[i].r, greenCcm_[i].b);\n+\t\t\tstd::swap(blueCcm_[i].r, blueCcm_[i].b);\n+\t\t}\n+\t} else {\n+\t\tred_ = params.red;\n+\t\tblue_ = params.blue;\n+\t\tredCcm_ = params.redCcm;\n+\t\tblueCcm_ = params.blueCcm;\n+\t}\n+\tgammaLut_ = params.gammaLut;\n+}\n+\n } /* namespace libcamera */\ndiff --git a/src/libcamera/software_isp/debayer.h b/src/libcamera/software_isp/debayer.h\nindex f4373ddeb..6903caae8 100644\n--- a/src/libcamera/software_isp/debayer.h\n+++ b/src/libcamera/software_isp/debayer.h\n@@ -83,6 +83,9 @@ public:\n \n private:\n \tvirtual Size patternSize(PixelFormat inputFormat) = 0;\n+\n+protected:\n+\tvoid setParams(DebayerParams &params);\n };\n \n } /* namespace libcamera */\ndiff --git a/src/libcamera/software_isp/debayer_cpu.cpp b/src/libcamera/software_isp/debayer_cpu.cpp\nindex 8f42d706b..6be5cdbd5 100644\n--- a/src/libcamera/software_isp/debayer_cpu.cpp\n+++ b/src/libcamera/software_isp/debayer_cpu.cpp\n@@ -758,25 +758,7 @@ void DebayerCpu::process(uint32_t frame, FrameBuffer *input, FrameBuffer *output\n \tfor (const FrameBuffer::Plane &plane : output->planes())\n \t\tdmaSyncers.emplace_back(plane.fd, DmaSyncer::SyncType::Write);\n \n-\tgreen_ = params.green;\n-\tgreenCcm_ = params.greenCcm;\n-\tif (swapRedBlueGains_) {\n-\t\tred_ = params.blue;\n-\t\tblue_ = params.red;\n-\t\tredCcm_ = params.blueCcm;\n-\t\tblueCcm_ = params.redCcm;\n-\t\tfor (unsigned int i = 0; i < 256; i++) {\n-\t\t\tstd::swap(redCcm_[i].r, redCcm_[i].b);\n-\t\t\tstd::swap(greenCcm_[i].r, greenCcm_[i].b);\n-\t\t\tstd::swap(blueCcm_[i].r, blueCcm_[i].b);\n-\t\t}\n-\t} else {\n-\t\tred_ = params.red;\n-\t\tblue_ = params.blue;\n-\t\tredCcm_ = params.redCcm;\n-\t\tblueCcm_ = params.blueCcm;\n-\t}\n-\tgammaLut_ = params.gammaLut;\n+\tsetParams(params);\n \n \t/* Copy metadata from the input buffer */\n \tFrameMetadata &metadata = output->_d()->metadata();\n","prefixes":["v4","11/20"]}