{"id":25115,"url":"https://patchwork.libcamera.org/api/1.1/patches/25115/?format=json","web_url":"https://patchwork.libcamera.org/patch/25115/","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":"<20251120232019.3590-15-bryan.odonoghue@linaro.org>","date":"2025-11-20T23:20:11","name":"[14/22] libcamera: software_isp: Move isStandardBayerOrder to base class","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"0094dda74511475d5cf28efcf4ef636c82c9bfcd","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/25115/mbox/","series":[{"id":5599,"url":"https://patchwork.libcamera.org/api/1.1/series/5599/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=5599","date":"2025-11-20T23:19:57","name":"GPUISP precursor series","version":1,"mbox":"https://patchwork.libcamera.org/series/5599/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/25115/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/25115/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 51F77C3333\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 20 Nov 2025 23:20:51 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id F23B960AB3;\n\tFri, 21 Nov 2025 00:20:50 +0100 (CET)","from mail-wm1-x332.google.com (mail-wm1-x332.google.com\n\t[IPv6:2a00:1450:4864:20::332])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 37DCE60AAF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 21 Nov 2025 00:20:49 +0100 (CET)","by mail-wm1-x332.google.com with SMTP id\n\t5b1f17b1804b1-47796a837c7so9424795e9.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 20 Nov 2025 15:20:49 -0800 (PST)","from inspiron14p-linux.ht.home (188-141-3-146.dynamic.upc.ie.\n\t[188.141.3.146]) by smtp.gmail.com with ESMTPSA id\n\t5b1f17b1804b1-477bf3af0ecsm11618415e9.9.2025.11.20.15.20.47\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 20 Nov 2025 15:20:47 -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=\"AZLIAG+4\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=linaro.org; s=google; t=1763680848; x=1764285648;\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=P/vViwioaRQnkwkLzBBnhXzc9u7iK4MAB2njnFCGogQ=;\n\tb=AZLIAG+4PyTCzxwOVwgdjIfa9Dla0qseG1ea4nzxs80GNZq15XyngGdl2N8+BsRK42\n\tMXyDfCCpJMwyLPYYx6xr0boQrmV1jlelJrF2yUwgMdt0LD0FxGbrxUgvqtsstHnFQ/Cc\n\t4FH0xygU+CRvvylm2vJ5B93MMKnO7sn0mjMmc7jx4N/dYOlFAyfMLmZST+jPWBhjvvHU\n\tAVtUKpVaDIfBXlLbMAxC2ouDIrltzBrEo1uMj2ByaeSGL5p1CFezU6ixapMNR6pJ5buz\n\tb88nFsP4JZQvLQDHiAUKb7DifYSARdMYbf4u9WwrCNmWhf6bKmuG3olDa5yvDn3zdndN\n\tDXkQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1763680848; x=1764285648;\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=P/vViwioaRQnkwkLzBBnhXzc9u7iK4MAB2njnFCGogQ=;\n\tb=rH0sg21qHy4s396jPfhAL2qY+kmCzWL1/mya4IT2PuUff07DuA0swBaDWq+tACNT9G\n\t4E5C96QyUsZWRvWNjbW93wSQbtuSFer+19IiXONUXHGx/koNfaachVU/iuHoAZrqkT2X\n\tn1Od61lSeDdeLdPANLweR+gM1wNK3U6YlIZZuaEEw5nerIrQH4dLOqm9JEodcn/7pozE\n\tsU6c7ovA1YWC2kR9VF1ENgyopGWKrMo+nNYVQHiLSAPIK4c6Q0Tsu6XY9OufeT5vvppQ\n\tdD0aR2ZUcMrh5Qoi65lvlS1XuFE7YhGwZUH8dSuMhRzMfoxlz/SR8U9MZZGl+70EE8Kb\n\tlisA==","X-Gm-Message-State":"AOJu0YxZTtTA7WPUCMthaYA86KER4Whfh4WOMSzB/fF5mEkzdi/Tj0mL\n\tTk/VE9iSmK5tqucOOyVhWZYSetG5bMko2U1cTnDhDSrhfUXLv7Eju1NDA2TM/oPUHWQIFx2lT6D\n\taWAPss+A=","X-Gm-Gg":"ASbGncukbDqAWDBG05ruXT+oGGLbRaT3tdzCFFk5j9WH4M2KrOGcvwu+U4tzmR6lhhb\n\t+ZvfxvcCZCdgECFZ3HFf8RyThedbaYO64ZHymeSFSZtiOvDv7csy2O46tMygYFsU6DBBVpzSLxc\n\toJQl39T0kJnFbsLaXS+eDCScjOxwqAek21BDnuPQrtgSM03sVVojaiRHq0/KJOskpTylz5q38g2\n\tTGP82/X49PJdPV0K3QnAQ7/z5vYDqPDHbWBIIJRFeqxpFkDECmEiFB0+y5M9hei7HNYVXqUudIW\n\trn19hzxuHNbx990Txvs4h0HlA7B6QgmuPDhCGGywlxsnedUh0KIXWSWaYYfQ9j+HwOoeuVdXIS8\n\t6vFadhx/C8eQmHB+faVymRQkTpojIdFX+DsfuVC4grLx8PZTyE3I34+sA7DjG0T5+FD280nR+zr\n\tbPSlVM6sKxOwC9JnYJl8oyoo2SQ5wP3CvlYQuSQoUBiDylTEtAQ6v5yfMG3CBfxPjofZE=","X-Google-Smtp-Source":"AGHT+IG/UQAVf29+IYijztD5D0i+UYGbaaJ9llpkWn1cv9fnT+huQY3NzXdRXGRBvutSr6hfehWW0A==","X-Received":"by 2002:a05:600c:468c:b0:477:79f8:daa8 with SMTP id\n\t5b1f17b1804b1-477c01b219amr3584435e9.17.1763680848531; \n\tThu, 20 Nov 2025 15:20:48 -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 14/22] libcamera: software_isp: Move isStandardBayerOrder to\n\tbase class","Date":"Thu, 20 Nov 2025 23:20:11 +0000","Message-ID":"<20251120232019.3590-15-bryan.odonoghue@linaro.org>","X-Mailer":"git-send-email 2.51.2","In-Reply-To":"<20251120232019.3590-1-bryan.odonoghue@linaro.org>","References":"<20251120232019.3590-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":"isStandardBayerOrder is useful to both CPU and GPU debayer logic and\nreusable as-is for both.\n\nMove to shared location in base class.\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     | 10 ++++++++++\n src/libcamera/software_isp/debayer.h       |  2 ++\n src/libcamera/software_isp/debayer_cpu.cpp |  6 ------\n 3 files changed, 12 insertions(+), 6 deletions(-)","diff":"diff --git a/src/libcamera/software_isp/debayer.cpp b/src/libcamera/software_isp/debayer.cpp\nindex 8a53437e9..441e49522 100644\n--- a/src/libcamera/software_isp/debayer.cpp\n+++ b/src/libcamera/software_isp/debayer.cpp\n@@ -236,4 +236,14 @@ void Debayer::dmaSyncBegin(std::vector<DmaSyncer> &dmaSyncers, FrameBuffer *inpu\n \t}\n }\n \n+/**\n+ * \\fn void Debayer::isStandardBayerOrder(BayerFormat::Order order)\n+ * \\brief Common method to validate standard 2x2 Bayer pattern of 2 Green, 1 Blue, 1 Red pixels.\n+ */\n+bool Debayer::isStandardBayerOrder(BayerFormat::Order order)\n+{\n+\treturn order == BayerFormat::BGGR || order == BayerFormat::GBRG ||\n+\t       order == BayerFormat::GRBG || order == BayerFormat::RGGB;\n+}\n+\n } /* namespace libcamera */\ndiff --git a/src/libcamera/software_isp/debayer.h b/src/libcamera/software_isp/debayer.h\nindex 334211215..26787a985 100644\n--- a/src/libcamera/software_isp/debayer.h\n+++ b/src/libcamera/software_isp/debayer.h\n@@ -20,6 +20,7 @@\n #include <libcamera/geometry.h>\n #include <libcamera/stream.h>\n \n+#include \"libcamera/internal/bayer_format.h\"\n #include \"libcamera/internal/dma_buf_allocator.h\"\n #include \"libcamera/internal/global_configuration.h\"\n #include \"libcamera/internal/software_isp/benchmark.h\"\n@@ -116,6 +117,7 @@ private:\n protected:\n \tvoid setParams(DebayerParams &params);\n \tvoid dmaSyncBegin(std::vector<DmaSyncer> &dmaSyncers, FrameBuffer *input, FrameBuffer *output);\n+\tbool isStandardBayerOrder(BayerFormat::Order order);\n };\n \n } /* namespace libcamera */\ndiff --git a/src/libcamera/software_isp/debayer_cpu.cpp b/src/libcamera/software_isp/debayer_cpu.cpp\nindex 8f1b4e53d..00738c56b 100644\n--- a/src/libcamera/software_isp/debayer_cpu.cpp\n+++ b/src/libcamera/software_isp/debayer_cpu.cpp\n@@ -288,12 +288,6 @@ void DebayerCpu::debayer10P_RGRG_BGR888(uint8_t *dst, const uint8_t *src[])\n \t}\n }\n \n-static bool isStandardBayerOrder(BayerFormat::Order order)\n-{\n-\treturn order == BayerFormat::BGGR || order == BayerFormat::GBRG ||\n-\t       order == BayerFormat::GRBG || order == BayerFormat::RGGB;\n-}\n-\n /*\n  * Setup the Debayer object according to the passed in parameters.\n  * Return 0 on success, a negative errno value on failure\n","prefixes":["14/22"]}