Patch Detail
Show a patch.
GET /api/patches/25505/?format=api
{ "id": 25505, "url": "https://patchwork.libcamera.org/api/patches/25505/?format=api", "web_url": "https://patchwork.libcamera.org/patch/25505/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20251211232246.31330-12-bryan.odonoghue@linaro.org>", "date": "2025-12-11T23:22:36", "name": "[v5,11/20] libcamera: software_isp: Move param select code to Debayer base class", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "44bd0718fe6cad16f30dbbea9a4ea2d753665f5c", "submitter": { "id": 175, "url": "https://patchwork.libcamera.org/api/people/175/?format=api", "name": "Bryan O'Donoghue", "email": "bryan.odonoghue@linaro.org" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/25505/mbox/", "series": [ { "id": 5656, "url": "https://patchwork.libcamera.org/api/series/5656/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5656", "date": "2025-12-11T23:22:25", "name": "GPUISP precursor series", "version": 5, "mbox": "https://patchwork.libcamera.org/series/5656/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/25505/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/25505/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 27765C3257\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 11 Dec 2025 23:23:53 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E01C561657;\n\tFri, 12 Dec 2025 00:23:52 +0100 (CET)", "from mail-pf1-x431.google.com (mail-pf1-x431.google.com\n\t[IPv6:2607:f8b0:4864:20::431])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C0A3961643\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 12 Dec 2025 00:23:51 +0100 (CET)", "by mail-pf1-x431.google.com with SMTP id\n\td2e1a72fcca58-7e1651ae0d5so553664b3a.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 11 Dec 2025 15:23:51 -0800 (PST)", "from inspiron14p-linux (M106185144161.v4.enabler.ne.jp.\n\t[106.185.144.161]) by smtp.gmail.com with ESMTPSA id\n\td2e1a72fcca58-7f4c4ab52aasm3399933b3a.38.2025.12.11.15.23.46\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 11 Dec 2025 15:23:49 -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=\"WzpWbXaL\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=linaro.org; s=google; t=1765495430; x=1766100230;\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=WzpWbXaLQf1wF6iqvUsNWjw+mul9uKuVWPg0+7wpQXIHhLMjjZQxMnBrMoYqKeXOSN\n\tJHffpFV9t3LQ5olHzV1A2/hkTSdW/fPCpJ5iAC09HDHJdKGtFqIVxKs2SbG04d8/DjrD\n\tZbFIITGe4vegsl+AkHjTQb2jANLY3JpLlyVAll/zbpheqLDP9mknFncZaBDQ85gAuvYH\n\tpUC2vkhvpWPU4/TWOoeDPjmE/vUbRlNRHSzH/rM9crzu7L6Gnb7XGBv51AG8a4znraou\n\tQibixn8ULdxuyEGjqzPksNCF61dL2ZUxmLdo2/91zNgQwRgo6wxwmL8s9TEuz5yLveFK\n\tsj+Q==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1765495430; x=1766100230;\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=nb+6usxl+/+reAyOMSS5MYMUvTMbHRgJVmbxbExunInd58IbUdKi9813cXq95giiQx\n\ttjy78lzWMx0TeWRA9Om+xy5oG4HG3BydnEYD4fpLQoKtI4NFZ7vVAe8MI7KnAzugv3M+\n\twL+tOZiajMWPdvlUSAXpVETQGZPfFdMAsZ1b0wt6vcUDI1Kivre40z5maGR+f+qDyah6\n\tA8Nde8QZgni8dDdO1FBjuS2btLXZh/Q4jrLIHRfvEd8Wm3c8oO8niyiBj5+51IHj9Jza\n\t+NC7V0fzdsFQBKvlbdtam/eOU9/oW7VW6kEfF8272kk1t26TYkcmZ61NO1pINIHb6Yyi\n\tv01w==", "X-Gm-Message-State": "AOJu0YxJcPAWooZSb3nMyOwGzBn57iVhpWtApn+ft1Hwj6ui2HOCrioV\n\tqI27lpSRNLXbgljw7B2a/rhhyRHcKPYS/MUeECsWemXtn2ixFE3SqC72uUbsmZXabAStiw14prw\n\tPKFKm", "X-Gm-Gg": "AY/fxX4iWdwryprNpj/hoOglAJ3zxziueAdYc216JDf69mcXNZHBIIe+C1yRK7Xig7Z\n\tXDGpMBp/qfXARD5qLJ/txZEgY/BeUL8h1+/Nspsfva68Dq4K+9rbYELKHB64i1gDLYTCTnSuAAQ\n\tS5pwtWEVh47em10O4oDAgHYz/mADrjKSZPPkJfkpj+45kAd3TUD3DWGZ2FP/ZE+Kx6wEOl91QNZ\n\tXIT6QgQLqi28QJ63HeBgT295s2c0VfXUNSy2SOaBk+AzXbNPma9pHqKYxpORDryF/LKVTCk7AN6\n\t7JgCSD/uB2KiGAyo/m8VRB/s405sHErUPTxJAuEkY8FPI8a4yo3nXvrfEjFw65ktFM+bvsitPtP\n\taYVHGnJjhX8W1AXaunPgB8HcW7cfM8C6/ZT2hVnUBNCyfKPeG4Tyr9Uj/myDNTj/XMjrr4FopBs\n\th1Kd1NHkAqtnrks/Isp3e2kUGxOvQHtpJYLLUFFW2YuQfpU9O+1arf/1V+cIitsA==", "X-Google-Smtp-Source": "AGHT+IGs4w9m1qhROws1gi5EVLMT+1KVu4HMMa7RPzVhS7CDdJS/owF5sdiwfcR8BZEwbB+W3j5wAg==", "X-Received": "by 2002:a05:6a00:f04:b0:7e8:4587:e8b2 with SMTP id\n\td2e1a72fcca58-7f6693a692emr146536b3a.37.1765495430072; \n\tThu, 11 Dec 2025 15:23:50 -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 v5 11/20] libcamera: software_isp: Move param select code to\n\tDebayer base class", "Date": "Thu, 11 Dec 2025 23:22:36 +0000", "Message-ID": "<20251211232246.31330-12-bryan.odonoghue@linaro.org>", "X-Mailer": "git-send-email 2.52.0", "In-Reply-To": "<20251211232246.31330-1-bryan.odonoghue@linaro.org>", "References": "<20251211232246.31330-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 ¶ms)\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 ¶ms)\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 ¶ms);\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": [ "v5", "11/20" ] }