[{"id":37349,"web_url":"https://patchwork.libcamera.org/comment/37349/","msgid":"<85zf7npfa8.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","date":"2025-12-12T21:21:35","subject":"Re: [PATCH v8 20/26] libcamera: software_isp: ccm: Add\n\tself-initialising identity CCM to Ccm::init","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Bryan O'Donoghue <bryan.odonoghue@linaro.org> writes:\n\n> We have a need to generate an identity CCM when running the GPUIsp without\n> a sensor tuning file.\n>\n> A preivous patch added a selfInitialising bool to the IPAContext structure.\n> When that bool is true generate an identity CCM at colour temperature\n> 6500k.\n>\n> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>\n\nThe patch looks OK to me now and I could put my Reviewed-By on it.  But\nthinking about it, I'd suggest to split this series (well, after the\nprecursor series is merged, to keep things manageable).\n\nI think the patches up to \"Make gpuisp default softisp mode\" (included)\nare on a good track and might be merged soon to bring the GPU ISP\nsupport in.\n\nBut the following patches may need re-evaluation.  I think my simple IPA\ncleanup series\n(https://patchwork.libcamera.org/project/libcamera/list/?series=5597)\nresolves many problems that the last patches here try to address.\nSwitching from the current CCM handling to a combined matrix, better\nisolation of all the algorithms, LUT algorithm removal and moving LUT\nconstruction to CPU debayering might perhaps replace the stuff here.\n\nSo my suggestion would be to work towards merging the first part, then\nto rebase my simple IPA cleanup and work on it.  I hope the patches\ncould be reviewed relatively easily once rebased (they are RFC only\nbecause they wait for merged GPU ISP).  Then we'll see whether something\nfrom the rest of this series is still needed.\n\nThe last \"TODO\" patch can be added to the patches to be merged, of\ncourse.\n\n> ---\n>  src/ipa/simple/algorithms/ccm.cpp | 22 ++++++++++++++++------\n>  1 file changed, 16 insertions(+), 6 deletions(-)\n>\n> diff --git a/src/ipa/simple/algorithms/ccm.cpp b/src/ipa/simple/algorithms/ccm.cpp\n> index 0a98406c1..ac1ce1685 100644\n> --- a/src/ipa/simple/algorithms/ccm.cpp\n> +++ b/src/ipa/simple/algorithms/ccm.cpp\n> @@ -27,13 +27,23 @@ namespace ipa::soft::algorithms {\n>  \n>  LOG_DEFINE_CATEGORY(IPASoftCcm)\n>  \n> -int Ccm::init([[maybe_unused]] IPAContext &context, const YamlObject &tuningData)\n> +int Ccm::init([[maybe_unused]] IPAContext &context, [[maybe_unused]] const YamlObject &tuningData)\n>  {\n> -\tint ret = ccm_.readYaml(tuningData[\"ccms\"], \"ct\", \"ccm\");\n> -\tif (ret < 0) {\n> -\t\tLOG(IPASoftCcm, Error)\n> -\t\t\t<< \"Failed to parse 'ccm' parameter from tuning file.\";\n> -\t\treturn ret;\n> +\tif (!context.selfInitialising) {\n> +\t\tint ret = ccm_.readYaml(tuningData[\"ccms\"], \"ct\", \"ccm\");\n> +\t\tif (ret < 0) {\n> +\t\t\tLOG(IPASoftCcm, Error)\n> +\t\t\t\t<< \"Failed to parse 'ccm' parameter from tuning file.\";\n> +\t\t\treturn ret;\n> +\t\t}\n> +\t} else {\n> +\t\t/* Initialize with identity CCM at standard D65 color temperature */\n> +\t\tMatrix<float, 3, 3> identityMatrix = Matrix<float, 3, 3>::identity();\n> +\n> +\t\tstd::map<unsigned int, Matrix<float, 3, 3>> ccmData;\n> +\t\tccmData[6500] = identityMatrix;\n> +\n> +\t\tccm_ = Interpolator<Matrix<float, 3, 3>>(std::move(ccmData));\n>  \t}\n>  \n>  \tcontext.ccmEnabled = true;","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 33285BD1F1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 12 Dec 2025 21:21:43 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 47A6761893;\n\tFri, 12 Dec 2025 22:21:42 +0100 (CET)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.133.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 81ABE6142F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 12 Dec 2025 22:21:40 +0100 (CET)","from mail-wm1-f69.google.com (mail-wm1-f69.google.com\n\t[209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-656-j3aMwCWyPYufxvBx1mHBgA-1; Fri, 12 Dec 2025 16:21:38 -0500","by mail-wm1-f69.google.com with SMTP id\n\t5b1f17b1804b1-4776079ada3so14565945e9.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 12 Dec 2025 13:21:37 -0800 (PST)","from mzamazal-thinkpadp1gen7.tpbc.csb\n\t(ip-77-48-47-2.net.vodafone.cz. [77.48.47.2])\n\tby smtp.gmail.com with ESMTPSA id\n\t5b1f17b1804b1-47a8f8f39c6sm48391965e9.14.2025.12.12.13.21.35\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 12 Dec 2025 13:21:35 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"itJA5516\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1765574499;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=q+r0X5VgkFtRYl9nHoypy+JgpUlA9FvnsT79Wgbngic=;\n\tb=itJA5516gJnm5rM+6n8Cn5kvLIq8mjOAeebXP757Eg80HTIl2CnvqJy5NgKH+soLsf709l\n\tqfZWdx9aebpYxciJlmfQVhjAUlZCU909Ig+t32i4vgJdI/r54Y/Ak8lUCeKFyW4FPL9aUJ\n\tpPKqNbjpVJOMON48sdB+oK7b158vcOA=","X-MC-Unique":"j3aMwCWyPYufxvBx1mHBgA-1","X-Mimecast-MFC-AGG-ID":"j3aMwCWyPYufxvBx1mHBgA_1765574497","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1765574497; x=1766179297;\n\th=mime-version:user-agent:message-id:date:references:in-reply-to\n\t:subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject\n\t:date:message-id:reply-to;\n\tbh=q+r0X5VgkFtRYl9nHoypy+JgpUlA9FvnsT79Wgbngic=;\n\tb=P/JHtxPlhNzcXWY4QIuB42j/QU/1T5uLgHURn7eu8gHIosI/e/Vk13dnRE5wFw0ROV\n\t0yGg0AYgeAMxAd+PFFXxEny7FRLtpSMQ4WFt1M5+GqzQciFnLNsjx5/8sn23dJPE3hpw\n\t6b4Nsc69DyxdxK4DKUE1YHuQLE+wj51iBZJiIO1I8xWIewJP24XcQU1enRdUJR13Zp0r\n\tkyD3uysXlwN4ZxHR8wW8ileUvNGv80AdhYurQqP0H001NeBBobz1inp6nQ+j/Bp+eqzK\n\tpZ6TCsWkDclxgXWcxU/RDkIngK7cInn8O+B2a9Fd1keNBu2upOv6wMQw3UWpH+CMjTMz\n\t+CEg==","X-Gm-Message-State":"AOJu0YyAOJdxHsiQT2w8kiN/0nQrpOKhcPcZ35IErsJYA3IptaqTUvT1\n\tCEfs2ARHDl8qA/BhHWGEqLJUmtgO8uRFNYHpvfRRYvOYTxbH5mpHo2n+zUMfxhdN1r3YtsH8MMz\n\toezttDnj4TAhABMCnZDGMWFXq0fsdMqo7JNdzfSGyYfoT10DeB2wgJ8xPgQamTl+Y3VGFKirLXV\n\tM=","X-Gm-Gg":"AY/fxX5/bpp0/tXgSOCwDv73JjeUgAnlK6pNryMf7LWjwVWBMNrR69RR91oP9OMDRbh\n\t7eXziKbz/uM2rk2t3gO+K0JMsTREFJOLrTdqxzbj/VNWO5hnB5Kr/xKE6CVL3OBNkQo9OLuVWnW\n\tuKv+FArCIXO6BO3uT4qShZhtvrV+foc2Pa+gsCZ5gyJCYA1hPZ71zpEm1cRRtdpZ11eCF1rcwWF\n\tSSl72RzNfM696e+5wteTYxnW319b8sdCqpDM+DJF7LU/w4LkH1U9qDO/wlKl8BAq7VODIoFSTgT\n\tB0ABTweF5uEHnJGsMi+5ZbidLQ5NRhGsOezk60sRhi8X6f6B+kP5yC7qlTmy4HpQSKdPWHsRbn2\n\tKRDeBFVQSE7uwusuFNGH7VDx3qEpbZ7xjtWXPUXzUoSkOdjuSyB1IWpMjYPTAbUk=","X-Received":["by 2002:a05:600c:4ed0:b0:477:79c7:8994 with SMTP id\n\t5b1f17b1804b1-47a8f90ea5fmr40908665e9.30.1765574496778; \n\tFri, 12 Dec 2025 13:21:36 -0800 (PST)","by 2002:a05:600c:4ed0:b0:477:79c7:8994 with SMTP id\n\t5b1f17b1804b1-47a8f90ea5fmr40908525e9.30.1765574496342; \n\tFri, 12 Dec 2025 13:21:36 -0800 (PST)"],"X-Google-Smtp-Source":"AGHT+IFvvRE0MVfqylY+SXe2Ec+ehtx039C+AYWtXGwYejJMXjV2FVOTOSPQODyB9QSbvsljOvJCYw==","From":"Milan Zamazal <mzamazal@redhat.com>","To":"Bryan O'Donoghue <bryan.odonoghue@linaro.org>","Cc":"libcamera-devel@lists.libcamera.org,  pavel@ucw.cz","Subject":"Re: [PATCH v8 20/26] libcamera: software_isp: ccm: Add\n\tself-initialising identity CCM to Ccm::init","In-Reply-To":"<20251212002937.3118-21-bryan.odonoghue@linaro.org> (Bryan\n\tO'Donoghue's message of \"Fri, 12 Dec 2025 00:29:31 +0000\")","References":"<20251212002937.3118-1-bryan.odonoghue@linaro.org>\n\t<20251212002937.3118-21-bryan.odonoghue@linaro.org>","Date":"Fri, 12 Dec 2025 22:21:35 +0100","Message-ID":"<85zf7npfa8.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","User-Agent":"Gnus/5.13 (Gnus v5.13)","MIME-Version":"1.0","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"nYBh1-QGGOQK60zpKm4HY9GlRIxBzc03F3jMuKabT10_1765574497","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain","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>"}},{"id":37352,"web_url":"https://patchwork.libcamera.org/comment/37352/","msgid":"<afad25fc-219e-481f-8d5e-642b0be1bf2a@linaro.org>","date":"2025-12-12T22:31:40","subject":"Re: [PATCH v8 20/26] libcamera: software_isp: ccm: Add\n\tself-initialising identity CCM to Ccm::init","submitter":{"id":175,"url":"https://patchwork.libcamera.org/api/people/175/","name":"Bryan O'Donoghue","email":"bryan.odonoghue@linaro.org"},"content":"On 12/12/2025 21:21, Milan Zamazal wrote:\n> Bryan O'Donoghue <bryan.odonoghue@linaro.org> writes:\n> \n>> We have a need to generate an identity CCM when running the GPUIsp without\n>> a sensor tuning file.\n>>\n>> A preivous patch added a selfInitialising bool to the IPAContext structure.\n>> When that bool is true generate an identity CCM at colour temperature\n>> 6500k.\n>>\n>> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>\n> \n> The patch looks OK to me now and I could put my Reviewed-By on it.  But\n> thinking about it, I'd suggest to split this series (well, after the\n> precursor series is merged, to keep things manageable).\n> \n> I think the patches up to \"Make gpuisp default softisp mode\" (included)\n> are on a good track and might be merged soon to bring the GPU ISP\n> support in.\n> \n> But the following patches may need re-evaluation.  I think my simple IPA\n> cleanup series\n> (https://patchwork.libcamera.org/project/libcamera/list/?series=5597)\n> resolves many problems that the last patches here try to address.\n> Switching from the current CCM handling to a combined matrix, better\n> isolation of all the algorithms, LUT algorithm removal and moving LUT\n> construction to CPU debayering might perhaps replace the stuff here.\n\nHmm. Could you not rebase your stuff on top of this ? This series is at \nversion 8 with your proposed series at V2 RFC.\n\nWe were supposed to be aiming to get this series in for 0.6.0 which we \nmissed.\n\nAdding another dependency on 13 more patches 8/13 have no RB yet.\n\nI'd really rather get this series finished/in instead of establishing \neven more dependencies.\n\n---\nbod","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 286BFBD1F1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 12 Dec 2025 22:31:50 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6EA6461920;\n\tFri, 12 Dec 2025 23:31:49 +0100 (CET)","from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com\n\t[IPv6:2607:f8b0:4864:20::1032])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CB21E6142F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 12 Dec 2025 23:31:46 +0100 (CET)","by mail-pj1-x1032.google.com with SMTP id\n\t98e67ed59e1d1-340bb1cb9ddso1496724a91.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 12 Dec 2025 14:31:46 -0800 (PST)","from [10.237.118.45] (M106185144161.v4.enabler.ne.jp.\n\t[106.185.144.161]) by smtp.gmail.com with ESMTPSA id\n\t98e67ed59e1d1-34abe2b0983sm2819234a91.16.2025.12.12.14.31.42\n\t(version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n\tFri, 12 Dec 2025 14:31:44 -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=\"rOhVWjGu\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=linaro.org; s=google; t=1765578705; x=1766183505;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:in-reply-to:from:content-language\n\t:references:cc:to:subject:user-agent:mime-version:date:message-id\n\t:from:to:cc:subject:date:message-id:reply-to;\n\tbh=GJMm4tHB3BvW6ePLxmpmzS8K4tSavTneWUHiP9b8QII=;\n\tb=rOhVWjGuUw3JCbZKrLGkaHPyq2m+kJmzG+ZDghR85sKboEucJHBxGO4GedqZ2sCoBK\n\tX5Trm+pjb6PbPLhwsiCyBCL3Puglm9doUSMtdsFcPtEvlXXwEQsy9nbg45HL/Pb2ol42\n\tIXUvzGv75zIil0AF+WuUKwz0++SFSF0c+MlFJwy0CDnzRHgqzMHbGzy5tuD2yk5Vneh3\n\tXj0gRAw2S7RqC8Ukl/7P14G372qNbqvtLEySAs5ByK+XvhXPVK6ckZcnqd5K8HQ5RaIC\n\t76rkVBzbqA1/S2gv6Idf0i6tV2OjWILm87HCYgZpKMnpAXNtyyf2xFTDyo2ig4FW3jKw\n\twYdA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1765578705; x=1766183505;\n\th=content-transfer-encoding:in-reply-to:from:content-language\n\t:references:cc:to:subject:user-agent:mime-version:date:message-id\n\t:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=GJMm4tHB3BvW6ePLxmpmzS8K4tSavTneWUHiP9b8QII=;\n\tb=mF/WPM9275a5IBMBrYMZQIYHQXSPj2FbqJcXtZs2ltpT7lo5qt90Q2GXV/4xyckvy5\n\tQpr3hUz/yPBsFm+rxA04/duDuO5Rtuoz1GlM0Kgyt2lHxHpR4McquHRH7g0rbSn38BOW\n\thmVE70hvpoQ0aQix7ThNBUyWyKj3JUhCkPARnXgs6Vnv2WFu2JYmX8XHV8AbMORBkAOM\n\tAtUCDQgbJ9Gb/fhx0tNkrGCowfm/qv7N3LuitIPLZxazgOFHy/mt+YHqZqA6ysIcoOWN\n\t/DCOXeMuakZPu0R8eDNGUMbdCkjprt9Tf6bKj/tMKmCTRRaaeLGnCs5oBCUTHg/+lMMM\n\t8e+Q==","X-Gm-Message-State":"AOJu0Ywo9zSbLG9aOQS2GB1e817LGhKZJHGWnoEShsr3lT88fXxZLgnn\n\tbg3mLit3AleiqmD92ODVswGE5zycufHJM7bDT5SktJ2LzJMG7HapR9GOO5MznIHIJDw=","X-Gm-Gg":"AY/fxX5wNgnbai8F625sY9gQC1qgaAXvPLonwcBk6L3immwTBPs5Kbwdpa4o5zjCraI\n\tVjJOhiqFMqn5Rv8S3teympUhaDWi6GlzPP/0y479h2519MZJxU5t9YiBNKW+wCbRmrUQO7odByH\n\toiGEFt+6yp7SlohcaosfK103mOVpYhBcpzt0Ao/swphnnFF6cxtzstw1+WVSzMSyl8C1aeRCiex\n\tEUeN6taQw+dO5/0yyIhcMv21KHtUFUI4UT+bzYqiqFAQonQsgHbfECtaD4i9zygnmeKwattiXl6\n\texlbDTepv+31kD3GOAmQrySUj+pTaBYB9Ee4u8zUJGVlUqo20Ed3SZ3ix3NBhKmfP9kv21atm6c\n\tnpUuZZRF6yiEaFeBza77RYHcplRqpNLcl7oMSiRc+ca0+gfvwcTP776E7X6PJQ074mW1XynZHlL\n\tKgKczAfaGmq1+aYMemF5Zmfr64UuQ6FDlQuGQJIOf0ducwecROovHT9atClTk=","X-Google-Smtp-Source":"AGHT+IE8Dp3PQY1i/+y2i4pDSRa0lvJEevgu9rPZp6+6VOp1G6uRGUGsVFRA+Hw9p9bow/94+na8/w==","X-Received":"by 2002:a17:90b:3912:b0:335:2eef:4ca8 with SMTP id\n\t98e67ed59e1d1-34abd77fbbdmr2892113a91.33.1765578704921; \n\tFri, 12 Dec 2025 14:31:44 -0800 (PST)","Message-ID":"<afad25fc-219e-481f-8d5e-642b0be1bf2a@linaro.org>","Date":"Fri, 12 Dec 2025 22:31:40 +0000","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v8 20/26] libcamera: software_isp: ccm: Add\n\tself-initialising identity CCM to Ccm::init","To":"Milan Zamazal <mzamazal@redhat.com>","Cc":"libcamera-devel@lists.libcamera.org, pavel@ucw.cz","References":"<20251212002937.3118-1-bryan.odonoghue@linaro.org>\n\t<20251212002937.3118-21-bryan.odonoghue@linaro.org>\n\t<85zf7npfa8.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","Content-Language":"en-US","From":"Bryan O'Donoghue <bryan.odonoghue@linaro.org>","In-Reply-To":"<85zf7npfa8.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","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>"}},{"id":37369,"web_url":"https://patchwork.libcamera.org/comment/37369/","msgid":"<85y0n4f2us.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","date":"2025-12-15T10:36:59","subject":"Re: [PATCH v8 20/26] libcamera: software_isp: ccm: Add\n\tself-initialising identity CCM to Ccm::init","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Bryan O'Donoghue <bryan.odonoghue@linaro.org> writes:\n\n> On 12/12/2025 21:21, Milan Zamazal wrote:\n>> Bryan O'Donoghue <bryan.odonoghue@linaro.org> writes:\n>> \n>\n>>> We have a need to generate an identity CCM when running the GPUIsp without\n>>> a sensor tuning file.\n>>>\n>>> A preivous patch added a selfInitialising bool to the IPAContext structure.\n>>> When that bool is true generate an identity CCM at colour temperature\n>>> 6500k.\n>>>\n>>> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>\n>> The patch looks OK to me now and I could put my Reviewed-By on it.  But\n>> thinking about it, I'd suggest to split this series (well, after the\n>> precursor series is merged, to keep things manageable).\n>> I think the patches up to \"Make gpuisp default softisp mode\" (included)\n>> are on a good track and might be merged soon to bring the GPU ISP\n>> support in.\n>> But the following patches may need re-evaluation.  I think my simple IPA\n>> cleanup series\n>> (https://patchwork.libcamera.org/project/libcamera/list/?series=5597)\n>> resolves many problems that the last patches here try to address.\n>> Switching from the current CCM handling to a combined matrix, better\n>> isolation of all the algorithms, LUT algorithm removal and moving LUT\n>> construction to CPU debayering might perhaps replace the stuff here.\n>\n> Hmm. Could you not rebase your stuff on top of this ? \n\nI will, but only once the GPU ISP patches are merged.  Rebasing is often\npainful and error prone and there is no need to bother with it in this\ncase while the underlying patches are not merged and may change.\n\n> This series is at version 8 with your proposed series at V2 RFC.\n>\n> We were supposed to be aiming to get this series in for 0.6.0 which we missed.\n>\n> Adding another dependency on 13 more patches 8/13 have no RB yet.\n>\n> I'd really rather get this series finished/in instead of establishing even more dependencies.\n\nThis is not another dependency, this is an independent/followup work\nthat may replace most of the patches #19-25.  Up to you whether you\nprefer working on getting the patches merged now or keep them aside\nuntil the IPA cleanup is done.  I don't mind either way, I can ack the\npatches right now and it's easy reverting them later if needed.","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 4EA17C3257\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 15 Dec 2025 10:37:08 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 47EB86194C;\n\tMon, 15 Dec 2025 11:37:07 +0100 (CET)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.133.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 813AB606D5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 15 Dec 2025 11:37:05 +0100 (CET)","from mail-wm1-f69.google.com (mail-wm1-f69.google.com\n\t[209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-84-LnXYRailOhCkleBM545JuA-1; Mon, 15 Dec 2025 05:37:02 -0500","by mail-wm1-f69.google.com with SMTP id\n\t5b1f17b1804b1-477a11d9f89so3032215e9.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 15 Dec 2025 02:37:02 -0800 (PST)","from mzamazal-thinkpadp1gen7.tpbc.csb\n\t(ip-77-48-47-2.net.vodafone.cz. [77.48.47.2])\n\tby smtp.gmail.com with ESMTPSA id\n\t5b1f17b1804b1-47a8f8d9c6fsm180844605e9.11.2025.12.15.02.36.59\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 15 Dec 2025 02:37:00 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"ZReV8M1o\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1765795024;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=GZDqYlsyQlfJSAg5HAl3Q8AT51QUjTdT0ilhPFJrOFI=;\n\tb=ZReV8M1o1fcB8b4Q+zFMxDboIg+vykLhTRxxzEmgRaERsBV7gClvzd1aRw/fYKzu03w0W6\n\tzyLKyN/e/vm7qU47bulc76iAw/W15zJ5fUDyYSygfZjK4GJz/MMJqiHXfqVJuLwqbeRm3+\n\twluQ/hcmLSgRkhdXpIQnECW3BfCrxxg=","X-MC-Unique":"LnXYRailOhCkleBM545JuA-1","X-Mimecast-MFC-AGG-ID":"LnXYRailOhCkleBM545JuA_1765795021","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1765795021; x=1766399821;\n\th=mime-version:user-agent:message-id:date:references:in-reply-to\n\t:subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject\n\t:date:message-id:reply-to;\n\tbh=GZDqYlsyQlfJSAg5HAl3Q8AT51QUjTdT0ilhPFJrOFI=;\n\tb=N8IXqgmWPFOJQQKnfZPf8+it7dt3gysvRaWS31K2NeaQwp2dDGgyZqJyzQTNTp+s50\n\tHm6bvOGutD8YJhENjLkiJMaY8/EaXj3hdCzjGrqPqpcd9LyvhU643otL8qt6bJeInsv7\n\tTvDlNHCXLQRsbSDMY8PHS1DZB5ibJqK/otiy9n3R+ose0kPUDGqwWnPfw0uo+pxfGgHL\n\tZ1DaQKMkRJGHq41NZLquTN5le50b6Ye19hZH+yu4h8FIwMo+7yRQHjoQQm3O1IV76PRM\n\tLGnEfexMKqeFF/62U354KslmugrcDfdfqnpQ6snYobOA22zAgBfHTVIfx8+BKVeNwPdN\n\tsjYA==","X-Gm-Message-State":"AOJu0Yw6ig/wnbXpht4RQndnouexra+bq/7RqHRzh4bXgDjh90OyQfCx\n\tBNvHzafkmxst31xeWMq9c0BJSz0E3pA8O5tBlfbSrZXw2hehnMTc4AUu28hewbbTZVLK3S7yaq2\n\ttD8nUKbvA6pRCZpjK6LMpKD4f1MeExZMGm16fKnlo8ILtu9NQHIiD4e/yEdfEJsI5qbKvSgv4Pn\n\tw=","X-Gm-Gg":"AY/fxX5ltgdY/tIVjZQDOEc5l/a5MoRuHC66Z6oPTwZvs/Tp632YUrwh+oJ86yuOSVF\n\t9AzlR/uFtpjjC+1Ws0etBNc9thcEwnR3G+WiMDr1L8Wbcpedi/aT/dQ9XtvHQMtiW5ewj8YvABY\n\tRgY7r1Syb14k9XXFErVVjLj7RpRz2YkXKNWio/biTMmUGk2E8ilhTKG+vtOYK1WFVT4mgUZ8D24\n\tWcVgfKR3aRuSL99R6StoK7vm4FIvpmV7+mtAkWcwvVV17u7Tz2qlYzbXg/p7Fj5zx9mXjVJsL7t\n\tLYXdIFg5SkwR44or5RrsQGPYj+CcVfbi2no5yyk+tdKfN53NGVE6iK9+etvHlkRrAv1c+OzkuEV\n\tpdSbrqe1qnB8HFkDI7xZqy3uE5OceS8QUWtnS/4aLLC6Db7PxjzCgxp6+1MezV0E=","X-Received":["by 2002:a05:600c:6748:b0:479:2f95:5179 with SMTP id\n\t5b1f17b1804b1-47a8f8c380emr101207575e9.15.1765795021120; \n\tMon, 15 Dec 2025 02:37:01 -0800 (PST)","by 2002:a05:600c:6748:b0:479:2f95:5179 with SMTP id\n\t5b1f17b1804b1-47a8f8c380emr101207365e9.15.1765795020635; \n\tMon, 15 Dec 2025 02:37:00 -0800 (PST)"],"X-Google-Smtp-Source":"AGHT+IHPUsqHeTAY0Gvyjvv+8zXUfpZmSvl5TRF93dWCnbO1glYmLtax6tghpFzSjDZoSFtSrMhymQ==","From":"Milan Zamazal <mzamazal@redhat.com>","To":"Bryan O'Donoghue <bryan.odonoghue@linaro.org>","Cc":"libcamera-devel@lists.libcamera.org,  pavel@ucw.cz","Subject":"Re: [PATCH v8 20/26] libcamera: software_isp: ccm: Add\n\tself-initialising identity CCM to Ccm::init","In-Reply-To":"<afad25fc-219e-481f-8d5e-642b0be1bf2a@linaro.org> (Bryan\n\tO'Donoghue's message of \"Fri, 12 Dec 2025 22:31:40 +0000\")","References":"<20251212002937.3118-1-bryan.odonoghue@linaro.org>\n\t<20251212002937.3118-21-bryan.odonoghue@linaro.org>\n\t<85zf7npfa8.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>\n\t<afad25fc-219e-481f-8d5e-642b0be1bf2a@linaro.org>","Date":"Mon, 15 Dec 2025 11:36:59 +0100","Message-ID":"<85y0n4f2us.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","User-Agent":"Gnus/5.13 (Gnus v5.13)","MIME-Version":"1.0","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"QZaWY09VrWoKhy3dMZ0AePGDjHqI648ZnSlxgklakWE_1765795021","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain","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>"}},{"id":37372,"web_url":"https://patchwork.libcamera.org/comment/37372/","msgid":"<85o6o0f2m5.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","date":"2025-12-15T10:42:10","subject":"Re: [PATCH v8 20/26] libcamera: software_isp: ccm: Add\n\tself-initialising identity CCM to Ccm::init","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Milan Zamazal <mzamazal@redhat.com> writes:\n\n> Bryan O'Donoghue <bryan.odonoghue@linaro.org> writes:\n>\n>> We have a need to generate an identity CCM when running the GPUIsp without\n>> a sensor tuning file.\n>>\n>> A preivous patch added a selfInitialising bool to the IPAContext structure.\n>> When that bool is true generate an identity CCM at colour temperature\n>> 6500k.\n>>\n>> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>\n>\n> The patch looks OK to me now and I could put my Reviewed-By on it.\n\nLet's go on to save reviewing chores:\n\nReviewed-by: Milan Zamazal <mzamazal@redhat.com>\n\n> But thinking about it, I'd suggest to split this series (well, after\n> the precursor series is merged, to keep things manageable).\n>\n> I think the patches up to \"Make gpuisp default softisp mode\" (included)\n> are on a good track and might be merged soon to bring the GPU ISP\n> support in.\n>\n> But the following patches may need re-evaluation.  I think my simple IPA\n> cleanup series\n> (https://patchwork.libcamera.org/project/libcamera/list/?series=5597)\n> resolves many problems that the last patches here try to address.\n> Switching from the current CCM handling to a combined matrix, better\n> isolation of all the algorithms, LUT algorithm removal and moving LUT\n> construction to CPU debayering might perhaps replace the stuff here.\n>\n> So my suggestion would be to work towards merging the first part, then\n> to rebase my simple IPA cleanup and work on it.  I hope the patches\n> could be reviewed relatively easily once rebased (they are RFC only\n> because they wait for merged GPU ISP).  Then we'll see whether something\n> from the rest of this series is still needed.\n>\n> The last \"TODO\" patch can be added to the patches to be merged, of\n> course.\n>\n>> ---\n>>  src/ipa/simple/algorithms/ccm.cpp | 22 ++++++++++++++++------\n>>  1 file changed, 16 insertions(+), 6 deletions(-)\n>>\n>> diff --git a/src/ipa/simple/algorithms/ccm.cpp b/src/ipa/simple/algorithms/ccm.cpp\n>> index 0a98406c1..ac1ce1685 100644\n>> --- a/src/ipa/simple/algorithms/ccm.cpp\n>> +++ b/src/ipa/simple/algorithms/ccm.cpp\n>> @@ -27,13 +27,23 @@ namespace ipa::soft::algorithms {\n>>  \n>>  LOG_DEFINE_CATEGORY(IPASoftCcm)\n>>  \n>> -int Ccm::init([[maybe_unused]] IPAContext &context, const YamlObject &tuningData)\n>> +int Ccm::init([[maybe_unused]] IPAContext &context, [[maybe_unused]] const YamlObject &tuningData)\n>>  {\n>> -\tint ret = ccm_.readYaml(tuningData[\"ccms\"], \"ct\", \"ccm\");\n>> -\tif (ret < 0) {\n>> -\t\tLOG(IPASoftCcm, Error)\n>> -\t\t\t<< \"Failed to parse 'ccm' parameter from tuning file.\";\n>> -\t\treturn ret;\n>> +\tif (!context.selfInitialising) {\n>> +\t\tint ret = ccm_.readYaml(tuningData[\"ccms\"], \"ct\", \"ccm\");\n>> +\t\tif (ret < 0) {\n>> +\t\t\tLOG(IPASoftCcm, Error)\n>> +\t\t\t\t<< \"Failed to parse 'ccm' parameter from tuning file.\";\n>> +\t\t\treturn ret;\n>> +\t\t}\n>> +\t} else {\n>> +\t\t/* Initialize with identity CCM at standard D65 color temperature */\n>> +\t\tMatrix<float, 3, 3> identityMatrix = Matrix<float, 3, 3>::identity();\n>> +\n>> +\t\tstd::map<unsigned int, Matrix<float, 3, 3>> ccmData;\n>> +\t\tccmData[6500] = identityMatrix;\n>> +\n>> +\t\tccm_ = Interpolator<Matrix<float, 3, 3>>(std::move(ccmData));\n>>  \t}\n>>  \n>>  \tcontext.ccmEnabled = true;","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 841C0BD7D8\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 15 Dec 2025 10:42:19 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6FFE36196A;\n\tMon, 15 Dec 2025 11:42:18 +0100 (CET)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.133.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B49DF606D5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 15 Dec 2025 11:42:16 +0100 (CET)","from mail-wm1-f71.google.com (mail-wm1-f71.google.com\n\t[209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-498-sLMcwOPUOCy1qzojUjh9AQ-1; Mon, 15 Dec 2025 05:42:14 -0500","by mail-wm1-f71.google.com with SMTP id\n\t5b1f17b1804b1-47a97b785bdso10770065e9.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 15 Dec 2025 02:42:13 -0800 (PST)","from mzamazal-thinkpadp1gen7.tpbc.csb\n\t(ip-77-48-47-2.net.vodafone.cz. [77.48.47.2])\n\tby smtp.gmail.com with ESMTPSA id\n\t5b1f17b1804b1-47a8f6f2238sm65322605e9.13.2025.12.15.02.42.11\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 15 Dec 2025 02:42:11 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"XIzwvdyP\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1765795335;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=B3x6RsuQsvNQO37wM31E7sSNlb2C+TqJTUxvdbjMQqo=;\n\tb=XIzwvdyPCXnCMooIor1n5ZniTMNAPs5PgLom1jZcMDNciEgpX2Y8cizkmv6NWBD8eM/hwy\n\t++r4ur00ujz9e2fe7GUO1hOUG2GgYXAFsJG0zCw+ggs9922jFK26R/Fv80bS8c+ss/9+6p\n\td6rfd1BYhh4c89sTZQdECdOypcQ9+yY=","X-MC-Unique":"sLMcwOPUOCy1qzojUjh9AQ-1","X-Mimecast-MFC-AGG-ID":"sLMcwOPUOCy1qzojUjh9AQ_1765795333","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1765795332; x=1766400132;\n\th=mime-version:user-agent:message-id:date:references:in-reply-to\n\t:subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject\n\t:date:message-id:reply-to;\n\tbh=B3x6RsuQsvNQO37wM31E7sSNlb2C+TqJTUxvdbjMQqo=;\n\tb=qaYMsiN/g10o/Db+RsKm9l2vgepqN1gK8KhQKKNhL+Uloiira1TEWbln+vCHd7MdLe\n\tRdKQ++sQiTo/r/xW/kYXwJM4XfiIWPZsEaqEB514OEoNCuX8Fn2weiQKUOxc37QA98YI\n\tOKfa3az3N1lCk/B4kO5Qhg1ZX04ZQz3Iw9MBtusOLpZdbSYwP+A21rzZKX+XCkDA9b/z\n\tcYjdEPwUvvL5TK8cgfDbsD+t3F3iVrlhhxXxe5Pa46VhhGAKS41vrI6PpP/X6r97hXF3\n\tBN/HRPmCPswv7o4srKlVxYHr6jQtJkjZixPAwm+9AE250ntU1MIEFLJQWMBdLp1fkpmK\n\tlorQ==","X-Gm-Message-State":"AOJu0Yx4yRrQBeCeKHLQYXjIvl5efWvjhruZvD0Goicx17MDc6vT0q4Q\n\tCG2qP726zuElsbLAzsxIyYXyQ7/S1Xf5hfQAKNwnwZ4HiIX+i/vM9EE82tK8RDQcPPcrMkpleVh\n\tWlyUBVU3OY/B4Amf0WiOcCRYjvWYRcERm735kOrO1ejwufPVzR7vUWs70biXNo2aOuRiVYEWy5o\n\tVk7mPRf80=","X-Gm-Gg":"AY/fxX4dD85BSZWsU2eX6lBrNt1cSZ18NCDUDGNH+Lghg3aDgm3z2E8dggAleN99+PJ\n\tCbVWl1vwj6zkPG8jSfX1onVvfMe89NZkdQ4LLWHo+m/0AwtVlM4gHlpFjXC1y1BaDOIgLqOmXi0\n\ty2CKWZAkMF2IarGYTwCvkdfy3zugAf9m9l27z+iaub/8NK2e/SJekOdLc5VXHR6zpIpJko4+QLH\n\txz5X6YK1upJTuRrvK7YfXmPMHZuiMoiRi4YGwuuXG4OZeHEjsNafVmr6b81szLQFHyhIA8FNNu+\n\tdhOcIQxIbCGHmjqS9xJQ6iwuz1rBVq+KfTtUEH4Hw8akIcARwGFeGArIihf+eZq9O5l89ADCM1K\n\tgV5kjo50aT95ERAR6dBkDi8qpqW8ie+Ce+wMOEYp7ylSOo1g8Y/n4JPZqjeq86bc=","X-Received":["by 2002:a05:600c:6290:b0:477:63db:c718 with SMTP id\n\t5b1f17b1804b1-47a8f8ce390mr134691225e9.16.1765795332463; \n\tMon, 15 Dec 2025 02:42:12 -0800 (PST)","by 2002:a05:600c:6290:b0:477:63db:c718 with SMTP id\n\t5b1f17b1804b1-47a8f8ce390mr134690865e9.16.1765795332002; \n\tMon, 15 Dec 2025 02:42:12 -0800 (PST)"],"X-Google-Smtp-Source":"AGHT+IHa8ucZol9DzUpao9NR2Jz9OU1M24uaDR8FUTd3BgXBiXkcCvyeMcqLS6gmWCxXZ7OG/MnjcQ==","From":"Milan Zamazal <mzamazal@redhat.com>","To":"Bryan O'Donoghue <bryan.odonoghue@linaro.org>","Cc":"libcamera-devel@lists.libcamera.org,  pavel@ucw.cz","Subject":"Re: [PATCH v8 20/26] libcamera: software_isp: ccm: Add\n\tself-initialising identity CCM to Ccm::init","In-Reply-To":"<85zf7npfa8.fsf@mzamazal-thinkpadp1gen7.tpbc.csb> (Milan\n\tZamazal's message of \"Fri, 12 Dec 2025 22:21:35 +0100\")","References":"<20251212002937.3118-1-bryan.odonoghue@linaro.org>\n\t<20251212002937.3118-21-bryan.odonoghue@linaro.org>\n\t<85zf7npfa8.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","Date":"Mon, 15 Dec 2025 11:42:10 +0100","Message-ID":"<85o6o0f2m5.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","User-Agent":"Gnus/5.13 (Gnus v5.13)","MIME-Version":"1.0","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"S8q-ywpFKFIUEYN4ZkaERRxSAbN4tZkJf1YuYMKqUVw_1765795333","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain","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>"}},{"id":37396,"web_url":"https://patchwork.libcamera.org/comment/37396/","msgid":"<176582867052.158506.8413130811554115032@ping.linuxembedded.co.uk>","date":"2025-12-15T19:57:50","subject":"Re: [PATCH v8 20/26] libcamera: software_isp: ccm: Add\n\tself-initialising identity CCM to Ccm::init","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Milan Zamazal (2025-12-15 10:42:10)\n> Milan Zamazal <mzamazal@redhat.com> writes:\n> \n> > Bryan O'Donoghue <bryan.odonoghue@linaro.org> writes:\n> >\n> >> We have a need to generate an identity CCM when running the GPUIsp without\n> >> a sensor tuning file.\n> >>\n> >> A preivous patch added a selfInitialising bool to the IPAContext structure.\n> >> When that bool is true generate an identity CCM at colour temperature\n> >> 6500k.\n> >>\n> >> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>\n> >\n> > The patch looks OK to me now and I could put my Reviewed-By on it.\n> \n> Let's go on to save reviewing chores:\n> \n> Reviewed-by: Milan Zamazal <mzamazal@redhat.com>\n> \n> > But thinking about it, I'd suggest to split this series (well, after\n> > the precursor series is merged, to keep things manageable).\n> >\n> > I think the patches up to \"Make gpuisp default softisp mode\" (included)\n> > are on a good track and might be merged soon to bring the GPU ISP\n> > support in.\n> >\n> > But the following patches may need re-evaluation.  I think my simple IPA\n> > cleanup series\n> > (https://patchwork.libcamera.org/project/libcamera/list/?series=5597)\n> > resolves many problems that the last patches here try to address.\n> > Switching from the current CCM handling to a combined matrix, better\n> > isolation of all the algorithms, LUT algorithm removal and moving LUT\n> > construction to CPU debayering might perhaps replace the stuff here.\n\nI think this is sounding spot on - I'm trying to test GPU ISP - and I've\nenabled CCM with the following:\n\nkbingham@charm:~/iob/libcamera$ cat src/ipa/simple/data/ov5675.yaml \n# SPDX-License-Identifier: CC0-1.0\n%YAML 1.1\n---\nversion: 1\nalgorithms:\n  - BlackLevel:\n  - Awb:\n  # Color correction matrices can be defined here. The CCM algorithm\n  # has a significant performance impact, and should only be enabled\n  # if tuned.\n  - Ccm:\n      ccms:\n        - ct: 6500\n          ccm: [ 3, 0, 0,\n                 0, 1, 0,\n                 2, 0, 8]\n  - Lut:\n  - Agc:\n...\n\n\n\nBut running cam to capture frames with a bit of extra debug enabled to\nprint the CCM - shows where I see flicker when the CCM gets\nre-configured and seems to be fighting against the AWB or such:\n\n\n[1:05:28.547392018] [39994]  INFO IPASoftCcm ccm.cpp:103  ct  0 ccm - Matrix { [ 0, 0, 0 ], [ 0, 0, 0 ], [ 0, 0, 0 ] }\n[1:05:28.547517375] [39994]  INFO IPASoftCcm ccm.cpp:103  ct  0 ccm - Matrix { [ 3, 0, 0 ], [ 0, 1, 0 ], [ 2, 0, 8 ] }\n[1:05:28.563253799] [39994]  INFO IPASoftAwb awb.cpp:95 gain R/B: Vector { 1.26707, 1, 1.42126  }; temperature: 4973\n3928.546437 (0.00 fps) cam0-stream0 seq: 000000 bytesused: 20404224\n[1:05:28.580331026] [39994]  INFO IPASoftCcm ccm.cpp:103  ct  4973 ccm - Matrix { [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] }\n[1:05:28.580398939] [39994]  INFO IPASoftCcm ccm.cpp:103  ct  4973 ccm - Matrix { [ 3, 0, 0 ], [ 0, 1, 0 ], [ 2, 0, 8 ] }\n3928.579823 (29.95 fps) cam0-stream0 seq: 000001 bytesused: 20404224\n[1:05:28.613874320] [39994]  INFO IPASoftCcm ccm.cpp:103  ct  4973 ccm - Matrix { [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] }\n[1:05:28.613949836] [39994]  INFO IPASoftCcm ccm.cpp:103  ct  4973 ccm - Matrix { [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] }\n3928.613210 (29.95 fps) cam0-stream0 seq: 000002 bytesused: 20404224\n[1:05:28.647249343] [39994]  INFO IPASoftCcm ccm.cpp:103  ct  4973 ccm - Matrix { [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] }\n[1:05:28.647313141] [39994]  INFO IPASoftCcm ccm.cpp:103  ct  4973 ccm - Matrix { [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] }\n3928.646596 (29.95 fps) cam0-stream0 seq: 000003 bytesused: 20404224\n[1:05:28.680742119] [39994]  INFO IPASoftCcm ccm.cpp:103  ct  4973 ccm - Matrix { [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] }\n[1:05:28.680804406] [39994]  INFO IPASoftCcm ccm.cpp:103  ct  4973 ccm - Matrix { [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] }\n[1:05:28.688169316] [39994]  INFO IPASoftAwb awb.cpp:95 gain R/B: Vector { 1.26588, 1, 1.41959  }; temperature: 4978\n3928.679981 (29.95 fps) cam0-stream0 seq: 000004 bytesused: 20404224\n[1:05:28.713811848] [39994]  INFO IPASoftCcm ccm.cpp:103  ct  4978 ccm - Matrix { [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] }\n[1:05:28.713864396] [39994]  INFO IPASoftCcm ccm.cpp:103  ct  4978 ccm - Matrix { [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] }\n\n\nYou can see the CCM has been 'reset' (I think by awb, but haven't dug\ndeep enough yet) - and it stays like that until the colour temperature\nthreshold changes enough to re-interpolate a new CCM.\n\n\n\n\n> >\n> > So my suggestion would be to work towards merging the first part, then\n> > to rebase my simple IPA cleanup and work on it.  I hope the patches\n> > could be reviewed relatively easily once rebased (they are RFC only\n> > because they wait for merged GPU ISP).  Then we'll see whether something\n> > from the rest of this series is still needed.\n> >\n> > The last \"TODO\" patch can be added to the patches to be merged, of\n> > course.\n> >\n> >> ---\n> >>  src/ipa/simple/algorithms/ccm.cpp | 22 ++++++++++++++++------\n> >>  1 file changed, 16 insertions(+), 6 deletions(-)\n> >>\n> >> diff --git a/src/ipa/simple/algorithms/ccm.cpp b/src/ipa/simple/algorithms/ccm.cpp\n> >> index 0a98406c1..ac1ce1685 100644\n> >> --- a/src/ipa/simple/algorithms/ccm.cpp\n> >> +++ b/src/ipa/simple/algorithms/ccm.cpp\n> >> @@ -27,13 +27,23 @@ namespace ipa::soft::algorithms {\n> >>  \n> >>  LOG_DEFINE_CATEGORY(IPASoftCcm)\n> >>  \n> >> -int Ccm::init([[maybe_unused]] IPAContext &context, const YamlObject &tuningData)\n> >> +int Ccm::init([[maybe_unused]] IPAContext &context, [[maybe_unused]] const YamlObject &tuningData)\n> >>  {\n> >> -    int ret = ccm_.readYaml(tuningData[\"ccms\"], \"ct\", \"ccm\");\n> >> -    if (ret < 0) {\n> >> -            LOG(IPASoftCcm, Error)\n> >> -                    << \"Failed to parse 'ccm' parameter from tuning file.\";\n> >> -            return ret;\n> >> +    if (!context.selfInitialising) {\n> >> +            int ret = ccm_.readYaml(tuningData[\"ccms\"], \"ct\", \"ccm\");\n> >> +            if (ret < 0) {\n> >> +                    LOG(IPASoftCcm, Error)\n> >> +                            << \"Failed to parse 'ccm' parameter from tuning file.\";\n> >> +                    return ret;\n> >> +            }\n> >> +    } else {\n> >> +            /* Initialize with identity CCM at standard D65 color temperature */\n> >> +            Matrix<float, 3, 3> identityMatrix = Matrix<float, 3, 3>::identity();\n> >> +\n> >> +            std::map<unsigned int, Matrix<float, 3, 3>> ccmData;\n> >> +            ccmData[6500] = identityMatrix;\n> >> +\n> >> +            ccm_ = Interpolator<Matrix<float, 3, 3>>(std::move(ccmData));\n> >>      }\n> >>  \n> >>      context.ccmEnabled = true;\n>","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 BEAA9C3257\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 15 Dec 2025 19:57:55 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8741B619D0;\n\tMon, 15 Dec 2025 20:57:54 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id F1D28615B2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 15 Dec 2025 20:57:52 +0100 (CET)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id ADDC54F1;\n\tMon, 15 Dec 2025 20:57:47 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"i+a5haog\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1765828667;\n\tbh=cgs8G/O9bRcU+T4Ft/nAMmpAz3Uar49qmDrESKYudgs=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=i+a5haogmJ2Q5f8X7+qFmYADKkjTdpfadcoLENeKHq742p9v0jPEDSp2eXyQVoLZ7\n\tvQ3e1cj5ifbVjl9DrsgQlpJCOR2VO4NIXj3b8XTG9Fd1BF96ZnwzuyWAbCG6St4t6q\n\t3NCfbpRYP1gcNmlY/sXSOAwQ8vFjmhyYBmJ1Ua/Q=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<85o6o0f2m5.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","References":"<20251212002937.3118-1-bryan.odonoghue@linaro.org>\n\t<20251212002937.3118-21-bryan.odonoghue@linaro.org>\n\t<85zf7npfa8.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>\n\t<85o6o0f2m5.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","Subject":"Re: [PATCH v8 20/26] libcamera: software_isp: ccm: Add\n\tself-initialising identity CCM to Ccm::init","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org, pavel@ucw.cz","To":"Bryan O'Donoghue <bryan.odonoghue@linaro.org>,\n\tMilan Zamazal <mzamazal@redhat.com>","Date":"Mon, 15 Dec 2025 19:57:50 +0000","Message-ID":"<176582867052.158506.8413130811554115032@ping.linuxembedded.co.uk>","User-Agent":"alot/0.9.1","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>"}}]