[{"id":37225,"web_url":"https://patchwork.libcamera.org/comment/37225/","msgid":"<a27f8cb3-221f-4d64-a6c1-90efa067dc31@ideasonboard.com>","date":"2025-12-08T10:23:01","subject":"Re: [PATCH 2/7] libcamera: mali-c55: Split TPG and Inline camera\n\thandling","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"Hi\n\n2025. 12. 05. 15:52 keltezéssel, Jacopo Mondi írta:\n> In order to prepare to support memory input cameras, split the handling of\n> the TPG and Inline camera cases.\n> \n> The Mali C55 pipeline handler uses the entity and subdevice stored in the\n> CameraData to support both the handling of the TPG and of the [CSI-2 +\n> sensor] use cases. Adding support for memory cameras by using the CRU unit\n> would add yet-another special case making the code harder to follow and\n> more prone to errors.\n> \n> Split the handling of the TPG and inline cameras by introducing an\n> enumeration for the camera operation modes, separating data into anonymous\n> structures and handling the configuration and linking of the media graphs\n> separately.\n> \n> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n> ---\n>   src/libcamera/pipeline/mali-c55/mali-c55.cpp | 236 +++++++++++++++------------\n>   1 file changed, 135 insertions(+), 101 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 cf0cb15f8bb39143eea38aa8acb8d2b1268f5530..801067ce00fe4e0fd6b81db699fcaed2ebb840b6 100644\n> --- a/src/libcamera/pipeline/mali-c55/mali-c55.cpp\n> +++ b/src/libcamera/pipeline/mali-c55/mali-c55.cpp\n> @@ -92,17 +92,22 @@ struct MaliC55FrameInfo {\n>   class MaliC55CameraData : public Camera::Private\n>   {\n>   public:\n> -\tMaliC55CameraData(PipelineHandler *pipe, MediaEntity *entity)\n> -\t\t: Camera::Private(pipe), entity_(entity)\n> +\tenum CameraType {\n> +\t\tTPG,\n> +\t\tInline,\n> +\t};\n> +\n> +\tMaliC55CameraData(PipelineHandler *pipe)\n> +\t\t: Camera::Private(pipe)\n>   \t{\n>   \t}\n> \n> -\tint init();\n>   \tint loadIPA();\n> \n>   \t/* Deflect these functionalities to either TPG or CameraSensor. */\n>   \tstd::vector<Size> sizes(unsigned int mbusCode) const;\n>   \tSize resolution() const;\n> +\tV4L2Subdevice *subdev() const;\n> \n>   \tint pixfmtToMbusCode(const PixelFormat &pixFmt) const;\n>   \tconst PixelFormat &bestRawFormat() const;\n> @@ -112,11 +117,9 @@ public:\n>   \tPixelFormat adjustRawFormat(const PixelFormat &pixFmt) const;\n>   \tSize adjustRawSizes(const PixelFormat &pixFmt, const Size &rawSize) const;\n> \n> -\tstd::unique_ptr<CameraSensor> sensor_;\n> +\tint initTPG(MediaEntity *tpg);\n> +\tint initInlineCamera(MediaEntity *sensor);\n> \n> -\tMediaEntity *entity_;\n> -\tstd::unique_ptr<V4L2Subdevice> csi_;\n> -\tstd::unique_ptr<V4L2Subdevice> sd_;\n>   \tStream frStream_;\n>   \tStream dsStream_;\n> \n> @@ -126,68 +129,71 @@ public:\n> \n>   \tstd::unique_ptr<DelayedControls> delayedCtrls_;\n> \n> +\tstruct {\n> +\t\tSize resolution_;\n> +\t\tstd::unique_ptr<V4L2Subdevice> sd_;\n> +\t} tpgInput;\n> +\n> +\tstruct {\n> +\t\tstd::unique_ptr<V4L2Subdevice> csi2_;\n> +\t\tstd::unique_ptr<CameraSensor> sensor_;\n> +\t} inlineInput;\n> +\n> +\tCameraType input_;\n\nI feel like it would be better here to use `std::variant`, or virtual functions\nand inheritance. I assume a camera can be just one of the types at a given\nmoment, so it does not seem ideal that both sets of members exist at all times.\n\nI'm attaching a quick (and of course untested) proof of concept patch with `std::variant`.\nPlease take a look.\n\n\n\n> +\n>   private:\n> -\tvoid initTPGData();\n>   \tvoid setSensorControls(const ControlList &sensorControls);\n> -\n>   \tstd::string id_;\n> -\tSize tpgResolution_;\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 24592C3257\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  8 Dec 2025 10:23:08 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 603D0613F3;\n\tMon,  8 Dec 2025 11:23:07 +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 548B260C8A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  8 Dec 2025 11:23:06 +0100 (CET)","from [192.168.33.35] (185.221.142.68.nat.pool.zt.hu\n\t[185.221.142.68])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 9DEA82E0;\n\tMon,  8 Dec 2025 11:20:46 +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=\"bhGvgc6M\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1765189246;\n\tbh=n3Lpj6VfN4zBNwmc8UCZIP7eOjIeByOTdi4hITkGdXQ=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=bhGvgc6MiahRyYeSLt5twIO5/tn7Fpy3LQvsYevbHLP9I6xQ9Upvypjx7Gv4gDwo2\n\tur/v/v9TtQJHAa/1NyC1wWjxZyTsw1RQv4uZ6Zt31gPkAIZwc9V6UNWZwZA0+Or8TH\n\tAHIqlvnyqC08Z1Tv+FfH0heWzv2Jyv3RbqBrApOs=","Content-Type":"multipart/mixed;\n\tboundary=\"------------ghgOKkx230j8X63BadwY2xzg\"","Message-ID":"<a27f8cb3-221f-4d64-a6c1-90efa067dc31@ideasonboard.com>","Date":"Mon, 8 Dec 2025 11:23:01 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH 2/7] libcamera: mali-c55: Split TPG and Inline camera\n\thandling","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>,\n\tDaniel Scally <dan.scally@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20251205-mali-cru-v1-0-d81bb5ffe73a@ideasonboard.com>\n\t<s3BFULjGCfYCCzIby66ekLI7LefJHvbrd9iBcUIHoevYwaLes-OSDeQu55ndYIoUD-DuRGyAMWgVsBOnsLwemQ==@protonmail.internalid>\n\t<20251205-mali-cru-v1-2-d81bb5ffe73a@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":"<20251205-mali-cru-v1-2-d81bb5ffe73a@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":37240,"web_url":"https://patchwork.libcamera.org/comment/37240/","msgid":"<ohwrb2xdnbfrbsmoot5ino5nsoj4sp6jih7tsfoldifow5vkv2@wdhztfpghhs4>","date":"2025-12-09T15:16:16","subject":"Re: [PATCH 2/7] libcamera: mali-c55: Split TPG and Inline camera\n\thandling","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"On Mon, Dec 08, 2025 at 11:23:01AM +0100, Barnabás Pőcze wrote:\n> Hi\n>\n> 2025. 12. 05. 15:52 keltezéssel, Jacopo Mondi írta:\n> > In order to prepare to support memory input cameras, split the handling of\n> > the TPG and Inline camera cases.\n> >\n> > The Mali C55 pipeline handler uses the entity and subdevice stored in the\n> > CameraData to support both the handling of the TPG and of the [CSI-2 +\n> > sensor] use cases. Adding support for memory cameras by using the CRU unit\n> > would add yet-another special case making the code harder to follow and\n> > more prone to errors.\n> >\n> > Split the handling of the TPG and inline cameras by introducing an\n> > enumeration for the camera operation modes, separating data into anonymous\n> > structures and handling the configuration and linking of the media graphs\n> > separately.\n> >\n> > Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n> > ---\n> >   src/libcamera/pipeline/mali-c55/mali-c55.cpp | 236 +++++++++++++++------------\n> >   1 file changed, 135 insertions(+), 101 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 cf0cb15f8bb39143eea38aa8acb8d2b1268f5530..801067ce00fe4e0fd6b81db699fcaed2ebb840b6 100644\n> > --- a/src/libcamera/pipeline/mali-c55/mali-c55.cpp\n> > +++ b/src/libcamera/pipeline/mali-c55/mali-c55.cpp\n> > @@ -92,17 +92,22 @@ struct MaliC55FrameInfo {\n> >   class MaliC55CameraData : public Camera::Private\n> >   {\n> >   public:\n> > -\tMaliC55CameraData(PipelineHandler *pipe, MediaEntity *entity)\n> > -\t\t: Camera::Private(pipe), entity_(entity)\n> > +\tenum CameraType {\n> > +\t\tTPG,\n> > +\t\tInline,\n> > +\t};\n> > +\n> > +\tMaliC55CameraData(PipelineHandler *pipe)\n> > +\t\t: Camera::Private(pipe)\n> >   \t{\n> >   \t}\n> >\n> > -\tint init();\n> >   \tint loadIPA();\n> >\n> >   \t/* Deflect these functionalities to either TPG or CameraSensor. */\n> >   \tstd::vector<Size> sizes(unsigned int mbusCode) const;\n> >   \tSize resolution() const;\n> > +\tV4L2Subdevice *subdev() const;\n> >\n> >   \tint pixfmtToMbusCode(const PixelFormat &pixFmt) const;\n> >   \tconst PixelFormat &bestRawFormat() const;\n> > @@ -112,11 +117,9 @@ public:\n> >   \tPixelFormat adjustRawFormat(const PixelFormat &pixFmt) const;\n> >   \tSize adjustRawSizes(const PixelFormat &pixFmt, const Size &rawSize) const;\n> >\n> > -\tstd::unique_ptr<CameraSensor> sensor_;\n> > +\tint initTPG(MediaEntity *tpg);\n> > +\tint initInlineCamera(MediaEntity *sensor);\n> >\n> > -\tMediaEntity *entity_;\n> > -\tstd::unique_ptr<V4L2Subdevice> csi_;\n> > -\tstd::unique_ptr<V4L2Subdevice> sd_;\n> >   \tStream frStream_;\n> >   \tStream dsStream_;\n> >\n> > @@ -126,68 +129,71 @@ public:\n> >\n> >   \tstd::unique_ptr<DelayedControls> delayedCtrls_;\n> >\n> > +\tstruct {\n> > +\t\tSize resolution_;\n> > +\t\tstd::unique_ptr<V4L2Subdevice> sd_;\n> > +\t} tpgInput;\n> > +\n> > +\tstruct {\n> > +\t\tstd::unique_ptr<V4L2Subdevice> csi2_;\n> > +\t\tstd::unique_ptr<CameraSensor> sensor_;\n> > +\t} inlineInput;\n> > +\n> > +\tCameraType input_;\n>\n> I feel like it would be better here to use `std::variant`, or virtual functions\n> and inheritance. I assume a camera can be just one of the types at a given\n> moment, so it does not seem ideal that both sets of members exist at all times.\n\nYou're right and we discussed it with before sending patches out,\nruling a class hierarchy as possibily an over-engineering effort for\nsuch a simple use case.\n\nSeeing you variant proposal, it looks appealing.\n\nJust one thing though: if I apply your suggestion to the beginning of\nthe series, I will probably hit quite some conflicts while rebasing.\n\nI know from a development process point of view it doesn't make sense,\nbut, do you think I can apply your std::variant<> proposal on top ?\n\n>\n> I'm attaching a quick (and of course untested) proof of concept patch with `std::variant`.\n> Please take a look.\n>\n>\n>\n> > +\n> >   private:\n> > -\tvoid initTPGData();\n> >   \tvoid setSensorControls(const ControlList &sensorControls);\n> > -\n> >   \tstd::string id_;\n> > -\tSize tpgResolution_;\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 5515CBD1F1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  9 Dec 2025 15:16:24 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8513461419;\n\tTue,  9 Dec 2025 16:16:23 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 66689606D5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  9 Dec 2025 16:16:21 +0100 (CET)","from ideasonboard.com (net-93-65-100-155.cust.vodafonedsl.it\n\t[93.65.100.155])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id E0D0163B;\n\tTue,  9 Dec 2025 16:16:19 +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=\"Jlvar9px\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1765293380;\n\tbh=ZnuJoKwamIklyEUEnyerQXv/z4K66+OOZ/Gs1LHRgd4=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=Jlvar9pxxXDUwGvpIeJdZaBvUxvLtu80AMxNIs6QST6TqqYhCy1E0o1TQHiqsybmn\n\tInRGUf8ECas4kNu40AH8IofoeBFuhE1Q8QfxNMsd6HnvwAuPuNFYKi2Dg6hs3sH8Tt\n\t3jrD6g3TNcrQJsvGjfXl5evjDjN3CEnARNeeJW8E=","Date":"Tue, 9 Dec 2025 16:16:16 +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 2/7] libcamera: mali-c55: Split TPG and Inline camera\n\thandling","Message-ID":"<ohwrb2xdnbfrbsmoot5ino5nsoj4sp6jih7tsfoldifow5vkv2@wdhztfpghhs4>","References":"<20251205-mali-cru-v1-0-d81bb5ffe73a@ideasonboard.com>\n\t<s3BFULjGCfYCCzIby66ekLI7LefJHvbrd9iBcUIHoevYwaLes-OSDeQu55ndYIoUD-DuRGyAMWgVsBOnsLwemQ==@protonmail.internalid>\n\t<20251205-mali-cru-v1-2-d81bb5ffe73a@ideasonboard.com>\n\t<a27f8cb3-221f-4d64-a6c1-90efa067dc31@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<a27f8cb3-221f-4d64-a6c1-90efa067dc31@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":37241,"web_url":"https://patchwork.libcamera.org/comment/37241/","msgid":"<daefca66-3ebc-4698-adc9-158e5a8c7c47@ideasonboard.com>","date":"2025-12-09T15:48:52","subject":"Re: [PATCH 2/7] libcamera: mali-c55: Split TPG and Inline camera\n\thandling","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"2025. 12. 09. 16:16 keltezéssel, Jacopo Mondi írta:\n> On Mon, Dec 08, 2025 at 11:23:01AM +0100, Barnabás Pőcze wrote:\n>> Hi\n>>\n>> 2025. 12. 05. 15:52 keltezéssel, Jacopo Mondi írta:\n>>> In order to prepare to support memory input cameras, split the handling of\n>>> the TPG and Inline camera cases.\n>>>\n>>> The Mali C55 pipeline handler uses the entity and subdevice stored in the\n>>> CameraData to support both the handling of the TPG and of the [CSI-2 +\n>>> sensor] use cases. Adding support for memory cameras by using the CRU unit\n>>> would add yet-another special case making the code harder to follow and\n>>> more prone to errors.\n>>>\n>>> Split the handling of the TPG and inline cameras by introducing an\n>>> enumeration for the camera operation modes, separating data into anonymous\n>>> structures and handling the configuration and linking of the media graphs\n>>> separately.\n>>>\n>>> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n>>> ---\n>>>    src/libcamera/pipeline/mali-c55/mali-c55.cpp | 236 +++++++++++++++------------\n>>>    1 file changed, 135 insertions(+), 101 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 cf0cb15f8bb39143eea38aa8acb8d2b1268f5530..801067ce00fe4e0fd6b81db699fcaed2ebb840b6 100644\n>>> --- a/src/libcamera/pipeline/mali-c55/mali-c55.cpp\n>>> +++ b/src/libcamera/pipeline/mali-c55/mali-c55.cpp\n>>> @@ -92,17 +92,22 @@ struct MaliC55FrameInfo {\n>>>    class MaliC55CameraData : public Camera::Private\n>>>    {\n>>>    public:\n>>> -\tMaliC55CameraData(PipelineHandler *pipe, MediaEntity *entity)\n>>> -\t\t: Camera::Private(pipe), entity_(entity)\n>>> +\tenum CameraType {\n>>> +\t\tTPG,\n>>> +\t\tInline,\n>>> +\t};\n>>> +\n>>> +\tMaliC55CameraData(PipelineHandler *pipe)\n>>> +\t\t: Camera::Private(pipe)\n>>>    \t{\n>>>    \t}\n>>>\n>>> -\tint init();\n>>>    \tint loadIPA();\n>>>\n>>>    \t/* Deflect these functionalities to either TPG or CameraSensor. */\n>>>    \tstd::vector<Size> sizes(unsigned int mbusCode) const;\n>>>    \tSize resolution() const;\n>>> +\tV4L2Subdevice *subdev() const;\n>>>\n>>>    \tint pixfmtToMbusCode(const PixelFormat &pixFmt) const;\n>>>    \tconst PixelFormat &bestRawFormat() const;\n>>> @@ -112,11 +117,9 @@ public:\n>>>    \tPixelFormat adjustRawFormat(const PixelFormat &pixFmt) const;\n>>>    \tSize adjustRawSizes(const PixelFormat &pixFmt, const Size &rawSize) const;\n>>>\n>>> -\tstd::unique_ptr<CameraSensor> sensor_;\n>>> +\tint initTPG(MediaEntity *tpg);\n>>> +\tint initInlineCamera(MediaEntity *sensor);\n>>>\n>>> -\tMediaEntity *entity_;\n>>> -\tstd::unique_ptr<V4L2Subdevice> csi_;\n>>> -\tstd::unique_ptr<V4L2Subdevice> sd_;\n>>>    \tStream frStream_;\n>>>    \tStream dsStream_;\n>>>\n>>> @@ -126,68 +129,71 @@ public:\n>>>\n>>>    \tstd::unique_ptr<DelayedControls> delayedCtrls_;\n>>>\n>>> +\tstruct {\n>>> +\t\tSize resolution_;\n>>> +\t\tstd::unique_ptr<V4L2Subdevice> sd_;\n>>> +\t} tpgInput;\n>>> +\n>>> +\tstruct {\n>>> +\t\tstd::unique_ptr<V4L2Subdevice> csi2_;\n>>> +\t\tstd::unique_ptr<CameraSensor> sensor_;\n>>> +\t} inlineInput;\n>>> +\n>>> +\tCameraType input_;\n>>\n>> I feel like it would be better here to use `std::variant`, or virtual functions\n>> and inheritance. I assume a camera can be just one of the types at a given\n>> moment, so it does not seem ideal that both sets of members exist at all times.\n> \n> You're right and we discussed it with before sending patches out,\n> ruling a class hierarchy as possibily an over-engineering effort for\n> such a simple use case.\n> \n> Seeing you variant proposal, it looks appealing.\n> \n> Just one thing though: if I apply your suggestion to the beginning of\n> the series, I will probably hit quite some conflicts while rebasing.\n> \n> I know from a development process point of view it doesn't make sense,\n> but, do you think I can apply your std::variant<> proposal on top ?\n\nI think so, as you see fit; but please note that it was only compile tested\nand may not pass checkstyle.py, etc.\n\n\n> \n>>\n>> I'm attaching a quick (and of course untested) proof of concept patch with `std::variant`.\n>> Please take a look.\n>>\n>>\n>>\n>>> +\n>>>    private:\n>>> -\tvoid initTPGData();\n>>>    \tvoid setSensorControls(const ControlList &sensorControls);\n>>> -\n>>>    \tstd::string id_;\n>>> -\tSize tpgResolution_;\n>>>    };\n>>>   [...]\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 4D819C3257\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  9 Dec 2025 15:49:00 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8063861410;\n\tTue,  9 Dec 2025 16:48:59 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 71CF5606D5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  9 Dec 2025 16:48:58 +0100 (CET)","from [192.168.33.36] (185.221.143.114.nat.pool.zt.hu\n\t[185.221.143.114])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id BD275110;\n\tTue,  9 Dec 2025 16:48:56 +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=\"NmnkAoCz\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1765295337;\n\tbh=rucz8vznddX1qoRxwt8XFA7HtaDRkLMDpL0EMQuXsiY=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=NmnkAoCzElijth48wuu6KEd8q+bPA4vQhNnbqkgpX002wsYgTSX35oEANzNfulq+0\n\tbxFA4lQyNiM/mpe6bANnZPBuXWAXNHX2N8NPYzu1v+3dXenzpevIamoGYyYOl/WWxD\n\tZE0sLlNNGew+B5OsRiLYDM1l3CdpVh5OdsYdLPhI=","Message-ID":"<daefca66-3ebc-4698-adc9-158e5a8c7c47@ideasonboard.com>","Date":"Tue, 9 Dec 2025 16:48:52 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH 2/7] libcamera: mali-c55: Split TPG and Inline camera\n\thandling","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Cc":"Daniel Scally <dan.scally@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20251205-mali-cru-v1-0-d81bb5ffe73a@ideasonboard.com>\n\t<s3BFULjGCfYCCzIby66ekLI7LefJHvbrd9iBcUIHoevYwaLes-OSDeQu55ndYIoUD-DuRGyAMWgVsBOnsLwemQ==@protonmail.internalid>\n\t<20251205-mali-cru-v1-2-d81bb5ffe73a@ideasonboard.com>\n\t<a27f8cb3-221f-4d64-a6c1-90efa067dc31@ideasonboard.com>\n\t<ohwrb2xdnbfrbsmoot5ino5nsoj4sp6jih7tsfoldifow5vkv2@wdhztfpghhs4>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<ohwrb2xdnbfrbsmoot5ino5nsoj4sp6jih7tsfoldifow5vkv2@wdhztfpghhs4>","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>"}}]