Patch Detail
Show a patch.
GET /api/1.1/patches/10955/?format=api
{ "id": 10955, "url": "https://patchwork.libcamera.org/api/1.1/patches/10955/?format=api", "web_url": "https://patchwork.libcamera.org/patch/10955/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/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": "<20210122102211.12768-5-david.plowman@raspberrypi.com>", "date": "2021-01-22T10:22:10", "name": "[libcamera-devel,4/5] ipa: raspberrypi: Replace Raspberry Pi debug with libcamera debug", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "ec8ee00ff6a8bc01bfa0eda83a31fa19beed138d", "submitter": { "id": 42, "url": "https://patchwork.libcamera.org/api/1.1/people/42/?format=api", "name": "David Plowman", "email": "david.plowman@raspberrypi.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/10955/mbox/", "series": [ { "id": 1597, "url": "https://patchwork.libcamera.org/api/1.1/series/1597/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1597", "date": "2021-01-22T10:22:06", "name": "Remove Raspberry Pi logging", "version": 1, "mbox": "https://patchwork.libcamera.org/series/1597/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/10955/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/10955/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 8D900BD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 22 Jan 2021 10:22:29 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1BCCE68250;\n\tFri, 22 Jan 2021 11:22:29 +0100 (CET)", "from mail-wr1-x430.google.com (mail-wr1-x430.google.com\n\t[IPv6:2a00:1450:4864:20::430])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D62F068232\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 22 Jan 2021 11:22:27 +0100 (CET)", "by mail-wr1-x430.google.com with SMTP id q7so4523222wre.13\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 22 Jan 2021 02:22:27 -0800 (PST)", "from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72])\n\tby smtp.gmail.com with ESMTPSA id\n\tp15sm11469221wrt.15.2021.01.22.02.22.26\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 22 Jan 2021 02:22:26 -0800 (PST)" ], "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"NbDhwyu7\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=wi2wYgUewmB6k9vz0bR3FoTRIyJ5PZT7Jge5CyshUWw=;\n\tb=NbDhwyu7oqe6yPpLX7w1NLQwdjOe40FYKySueuvXF0HZed8Y8FMDR5R0lYf22m1CLS\n\tHHz1Tl+RCjNJ8iRlR4YBw1/wJRXdj2nsDT2KmaeKaq545k4FuaV24KejG+7Quhw9j1NR\n\tti5A32pdsVNS0FPZ+ZGsoJtbX657HPeXwaB40ywmZXRFG+a5wkRdHbb4BxgtVQrTeRzl\n\t4CQGI/Y5dYnh/IIy4nwsjK4nsRgTyC1sbv7u06YNxhyjK9mREEGfIWNUJmhj07b7NmxY\n\tqhbJ1S3zo10jdyOTodpFdzvIvGbMvcxk23Ml1fNOVFRwIeBnigfchxGc/QgqBczr3csC\n\tXUXA==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=wi2wYgUewmB6k9vz0bR3FoTRIyJ5PZT7Jge5CyshUWw=;\n\tb=kbKtqztXs1FIvngwnycFVmnvUtQO36Fx6SDBEZza0OgKMa/WK4fRnovuXNZ75+aeme\n\tQ0Ljp9fhYF7wVEimmFfLser9fHCWQ3mjzhlmYgP1Zp4FFZ0XiOVIjgUU54jTFiXnzTXH\n\teS5TeB/poKDT7rTLiyZTmrF7ufZxeHy7hX53eVG1g5+EMxWRmoqG/EqeAVXEAfW4j05f\n\tdj/7uIibQp1LhzLq0fztw9GEnEJnJ39JGqB0AxyWo9Mk+zRGsxJTEFrHFxW/SD78fag8\n\tCndXXTAlSHdeY8mlOUsmwI+vk1qD6REtthmbRWixdFhcWU1KgxFznXh54t4sqnNOJsFF\n\t8/cw==", "X-Gm-Message-State": "AOAM533AFQoIVNyeXrf8i2ig3SrbnxHELeYZYwTYB9cx7Xwm5r6jQpkV\n\tJboj4fbLcun2xU0EnkI676lHEBgEjtAMFeR9", "X-Google-Smtp-Source": "ABdhPJzcnSpne8eo8MBxhGhHSmebRtetoKeT2YxJ2faDYcvmEmWwIHp4lBJ/vSFbjzxlj2kw8HTs/g==", "X-Received": "by 2002:adf:f58f:: with SMTP id\n\tf15mr3807351wro.388.1611310947103; \n\tFri, 22 Jan 2021 02:22:27 -0800 (PST)", "From": "David Plowman <david.plowman@raspberrypi.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Fri, 22 Jan 2021 10:22:10 +0000", "Message-Id": "<20210122102211.12768-5-david.plowman@raspberrypi.com>", "X-Mailer": "git-send-email 2.20.1", "In-Reply-To": "<20210122102211.12768-1-david.plowman@raspberrypi.com>", "References": "<20210122102211.12768-1-david.plowman@raspberrypi.com>", "MIME-Version": "1.0", "Subject": "[libcamera-devel] [PATCH 4/5] ipa: raspberrypi: Replace Raspberry\n\tPi debug with libcamera debug", "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>", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "This commit deals with all the \"small\" algorithms (that is, not\nAgc/Awb/Alsc).\n\nSigned-off-by: David Plowman <david.plowman@raspberrypi.com>\n---\n .../controller/rpi/black_level.cpp | 8 +++++--\n src/ipa/raspberrypi/controller/rpi/ccm.cpp | 24 +++++++++++--------\n .../raspberrypi/controller/rpi/contrast.cpp | 15 ++++++++----\n src/ipa/raspberrypi/controller/rpi/dpc.cpp | 8 +++++--\n src/ipa/raspberrypi/controller/rpi/geq.cpp | 18 ++++++++------\n src/ipa/raspberrypi/controller/rpi/lux.cpp | 12 ++++++----\n src/ipa/raspberrypi/controller/rpi/noise.cpp | 14 +++++++----\n src/ipa/raspberrypi/controller/rpi/sdn.cpp | 21 +++++++++-------\n .../raspberrypi/controller/rpi/sharpen.cpp | 8 +++++--\n 9 files changed, 83 insertions(+), 45 deletions(-)", "diff": "diff --git a/src/ipa/raspberrypi/controller/rpi/black_level.cpp b/src/ipa/raspberrypi/controller/rpi/black_level.cpp\nindex 0629b77c..99d6dd7f 100644\n--- a/src/ipa/raspberrypi/controller/rpi/black_level.cpp\n+++ b/src/ipa/raspberrypi/controller/rpi/black_level.cpp\n@@ -8,12 +8,16 @@\n #include <math.h>\n #include <stdint.h>\n \n+#include \"libcamera/internal/log.h\"\n+\n #include \"../black_level_status.h\"\n-#include \"../logging.hpp\"\n \n #include \"black_level.hpp\"\n \n using namespace RPiController;\n+using namespace libcamera;\n+\n+LOG_DEFINE_CATEGORY(RPiBlackLevel)\n \n #define NAME \"rpi.black_level\"\n \n@@ -29,7 +33,7 @@ char const *BlackLevel::Name() const\n \n void BlackLevel::Read(boost::property_tree::ptree const ¶ms)\n {\n-\tRPI_LOG(Name());\n+\tLOG(RPiBlackLevel, Debug) << Name();\n \tuint16_t black_level = params.get<uint16_t>(\n \t\t\"black_level\", 4096); // 64 in 10 bits scaled to 16 bits\n \tblack_level_r_ = params.get<uint16_t>(\"black_level_r\", black_level);\ndiff --git a/src/ipa/raspberrypi/controller/rpi/ccm.cpp b/src/ipa/raspberrypi/controller/rpi/ccm.cpp\nindex a8a2caff..25ac94f8 100644\n--- a/src/ipa/raspberrypi/controller/rpi/ccm.cpp\n+++ b/src/ipa/raspberrypi/controller/rpi/ccm.cpp\n@@ -5,15 +5,19 @@\n * ccm.cpp - CCM (colour correction matrix) control algorithm\n */\n \n+#include \"libcamera/internal/log.h\"\n+\n #include \"../awb_status.h\"\n #include \"../ccm_status.h\"\n-#include \"../logging.hpp\"\n #include \"../lux_status.h\"\n #include \"../metadata.hpp\"\n \n #include \"ccm.hpp\"\n \n using namespace RPiController;\n+using namespace libcamera;\n+\n+LOG_DEFINE_CATEGORY(RPiCcm)\n \n // This algorithm selects a CCM (Colour Correction Matrix) according to the\n // colour temperature estimated by AWB (interpolating between known matricies as\n@@ -129,9 +133,9 @@ void Ccm::Prepare(Metadata *image_metadata)\n \t\tlux_ok = get_locked(image_metadata, \"lux.status\", lux);\n \t}\n \tif (!awb_ok)\n-\t\tRPI_WARN(\"Ccm: no colour temperature found\");\n+\t\tLOG(RPiCcm, Warning) << \"Ccm: no colour temperature found\";\n \tif (!lux_ok)\n-\t\tRPI_WARN(\"Ccm: no lux value found\");\n+\t\tLOG(RPiCcm, Warning) << \"Ccm: no lux value found\";\n \tMatrix ccm = calculate_ccm(config_.ccms, awb.temperature_K);\n \tdouble saturation = saturation_;\n \tstruct CcmStatus ccm_status;\n@@ -144,13 +148,13 @@ void Ccm::Prepare(Metadata *image_metadata)\n \t\tfor (int i = 0; i < 3; i++)\n \t\t\tccm_status.matrix[j * 3 + i] =\n \t\t\t\tstd::max(-8.0, std::min(7.9999, ccm.m[j][i]));\n-\tRPI_LOG(\"CCM: colour temperature \" << awb.temperature_K << \"K\");\n-\tRPI_LOG(\"CCM: \" << ccm_status.matrix[0] << \" \" << ccm_status.matrix[1]\n-\t\t\t<< \" \" << ccm_status.matrix[2] << \" \"\n-\t\t\t<< ccm_status.matrix[3] << \" \" << ccm_status.matrix[4]\n-\t\t\t<< \" \" << ccm_status.matrix[5] << \" \"\n-\t\t\t<< ccm_status.matrix[6] << \" \" << ccm_status.matrix[7]\n-\t\t\t<< \" \" << ccm_status.matrix[8]);\n+\tLOG(RPiCcm, Debug) << \"CCM: colour temperature \" << awb.temperature_K << \"K\";\n+\tLOG(RPiCcm, Debug) << \"CCM: \" << ccm_status.matrix[0] << \" \" << ccm_status.matrix[1]\n+\t\t\t << \" \" << ccm_status.matrix[2] << \" \"\n+\t\t\t << ccm_status.matrix[3] << \" \" << ccm_status.matrix[4]\n+\t\t\t << \" \" << ccm_status.matrix[5] << \" \"\n+\t\t\t << ccm_status.matrix[6] << \" \" << ccm_status.matrix[7]\n+\t\t\t << \" \" << ccm_status.matrix[8];\n \timage_metadata->Set(\"ccm.status\", ccm_status);\n }\n \ndiff --git a/src/ipa/raspberrypi/controller/rpi/contrast.cpp b/src/ipa/raspberrypi/controller/rpi/contrast.cpp\nindex 103153db..a70ca612 100644\n--- a/src/ipa/raspberrypi/controller/rpi/contrast.cpp\n+++ b/src/ipa/raspberrypi/controller/rpi/contrast.cpp\n@@ -6,12 +6,17 @@\n */\n #include <stdint.h>\n \n+#include \"libcamera/internal/log.h\"\n+\n #include \"../contrast_status.h\"\n #include \"../histogram.hpp\"\n \n #include \"contrast.hpp\"\n \n using namespace RPiController;\n+using namespace libcamera;\n+\n+LOG_DEFINE_CATEGORY(RPiContrast)\n \n // This is a very simple control algorithm which simply retrieves the results of\n // AGC and AWB via their \"status\" metadata, and applies digital gain to the\n@@ -97,11 +102,11 @@ Pwl compute_stretch_curve(Histogram const &histogram,\n \tdouble hist_lo = histogram.Quantile(config.lo_histogram) *\n \t\t\t (65536 / NUM_HISTOGRAM_BINS);\n \tdouble level_lo = config.lo_level * 65536;\n-\tRPI_LOG(\"Move histogram point \" << hist_lo << \" to \" << level_lo);\n+\tLOG(RPiContrast, Debug) << \"Move histogram point \" << hist_lo << \" to \" << level_lo;\n \thist_lo = std::max(\n \t\tlevel_lo,\n \t\tstd::min(65535.0, std::min(hist_lo, level_lo + config.lo_max)));\n-\tRPI_LOG(\"Final values \" << hist_lo << \" -> \" << level_lo);\n+\tLOG(RPiContrast, Debug) << \"Final values \" << hist_lo << \" -> \" << level_lo;\n \tenhance.Append(hist_lo, level_lo);\n \t// Keep the mid-point (median) in the same place, though, to limit the\n \t// apparent amount of global brightness shift.\n@@ -113,11 +118,11 @@ Pwl compute_stretch_curve(Histogram const &histogram,\n \tdouble hist_hi = histogram.Quantile(config.hi_histogram) *\n \t\t\t (65536 / NUM_HISTOGRAM_BINS);\n \tdouble level_hi = config.hi_level * 65536;\n-\tRPI_LOG(\"Move histogram point \" << hist_hi << \" to \" << level_hi);\n+\tLOG(RPiContrast, Debug) << \"Move histogram point \" << hist_hi << \" to \" << level_hi;\n \thist_hi = std::min(\n \t\tlevel_hi,\n \t\tstd::max(0.0, std::max(hist_hi, level_hi - config.hi_max)));\n-\tRPI_LOG(\"Final values \" << hist_hi << \" -> \" << level_hi);\n+\tLOG(RPiContrast, Debug) << \"Final values \" << hist_hi << \" -> \" << level_hi;\n \tenhance.Append(hist_hi, level_hi);\n \tenhance.Append(65535, 65535);\n \treturn enhance;\n@@ -127,7 +132,7 @@ Pwl apply_manual_contrast(Pwl const &gamma_curve, double brightness,\n \t\t\t double contrast)\n {\n \tPwl new_gamma_curve;\n-\tRPI_LOG(\"Manual brightness \" << brightness << \" contrast \" << contrast);\n+\tLOG(RPiContrast, Debug) << \"Manual brightness \" << brightness << \" contrast \" << contrast;\n \tgamma_curve.Map([&](double x, double y) {\n \t\tnew_gamma_curve.Append(\n \t\t\tx, std::max(0.0, std::min(65535.0,\ndiff --git a/src/ipa/raspberrypi/controller/rpi/dpc.cpp b/src/ipa/raspberrypi/controller/rpi/dpc.cpp\nindex 348e1609..a48ae2dd 100644\n--- a/src/ipa/raspberrypi/controller/rpi/dpc.cpp\n+++ b/src/ipa/raspberrypi/controller/rpi/dpc.cpp\n@@ -5,10 +5,14 @@\n * dpc.cpp - DPC (defective pixel correction) control algorithm\n */\n \n-#include \"../logging.hpp\"\n+#include \"libcamera/internal/log.h\"\n+\n #include \"dpc.hpp\"\n \n using namespace RPiController;\n+using namespace libcamera;\n+\n+LOG_DEFINE_CATEGORY(RPiDpc)\n \n // We use the lux status so that we can apply stronger settings in darkness (if\n // necessary).\n@@ -37,7 +41,7 @@ void Dpc::Prepare(Metadata *image_metadata)\n \tDpcStatus dpc_status = {};\n \t// Should we vary this with lux level or analogue gain? TBD.\n \tdpc_status.strength = config_.strength;\n-\tRPI_LOG(\"Dpc: strength \" << dpc_status.strength);\n+\tLOG(RPiDpc, Debug) << \"Dpc: strength \" << dpc_status.strength;\n \timage_metadata->Set(\"dpc.status\", dpc_status);\n }\n \ndiff --git a/src/ipa/raspberrypi/controller/rpi/geq.cpp b/src/ipa/raspberrypi/controller/rpi/geq.cpp\nindex b6c98414..e2bd2b06 100644\n--- a/src/ipa/raspberrypi/controller/rpi/geq.cpp\n+++ b/src/ipa/raspberrypi/controller/rpi/geq.cpp\n@@ -5,14 +5,18 @@\n * geq.cpp - GEQ (green equalisation) control algorithm\n */\n \n+#include \"libcamera/internal/log.h\"\n+\n #include \"../device_status.h\"\n-#include \"../logging.hpp\"\n #include \"../lux_status.h\"\n #include \"../pwl.hpp\"\n \n #include \"geq.hpp\"\n \n using namespace RPiController;\n+using namespace libcamera;\n+\n+LOG_DEFINE_CATEGORY(RPiGeq)\n \n // We use the lux status so that we can apply stronger settings in darkness (if\n // necessary).\n@@ -44,11 +48,11 @@ void Geq::Prepare(Metadata *image_metadata)\n \tLuxStatus lux_status = {};\n \tlux_status.lux = 400;\n \tif (image_metadata->Get(\"lux.status\", lux_status))\n-\t\tRPI_WARN(\"Geq: no lux data found\");\n+\t\tLOG(RPiGeq, Warning) << \"Geq: no lux data found\";\n \tDeviceStatus device_status = {};\n \tdevice_status.analogue_gain = 1.0; // in case not found\n \tif (image_metadata->Get(\"device.status\", device_status))\n-\t\tRPI_WARN(\"Geq: no device metadata - use analogue gain of 1x\");\n+\t\tLOG(RPiGeq, Warning) << \"Geq: no device metadata - use analogue gain of 1x\";\n \tGeqStatus geq_status = {};\n \tdouble strength =\n \t\tconfig_.strength.Empty()\n@@ -60,10 +64,10 @@ void Geq::Prepare(Metadata *image_metadata)\n \tdouble slope = config_.slope * strength;\n \tgeq_status.offset = std::min(65535.0, std::max(0.0, offset));\n \tgeq_status.slope = std::min(.99999, std::max(0.0, slope));\n-\tRPI_LOG(\"Geq: offset \" << geq_status.offset << \" slope \"\n-\t\t\t << geq_status.slope << \" (analogue gain \"\n-\t\t\t << device_status.analogue_gain << \" lux \"\n-\t\t\t << lux_status.lux << \")\");\n+\tLOG(RPiGeq, Debug) << \"Geq: offset \" << geq_status.offset << \" slope \"\n+\t\t\t << geq_status.slope << \" (analogue gain \"\n+\t\t\t << device_status.analogue_gain << \" lux \"\n+\t\t\t << lux_status.lux << \")\";\n \timage_metadata->Set(\"geq.status\", geq_status);\n }\n \ndiff --git a/src/ipa/raspberrypi/controller/rpi/lux.cpp b/src/ipa/raspberrypi/controller/rpi/lux.cpp\nindex 5acd49a0..d3f067a7 100644\n--- a/src/ipa/raspberrypi/controller/rpi/lux.cpp\n+++ b/src/ipa/raspberrypi/controller/rpi/lux.cpp\n@@ -8,12 +8,16 @@\n \n #include \"linux/bcm2835-isp.h\"\n \n+#include \"libcamera/internal/log.h\"\n+\n #include \"../device_status.h\"\n-#include \"../logging.hpp\"\n \n #include \"lux.hpp\"\n \n using namespace RPiController;\n+using namespace libcamera;\n+\n+LOG_DEFINE_CATEGORY(RPiLux)\n \n #define NAME \"rpi.lux\"\n \n@@ -33,7 +37,7 @@ char const *Lux::Name() const\n \n void Lux::Read(boost::property_tree::ptree const ¶ms)\n {\n-\tRPI_LOG(Name());\n+\tLOG(RPiLux, Debug) << Name();\n \treference_shutter_speed_ =\n \t\tparams.get<double>(\"reference_shutter_speed\");\n \treference_gain_ = params.get<double>(\"reference_gain\");\n@@ -84,7 +88,7 @@ void Lux::Process(StatisticsPtr &stats, Metadata *image_metadata)\n \t\tLuxStatus status;\n \t\tstatus.lux = estimated_lux;\n \t\tstatus.aperture = current_aperture;\n-\t\tRPI_LOG(Name() << \": estimated lux \" << estimated_lux);\n+\t\tLOG(RPiLux, Debug) << Name() << \": estimated lux \" << estimated_lux;\n \t\t{\n \t\t\tstd::unique_lock<std::mutex> lock(mutex_);\n \t\t\tstatus_ = status;\n@@ -93,7 +97,7 @@ void Lux::Process(StatisticsPtr &stats, Metadata *image_metadata)\n \t\t// algorithms get the latest value.\n \t\timage_metadata->Set(\"lux.status\", status);\n \t} else\n-\t\tRPI_WARN(Name() << \": no device metadata\");\n+\t\tLOG(RPiLux, Warning) << Name() << \": no device metadata\";\n }\n \n // Register algorithm with the system.\ndiff --git a/src/ipa/raspberrypi/controller/rpi/noise.cpp b/src/ipa/raspberrypi/controller/rpi/noise.cpp\nindex 9e9eaf1b..ba65b4c5 100644\n--- a/src/ipa/raspberrypi/controller/rpi/noise.cpp\n+++ b/src/ipa/raspberrypi/controller/rpi/noise.cpp\n@@ -7,13 +7,17 @@\n \n #include <math.h>\n \n+#include \"libcamera/internal/log.h\"\n+\n #include \"../device_status.h\"\n-#include \"../logging.hpp\"\n #include \"../noise_status.h\"\n \n #include \"noise.hpp\"\n \n using namespace RPiController;\n+using namespace libcamera;\n+\n+LOG_DEFINE_CATEGORY(RPiNoise)\n \n #define NAME \"rpi.noise\"\n \n@@ -37,7 +41,7 @@ void Noise::SwitchMode(CameraMode const &camera_mode,\n \n void Noise::Read(boost::property_tree::ptree const ¶ms)\n {\n-\tRPI_LOG(Name());\n+\tLOG(RPiNoise, Debug) << Name();\n \treference_constant_ = params.get<double>(\"reference_constant\");\n \treference_slope_ = params.get<double>(\"reference_slope\");\n }\n@@ -58,10 +62,10 @@ void Noise::Prepare(Metadata *image_metadata)\n \t\tstatus.noise_constant = reference_constant_ * factor;\n \t\tstatus.noise_slope = reference_slope_ * factor;\n \t\timage_metadata->Set(\"noise.status\", status);\n-\t\tRPI_LOG(Name() << \": constant \" << status.noise_constant\n-\t\t\t << \" slope \" << status.noise_slope);\n+\t\tLOG(RPiNoise, Debug) << Name() << \": constant \" << status.noise_constant\n+\t\t\t\t << \" slope \" << status.noise_slope;\n \t} else\n-\t\tRPI_WARN(Name() << \" no metadata\");\n+\t\tLOG(RPiNoise, Warning) << Name() << \" no metadata\";\n }\n \n // Register algorithm with the system.\ndiff --git a/src/ipa/raspberrypi/controller/rpi/sdn.cpp b/src/ipa/raspberrypi/controller/rpi/sdn.cpp\nindex aa82830b..5de1a60f 100644\n--- a/src/ipa/raspberrypi/controller/rpi/sdn.cpp\n+++ b/src/ipa/raspberrypi/controller/rpi/sdn.cpp\n@@ -5,12 +5,17 @@\n * sdn.cpp - SDN (spatial denoise) control algorithm\n */\n \n+#include \"libcamera/internal/log.h\"\n+\n #include \"../noise_status.h\"\n #include \"../sdn_status.h\"\n \n #include \"sdn.hpp\"\n \n using namespace RPiController;\n+using namespace libcamera;\n+\n+LOG_DEFINE_CATEGORY(RPiSdn)\n \n // Calculate settings for the spatial denoise block using the noise profile in\n // the image metadata.\n@@ -40,19 +45,19 @@ void Sdn::Prepare(Metadata *image_metadata)\n \tstruct NoiseStatus noise_status = {};\n \tnoise_status.noise_slope = 3.0; // in case no metadata\n \tif (image_metadata->Get(\"noise.status\", noise_status) != 0)\n-\t\tRPI_WARN(\"Sdn: no noise profile found\");\n-\tRPI_LOG(\"Noise profile: constant \" << noise_status.noise_constant\n-\t\t\t\t\t << \" slope \"\n-\t\t\t\t\t << noise_status.noise_slope);\n+\t\tLOG(RPiSdn, Warning) << \"Sdn: no noise profile found\";\n+\tLOG(RPiSdn, Debug) << \"Noise profile: constant \" << noise_status.noise_constant\n+\t\t\t << \" slope \"\n+\t\t\t << noise_status.noise_slope;\n \tstruct SdnStatus status;\n \tstatus.noise_constant = noise_status.noise_constant * deviation_;\n \tstatus.noise_slope = noise_status.noise_slope * deviation_;\n \tstatus.strength = strength_;\n \timage_metadata->Set(\"sdn.status\", status);\n-\tRPI_LOG(\"Sdn: programmed constant \" << status.noise_constant\n-\t\t\t\t\t << \" slope \" << status.noise_slope\n-\t\t\t\t\t << \" strength \"\n-\t\t\t\t\t << status.strength);\n+\tLOG(RPiSdn, Debug) << \"Sdn: programmed constant \" << status.noise_constant\n+\t\t\t << \" slope \" << status.noise_slope\n+\t\t\t << \" strength \"\n+\t\t\t << status.strength;\n }\n \n // Register algorithm with the system.\ndiff --git a/src/ipa/raspberrypi/controller/rpi/sharpen.cpp b/src/ipa/raspberrypi/controller/rpi/sharpen.cpp\nindex c953a7d9..18d5cc86 100644\n--- a/src/ipa/raspberrypi/controller/rpi/sharpen.cpp\n+++ b/src/ipa/raspberrypi/controller/rpi/sharpen.cpp\n@@ -7,12 +7,16 @@\n \n #include <math.h>\n \n-#include \"../logging.hpp\"\n+#include \"libcamera/internal/log.h\"\n+\n #include \"../sharpen_status.h\"\n \n #include \"sharpen.hpp\"\n \n using namespace RPiController;\n+using namespace libcamera;\n+\n+LOG_DEFINE_CATEGORY(RPiSharpen)\n \n #define NAME \"rpi.sharpen\"\n \n@@ -35,7 +39,7 @@ void Sharpen::SwitchMode(CameraMode const &camera_mode,\n \n void Sharpen::Read(boost::property_tree::ptree const ¶ms)\n {\n-\tRPI_LOG(Name());\n+\tLOG(RPiSharpen, Debug) << Name();\n \tthreshold_ = params.get<double>(\"threshold\", 1.0);\n \tstrength_ = params.get<double>(\"strength\", 1.0);\n \tlimit_ = params.get<double>(\"limit\", 1.0);\n", "prefixes": [ "libcamera-devel", "4/5" ] }