[{"id":38353,"web_url":"https://patchwork.libcamera.org/comment/38353/","msgid":"<782dcd62-66ca-4c0b-b556-a1ec2b26daf9@ideasonboard.com>","date":"2026-03-13T14:43:39","subject":"Re: [PATCH v4 4/7] libcamera: mali-c55: Register memory input camera","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"Hi\n\n2026. 03. 13. 12:33 keltezéssel, Jacopo Mondi írta:\n> From: Daniel Scally <dan.scally@ideasonboard.com>\n> \n> Add support to Mali C55 pipeline handler for memory-to-memory camera\n> mode.\n> \n> The Mali-C55, as integrated in the Renesas RZ/V2H(P) SoC, is fed with\n> images saved to memory by the CRU unit and read on behalf of the ISP\n> by the IVC.\n> \n> Update the pipeline handler's match() function to search for the CRU\n> media entity necessary to register a memory input camera. Create and\n> initialize a CameraData instance for the memory camera use case if a\n> valid CRU is found and initialize the IVC components used to feed the\n> ISP with images read from memory.\n> \n> Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>\n> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n> ---\n>   src/libcamera/pipeline/mali-c55/mali-c55.cpp | 145 +++++++++++++++++++++++----\n>   1 file changed, 128 insertions(+), 17 deletions(-)\n> \n> diff --git a/src/libcamera/pipeline/mali-c55/mali-c55.cpp b/src/libcamera/pipeline/mali-c55/mali-c55.cpp\n> index 6581d13bbc52..3c8848d28707 100644\n> --- a/src/libcamera/pipeline/mali-c55/mali-c55.cpp\n> +++ b/src/libcamera/pipeline/mali-c55/mali-c55.cpp\n> @@ -44,6 +44,8 @@\n>   #include \"libcamera/internal/v4l2_subdevice.h\"\n>   #include \"libcamera/internal/v4l2_videodevice.h\"\n>   \n> +#include \"rzg2l-cru.h\"\n> +\n>   namespace {\n>   \n>   bool isFormatRaw(const libcamera::PixelFormat &pixFmt)\n> @@ -105,7 +107,12 @@ public:\n>   \t\tstd::unique_ptr<V4L2Subdevice> csi2_;\n>   \t\tstd::unique_ptr<CameraSensor> sensor_;\n>   \t};\n> -\tusing CameraType = std::variant<Tpg, Inline>;\n> +\n> +\tstruct Memory {\n> +\t\tstd::unique_ptr<RZG2LCRU> cru_;\n\nMaybe I am missing something obvious, but how come the \"ivc\" things are not here,\nbut in the pipeline handler?\n\n\n> +\t};\n> +\n> +\tusing CameraType = std::variant<Tpg, Inline, Memory>;\n>   \n>   \tMaliC55CameraData(PipelineHandler *pipe)\n>   \t\t: Camera::Private(pipe)\n> @@ -116,6 +123,7 @@ public:\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 03C8BBDCC1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 13 Mar 2026 14:43:45 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6A2626266B;\n\tFri, 13 Mar 2026 15:43:45 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E2D1D6261B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 13 Mar 2026 15:43:42 +0100 (CET)","from [192.168.33.26] (185.182.214.153.nat.pool.zt.hu\n\t[185.182.214.153])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 74344E70;\n\tFri, 13 Mar 2026 15:42:33 +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=\"VNkkK3CA\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1773412953;\n\tbh=dH7c8kpF3eG42P3B+8GtKqM5yTIVS7zoCIENtp7Y8JA=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=VNkkK3CAhocMNw920Jk9ifgQrgT+m54fGWaeNBMph7WLqekeqAe2CYtVkBArJfWZe\n\tK71bwfvq3APn4qpQ7pFTaIeHZ6VrhG7q+QYHR8lIaob86GLdAEV/M9varBs4TR2hlW\n\td6ov+yyIh19VuRtDFxOAv+KwsuGgKMLfUcmuN3RI=","Message-ID":"<782dcd62-66ca-4c0b-b556-a1ec2b26daf9@ideasonboard.com>","Date":"Fri, 13 Mar 2026 15:43:39 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v4 4/7] libcamera: mali-c55: Register memory input camera","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>,\n\tDaniel Scally <dan.scally@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20260313-mali-cru-v4-0-c0d9bc8cd8fa@ideasonboard.com>\n\t<20260313-mali-cru-v4-4-c0d9bc8cd8fa@ideasonboard.com>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<20260313-mali-cru-v4-4-c0d9bc8cd8fa@ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","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>"}},{"id":38354,"web_url":"https://patchwork.libcamera.org/comment/38354/","msgid":"<abQjm-BshEoL26sU@zed>","date":"2026-03-13T14:50:36","subject":"Re: [PATCH v4 4/7] libcamera: mali-c55: Register memory input camera","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"On Fri, Mar 13, 2026 at 03:43:39PM +0100, Barnabás Pőcze wrote:\n> Hi\n>\n> 2026. 03. 13. 12:33 keltezéssel, Jacopo Mondi írta:\n> > From: Daniel Scally <dan.scally@ideasonboard.com>\n> >\n> > Add support to Mali C55 pipeline handler for memory-to-memory camera\n> > mode.\n> >\n> > The Mali-C55, as integrated in the Renesas RZ/V2H(P) SoC, is fed with\n> > images saved to memory by the CRU unit and read on behalf of the ISP\n> > by the IVC.\n> >\n> > Update the pipeline handler's match() function to search for the CRU\n> > media entity necessary to register a memory input camera. Create and\n> > initialize a CameraData instance for the memory camera use case if a\n> > valid CRU is found and initialize the IVC components used to feed the\n> > ISP with images read from memory.\n> >\n> > Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>\n> > Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n> > ---\n> >   src/libcamera/pipeline/mali-c55/mali-c55.cpp | 145 +++++++++++++++++++++++----\n> >   1 file changed, 128 insertions(+), 17 deletions(-)\n> >\n> > diff --git a/src/libcamera/pipeline/mali-c55/mali-c55.cpp b/src/libcamera/pipeline/mali-c55/mali-c55.cpp\n> > index 6581d13bbc52..3c8848d28707 100644\n> > --- a/src/libcamera/pipeline/mali-c55/mali-c55.cpp\n> > +++ b/src/libcamera/pipeline/mali-c55/mali-c55.cpp\n> > @@ -44,6 +44,8 @@\n> >   #include \"libcamera/internal/v4l2_subdevice.h\"\n> >   #include \"libcamera/internal/v4l2_videodevice.h\"\n> > +#include \"rzg2l-cru.h\"\n> > +\n> >   namespace {\n> >   bool isFormatRaw(const libcamera::PixelFormat &pixFmt)\n> > @@ -105,7 +107,12 @@ public:\n> >   \t\tstd::unique_ptr<V4L2Subdevice> csi2_;\n> >   \t\tstd::unique_ptr<CameraSensor> sensor_;\n> >   \t};\n> > -\tusing CameraType = std::variant<Tpg, Inline>;\n> > +\n> > +\tstruct Memory {\n> > +\t\tstd::unique_ptr<RZG2LCRU> cru_;\n>\n> Maybe I am missing something obvious, but how come the \"ivc\" things are not here,\n> but in the pipeline handler?\n>\n\nThere is only one IVC in the system, while there are up to 4 CSI-2\nreceivers (if we're talking v2h).\n\nWould you expect the ivc to be per-camera data ?\n\n>\n> > +\t};\n> > +\n> > +\tusing CameraType = std::variant<Tpg, Inline, Memory>;\n> >   \tMaliC55CameraData(PipelineHandler *pipe)\n> >   \t\t: Camera::Private(pipe)\n> > @@ -116,6 +123,7 @@ public:\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 286B2BE086\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 13 Mar 2026 14:50:44 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 776A76261B;\n\tFri, 13 Mar 2026 15:50:43 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3B6346261B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 13 Mar 2026 15:50:42 +0100 (CET)","from ideasonboard.com (unknown [37.159.122.93])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 84CFAE70;\n\tFri, 13 Mar 2026 15:49:32 +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=\"B1pyhhkG\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1773413372;\n\tbh=189IwTrc1nkQVKAK0NVE3ncyWApVHR2tEA0vrrobY8o=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=B1pyhhkG0M/+p+uv/R8DCmabOu3BZGMN8Onx4R+ppqsMLIRnl/x+O0WWNVjgFf+OB\n\tbVDiWZ/2FeS8hh6K+JvTSGkEKTm/Cs5OCpgYj+f4vn2JDfY8cT3EP6ziaDG1gERHPI\n\tTb5iUY0lzjZMmVAvSQThYL8lSC8p6ixmvIRYFXC8=","Date":"Fri, 13 Mar 2026 15:50:36 +0100","From":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Cc":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>, \n\tDaniel Scally <dan.scally@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH v4 4/7] libcamera: mali-c55: Register memory input camera","Message-ID":"<abQjm-BshEoL26sU@zed>","References":"<20260313-mali-cru-v4-0-c0d9bc8cd8fa@ideasonboard.com>\n\t<20260313-mali-cru-v4-4-c0d9bc8cd8fa@ideasonboard.com>\n\t<782dcd62-66ca-4c0b-b556-a1ec2b26daf9@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<782dcd62-66ca-4c0b-b556-a1ec2b26daf9@ideasonboard.com>","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":38355,"web_url":"https://patchwork.libcamera.org/comment/38355/","msgid":"<844ec5ae-d7f3-45c1-a6a3-901fe465515f@ideasonboard.com>","date":"2026-03-13T15:02:23","subject":"Re: [PATCH v4 4/7] libcamera: mali-c55: Register memory input camera","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"2026. 03. 13. 15:50 keltezéssel, Jacopo Mondi írta:\n> On Fri, Mar 13, 2026 at 03:43:39PM +0100, Barnabás Pőcze wrote:\n>> Hi\n>>\n>> 2026. 03. 13. 12:33 keltezéssel, Jacopo Mondi írta:\n>>> From: Daniel Scally <dan.scally@ideasonboard.com>\n>>>\n>>> Add support to Mali C55 pipeline handler for memory-to-memory camera\n>>> mode.\n>>>\n>>> The Mali-C55, as integrated in the Renesas RZ/V2H(P) SoC, is fed with\n>>> images saved to memory by the CRU unit and read on behalf of the ISP\n>>> by the IVC.\n>>>\n>>> Update the pipeline handler's match() function to search for the CRU\n>>> media entity necessary to register a memory input camera. Create and\n>>> initialize a CameraData instance for the memory camera use case if a\n>>> valid CRU is found and initialize the IVC components used to feed the\n>>> ISP with images read from memory.\n>>>\n>>> Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>\n>>> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n>>> ---\n>>>    src/libcamera/pipeline/mali-c55/mali-c55.cpp | 145 +++++++++++++++++++++++----\n>>>    1 file changed, 128 insertions(+), 17 deletions(-)\n>>>\n>>> diff --git a/src/libcamera/pipeline/mali-c55/mali-c55.cpp b/src/libcamera/pipeline/mali-c55/mali-c55.cpp\n>>> index 6581d13bbc52..3c8848d28707 100644\n>>> --- a/src/libcamera/pipeline/mali-c55/mali-c55.cpp\n>>> +++ b/src/libcamera/pipeline/mali-c55/mali-c55.cpp\n>>> @@ -44,6 +44,8 @@\n>>>    #include \"libcamera/internal/v4l2_subdevice.h\"\n>>>    #include \"libcamera/internal/v4l2_videodevice.h\"\n>>> +#include \"rzg2l-cru.h\"\n>>> +\n>>>    namespace {\n>>>    bool isFormatRaw(const libcamera::PixelFormat &pixFmt)\n>>> @@ -105,7 +107,12 @@ public:\n>>>    \t\tstd::unique_ptr<V4L2Subdevice> csi2_;\n>>>    \t\tstd::unique_ptr<CameraSensor> sensor_;\n>>>    \t};\n>>> -\tusing CameraType = std::variant<Tpg, Inline>;\n>>> +\n>>> +\tstruct Memory {\n>>> +\t\tstd::unique_ptr<RZG2LCRU> cru_;\n>>\n>> Maybe I am missing something obvious, but how come the \"ivc\" things are not here,\n>> but in the pipeline handler?\n>>\n> \n> There is only one IVC in the system, while there are up to 4 CSI-2\n> receivers (if we're talking v2h).\n> \n> Would you expect the ivc to be per-camera data ?\n\nAhh, sorry, I think I have already asked this. But I feel like I'm a bit confused by\nhow `PipelineHandlerMaliC55::match()` is supposed to work. Specifically, when it is\nhandling `MEDIA_ENT_F_PROC_VIDEO_PIXEL_FORMATTER`, it will overwrite the members, so\nthat makes me think there is only one of those expected (and as you said \"There is only one IVC in the system\").\nBut then `registerMemoryInputCamera()` registers only a single camera, so how\ndoes that work with multiple ones?\n\n\n> \n>>\n>>> +\t};\n>>> +\n>>> +\tusing CameraType = std::variant<Tpg, Inline, Memory>;\n>>>    \tMaliC55CameraData(PipelineHandler *pipe)\n>>>    \t\t: Camera::Private(pipe)\n>>> @@ -116,6 +123,7 @@ public:\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 ABA95BDCC1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 13 Mar 2026 15:02:30 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CCF2B62681;\n\tFri, 13 Mar 2026 16:02:29 +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 D1DFF6261B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 13 Mar 2026 16:02:27 +0100 (CET)","from [192.168.33.26] (185.182.214.153.nat.pool.zt.hu\n\t[185.182.214.153])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 8AE0FF52;\n\tFri, 13 Mar 2026 16:01:18 +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=\"NFZL5FVf\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1773414078;\n\tbh=h7LheyWpkqPlaMDClHZWUpytTDNHdCB7BU6sKwvVX7g=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=NFZL5FVfFgpzAAzeW3WwIIxwy1Vw+PTuyxenBzQzsppFa11/owakfYc0PWQLcX6Ch\n\tcH0G1MdsEov2t0uJE+0PSVRnx68i/JbTnB9NmzWKO9KOYhgAh6jFfiUeokyrbHFIVM\n\tv++D+oUcRf4XEo7cNlBT7zRoFi06QirBllyzJops=","Message-ID":"<844ec5ae-d7f3-45c1-a6a3-901fe465515f@ideasonboard.com>","Date":"Fri, 13 Mar 2026 16:02:23 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v4 4/7] libcamera: mali-c55: Register memory input camera","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Cc":"Daniel Scally <dan.scally@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20260313-mali-cru-v4-0-c0d9bc8cd8fa@ideasonboard.com>\n\t<20260313-mali-cru-v4-4-c0d9bc8cd8fa@ideasonboard.com>\n\t<782dcd62-66ca-4c0b-b556-a1ec2b26daf9@ideasonboard.com>\n\t<abQjm-BshEoL26sU@zed>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<abQjm-BshEoL26sU@zed>","Content-Type":"text/plain; charset=UTF-8; format=flowed","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>"}},{"id":38358,"web_url":"https://patchwork.libcamera.org/comment/38358/","msgid":"<abQpNKCdpCcRUaj6@zed>","date":"2026-03-13T15:20:35","subject":"Re: [PATCH v4 4/7] libcamera: mali-c55: Register memory input camera","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"Hi Barnabás\n\nOn Fri, Mar 13, 2026 at 04:02:23PM +0100, Barnabás Pőcze wrote:\n> 2026. 03. 13. 15:50 keltezéssel, Jacopo Mondi írta:\n> > On Fri, Mar 13, 2026 at 03:43:39PM +0100, Barnabás Pőcze wrote:\n> > > Hi\n> > >\n> > > 2026. 03. 13. 12:33 keltezéssel, Jacopo Mondi írta:\n> > > > From: Daniel Scally <dan.scally@ideasonboard.com>\n> > > >\n> > > > Add support to Mali C55 pipeline handler for memory-to-memory camera\n> > > > mode.\n> > > >\n> > > > The Mali-C55, as integrated in the Renesas RZ/V2H(P) SoC, is fed with\n> > > > images saved to memory by the CRU unit and read on behalf of the ISP\n> > > > by the IVC.\n> > > >\n> > > > Update the pipeline handler's match() function to search for the CRU\n> > > > media entity necessary to register a memory input camera. Create and\n> > > > initialize a CameraData instance for the memory camera use case if a\n> > > > valid CRU is found and initialize the IVC components used to feed the\n> > > > ISP with images read from memory.\n> > > >\n> > > > Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>\n> > > > Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n> > > > ---\n> > > >    src/libcamera/pipeline/mali-c55/mali-c55.cpp | 145 +++++++++++++++++++++++----\n> > > >    1 file changed, 128 insertions(+), 17 deletions(-)\n> > > >\n> > > > diff --git a/src/libcamera/pipeline/mali-c55/mali-c55.cpp b/src/libcamera/pipeline/mali-c55/mali-c55.cpp\n> > > > index 6581d13bbc52..3c8848d28707 100644\n> > > > --- a/src/libcamera/pipeline/mali-c55/mali-c55.cpp\n> > > > +++ b/src/libcamera/pipeline/mali-c55/mali-c55.cpp\n> > > > @@ -44,6 +44,8 @@\n> > > >    #include \"libcamera/internal/v4l2_subdevice.h\"\n> > > >    #include \"libcamera/internal/v4l2_videodevice.h\"\n> > > > +#include \"rzg2l-cru.h\"\n> > > > +\n> > > >    namespace {\n> > > >    bool isFormatRaw(const libcamera::PixelFormat &pixFmt)\n> > > > @@ -105,7 +107,12 @@ public:\n> > > >    \t\tstd::unique_ptr<V4L2Subdevice> csi2_;\n> > > >    \t\tstd::unique_ptr<CameraSensor> sensor_;\n> > > >    \t};\n> > > > -\tusing CameraType = std::variant<Tpg, Inline>;\n> > > > +\n> > > > +\tstruct Memory {\n> > > > +\t\tstd::unique_ptr<RZG2LCRU> cru_;\n> > >\n> > > Maybe I am missing something obvious, but how come the \"ivc\" things are not here,\n> > > but in the pipeline handler?\n> > >\n> >\n> > There is only one IVC in the system, while there are up to 4 CSI-2\n> > receivers (if we're talking v2h).\n> >\n> > Would you expect the ivc to be per-camera data ?\n>\n> Ahh, sorry, I think I have already asked this. But I feel like I'm a bit confused by\n> how `PipelineHandlerMaliC55::match()` is supposed to work. Specifically, when it is\n> handling `MEDIA_ENT_F_PROC_VIDEO_PIXEL_FORMATTER`, it will overwrite the members, so\n> that makes me think there is only one of those expected (and as you said \"There is only one IVC in the system\").\n> But then `registerMemoryInputCamera()` registers only a single camera, so how\n> does that work with multiple ones?\n\nThere are no multiple cameras at this point, the Linux kernel doesn't\nsupport it.\n\nHowever, even with multi-cameras, only a single component in the\nsystem (when in m2m) will be of type\nMEDIA_ENT_F_PROC_VIDEO_PIXEL_FORMATTER, and it will be the IVC subdev.\n\nWhat we will have to do then is to extend registerMemoryInputCamera()\nto register one CameraData and one Camera for each CSI-2 receiver with\na camera sensor connected. We'll also have to modify the CRU media\ndevice matching and acquisition, and probably move it to\nregisterMemoryInputCamera() as well now that I re-look at that.\n\nWhat members (and members of what) do you think will be overritten ?\n\n>\n>\n> >\n> > >\n> > > > +\t};\n> > > > +\n> > > > +\tusing CameraType = std::variant<Tpg, Inline, Memory>;\n> > > >    \tMaliC55CameraData(PipelineHandler *pipe)\n> > > >    \t\t: Camera::Private(pipe)\n> > > > @@ -116,6 +123,7 @@ public:\n> > > > [...]\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 5351ABDCC1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 13 Mar 2026 15:20:42 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0F2B262695;\n\tFri, 13 Mar 2026 16:20:42 +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 B32186261B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 13 Mar 2026 16:20:40 +0100 (CET)","from ideasonboard.com (unknown [37.159.122.93])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 387725A5;\n\tFri, 13 Mar 2026 16:19:31 +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=\"NR95amMX\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1773415171;\n\tbh=bcPy18THy2fbskh+IpjYlwTc27K0hcjggvZLz+NNuh4=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=NR95amMXijTMp93uKs2XHgumg0MUCN2dJnPiZesQKYopsXS+5LFMQpB6vewQgP+3K\n\tAniuPEDBYJB94n/P//zDWaCOSy7Jr+hMo8HV3hiCGgxL+ubLjDVF8YeD6dQPsIiLqK\n\tHLfIhIYfju2pxUF9CTc6oWN3gz+62R0kmQdRrz7Q=","Date":"Fri, 13 Mar 2026 16:20:35 +0100","From":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Cc":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>, \n\tDaniel Scally <dan.scally@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH v4 4/7] libcamera: mali-c55: Register memory input camera","Message-ID":"<abQpNKCdpCcRUaj6@zed>","References":"<20260313-mali-cru-v4-0-c0d9bc8cd8fa@ideasonboard.com>\n\t<20260313-mali-cru-v4-4-c0d9bc8cd8fa@ideasonboard.com>\n\t<782dcd62-66ca-4c0b-b556-a1ec2b26daf9@ideasonboard.com>\n\t<abQjm-BshEoL26sU@zed>\n\t<844ec5ae-d7f3-45c1-a6a3-901fe465515f@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<844ec5ae-d7f3-45c1-a6a3-901fe465515f@ideasonboard.com>","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":38359,"web_url":"https://patchwork.libcamera.org/comment/38359/","msgid":"<d27f04ea-d92e-4b05-a1aa-a6f76e26563f@ideasonboard.com>","date":"2026-03-13T15:40:55","subject":"Re: [PATCH v4 4/7] libcamera: mali-c55: Register memory input camera","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"2026. 03. 13. 16:20 keltezéssel, Jacopo Mondi írta:\n> Hi Barnabás\n> \n> On Fri, Mar 13, 2026 at 04:02:23PM +0100, Barnabás Pőcze wrote:\n>> 2026. 03. 13. 15:50 keltezéssel, Jacopo Mondi írta:\n>>> On Fri, Mar 13, 2026 at 03:43:39PM +0100, Barnabás Pőcze wrote:\n>>>> Hi\n>>>>\n>>>> 2026. 03. 13. 12:33 keltezéssel, Jacopo Mondi írta:\n>>>>> From: Daniel Scally <dan.scally@ideasonboard.com>\n>>>>>\n>>>>> Add support to Mali C55 pipeline handler for memory-to-memory camera\n>>>>> mode.\n>>>>>\n>>>>> The Mali-C55, as integrated in the Renesas RZ/V2H(P) SoC, is fed with\n>>>>> images saved to memory by the CRU unit and read on behalf of the ISP\n>>>>> by the IVC.\n>>>>>\n>>>>> Update the pipeline handler's match() function to search for the CRU\n>>>>> media entity necessary to register a memory input camera. Create and\n>>>>> initialize a CameraData instance for the memory camera use case if a\n>>>>> valid CRU is found and initialize the IVC components used to feed the\n>>>>> ISP with images read from memory.\n>>>>>\n>>>>> Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>\n>>>>> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n>>>>> ---\n>>>>>     src/libcamera/pipeline/mali-c55/mali-c55.cpp | 145 +++++++++++++++++++++++----\n>>>>>     1 file changed, 128 insertions(+), 17 deletions(-)\n>>>>>\n>>>>> diff --git a/src/libcamera/pipeline/mali-c55/mali-c55.cpp b/src/libcamera/pipeline/mali-c55/mali-c55.cpp\n>>>>> index 6581d13bbc52..3c8848d28707 100644\n>>>>> --- a/src/libcamera/pipeline/mali-c55/mali-c55.cpp\n>>>>> +++ b/src/libcamera/pipeline/mali-c55/mali-c55.cpp\n>>>>> @@ -44,6 +44,8 @@\n>>>>>     #include \"libcamera/internal/v4l2_subdevice.h\"\n>>>>>     #include \"libcamera/internal/v4l2_videodevice.h\"\n>>>>> +#include \"rzg2l-cru.h\"\n>>>>> +\n>>>>>     namespace {\n>>>>>     bool isFormatRaw(const libcamera::PixelFormat &pixFmt)\n>>>>> @@ -105,7 +107,12 @@ public:\n>>>>>     \t\tstd::unique_ptr<V4L2Subdevice> csi2_;\n>>>>>     \t\tstd::unique_ptr<CameraSensor> sensor_;\n>>>>>     \t};\n>>>>> -\tusing CameraType = std::variant<Tpg, Inline>;\n>>>>> +\n>>>>> +\tstruct Memory {\n>>>>> +\t\tstd::unique_ptr<RZG2LCRU> cru_;\n>>>>\n>>>> Maybe I am missing something obvious, but how come the \"ivc\" things are not here,\n>>>> but in the pipeline handler?\n>>>>\n>>>\n>>> There is only one IVC in the system, while there are up to 4 CSI-2\n>>> receivers (if we're talking v2h).\n>>>\n>>> Would you expect the ivc to be per-camera data ?\n>>\n>> Ahh, sorry, I think I have already asked this. But I feel like I'm a bit confused by\n>> how `PipelineHandlerMaliC55::match()` is supposed to work. Specifically, when it is\n>> handling `MEDIA_ENT_F_PROC_VIDEO_PIXEL_FORMATTER`, it will overwrite the members, so\n>> that makes me think there is only one of those expected (and as you said \"There is only one IVC in the system\").\n>> But then `registerMemoryInputCamera()` registers only a single camera, so how\n>> does that work with multiple ones?\n> \n> There are no multiple cameras at this point, the Linux kernel doesn't\n> support it.\n> \n> However, even with multi-cameras, only a single component in the\n> system (when in m2m) will be of type\n> MEDIA_ENT_F_PROC_VIDEO_PIXEL_FORMATTER, and it will be the IVC subdev.\n> \n> What we will have to do then is to extend registerMemoryInputCamera()\n> to register one CameraData and one Camera for each CSI-2 receiver with\n> a camera sensor connected. We'll also have to modify the CRU media\n> device matching and acquisition, and probably move it to\n> registerMemoryInputCamera() as well now that I re-look at that.\n> \n> What members (and members of what) do you think will be overritten ?\n\nSorry, I meant `ivc_` and `ivcSd_`. They are technically overwritten every\ntime a `MEDIA_ENT_F_PROC_VIDEO_PIXEL_FORMATTER` is encountered. That's\nwhat made me think they might need to be in the camera data, but the fact\nthat the same name is looked up in the media device every time seemed to\ncontradict. I wasn't sure what I was missing.\n\nThanks for the explanation, now I think it probably makes most sense\nto leave the \"ivc\" things in the pipeline handler object.\n\n\n> \n>>\n>>\n>>>\n>>>>\n>>>>> +\t};\n>>>>> +\n>>>>> +\tusing CameraType = std::variant<Tpg, Inline, Memory>;\n>>>>>     \tMaliC55CameraData(PipelineHandler *pipe)\n>>>>>     \t\t: Camera::Private(pipe)\n>>>>> @@ -116,6 +123,7 @@ public:\n>>>>> [...]\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 C2057BE086\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 13 Mar 2026 15:41:00 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 179006261B;\n\tFri, 13 Mar 2026 16:41:00 +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 C11FE6261B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 13 Mar 2026 16:40:58 +0100 (CET)","from [192.168.33.26] (185.182.214.153.nat.pool.zt.hu\n\t[185.182.214.153])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 58C3D5A5;\n\tFri, 13 Mar 2026 16:39:49 +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=\"cYZMn8xE\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1773416389;\n\tbh=4kdBLRqjkoO1vo2mwI3L5+j9b9+Mwi3MCf0d45GdGcs=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=cYZMn8xEO3A2BWuJs/zQeO9w3CBbK9+BlEkbSIlvJ7SQnIv0IEml5tlYBsL+Qabh1\n\tsqv8jm7E568fGAOkfXs4rDzsieclfbvQWPace0pyDVIZSkrQaK97jW6nIU550czGIl\n\tnQGR8fzalIL6+ludQEm6Xb8r3SVVuHJM+khYEvOo=","Message-ID":"<d27f04ea-d92e-4b05-a1aa-a6f76e26563f@ideasonboard.com>","Date":"Fri, 13 Mar 2026 16:40:55 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v4 4/7] libcamera: mali-c55: Register memory input camera","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Cc":"Daniel Scally <dan.scally@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20260313-mali-cru-v4-0-c0d9bc8cd8fa@ideasonboard.com>\n\t<20260313-mali-cru-v4-4-c0d9bc8cd8fa@ideasonboard.com>\n\t<782dcd62-66ca-4c0b-b556-a1ec2b26daf9@ideasonboard.com>\n\t<abQjm-BshEoL26sU@zed>\n\t<844ec5ae-d7f3-45c1-a6a3-901fe465515f@ideasonboard.com>\n\t<abQpNKCdpCcRUaj6@zed>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<abQpNKCdpCcRUaj6@zed>","Content-Type":"text/plain; charset=UTF-8; format=flowed","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>"}}]