[{"id":34833,"web_url":"https://patchwork.libcamera.org/comment/34833/","msgid":"<85ms9dwh7q.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","date":"2025-07-09T14:51:05","subject":"Re: [PATCH 1/2] libcamera: simple: Detect Bayer pattern change\n\tduring configure()","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Hi Umang,\n\nthank you for the patch.\n\nUmang Jain <uajain@igalia.com> writes:\n\n> Bayer pattern on the sensor can change while configuring it with the\n> intended capture format. This is due to the transform being applied on\n> the sensor which supports [v/h]flips.\n>\n> During configure(), the simple pipeline handler does not detect any\n> bayer pattern changes that can arise due to the transformations being\n> applied via SimpleCameraData:setupFormats(). In such cases, the video\n> node will be configured in-correctly, without realising the bayer\n> pattern has changed on the sensor, for the given capture format.\n>\n> This patch detects the bayer pattern change after the sensor has\n> been configured and retrieves the corresponding V4L2 pixel format\n> to correctly configure the video node.\n\nThe patches make software ISP working on my RPi 4B but red and blue\nare swapped (tested with `cam -D').\n\n> Signed-off-by: Umang Jain <uajain@igalia.com>\n> ---\n>  src/libcamera/pipeline/simple/simple.cpp | 16 ++++++++++++++--\n>  1 file changed, 14 insertions(+), 2 deletions(-)\n>\n> diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\n> index efb07051..e2a48724 100644\n> --- a/src/libcamera/pipeline/simple/simple.cpp\n> +++ b/src/libcamera/pipeline/simple/simple.cpp\n> @@ -1353,8 +1353,20 @@ int SimplePipelineHandler::configure(Camera *camera, CameraConfiguration *c)\n>  \tif (ret < 0)\n>  \t\treturn ret;\n>  \n> -\t/* Configure the video node. */\n> -\tV4L2PixelFormat videoFormat = video->toV4L2PixelFormat(pipeConfig->captureFormat);\n> +\t/* Configure the video node, taking into account any Bayer pattern change. */\n> +\tV4L2PixelFormat videoFormat;\n> +\tif (format.code == pipeConfig->code) {\n> +\t\tvideoFormat = video->toV4L2PixelFormat(pipeConfig->captureFormat);\n> +\t} else {\n> +\t\t/*\n> +\t\t * Bayer pattern has changed because of the transform that was applied on\n> +\t\t * the sensor. Get the V4L2PixelFormat corresponding to the configured Bayer\n> +\t\t * pattern.\n> +\t\t */\n> +\t\tBayerFormat cfgBayer = BayerFormat::fromPixelFormat(pipeConfig->captureFormat);\n> +\t\tcfgBayer.order = data->sensor_->bayerOrder(config->combinedTransform());\n> +\t\tvideoFormat = cfgBayer.toV4L2PixelFormat();\n> +\t}\n>  \n>  \tV4L2DeviceFormat captureFormat;\n>  \tcaptureFormat.fourcc = videoFormat;","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 E9BC2C0DA4\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  9 Jul 2025 14:51:14 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3B63668EED;\n\tWed,  9 Jul 2025 16:51:14 +0200 (CEST)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.129.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6812368E8A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  9 Jul 2025 16:51:12 +0200 (CEST)","from mail-wr1-f69.google.com (mail-wr1-f69.google.com\n\t[209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-135-P72d7mHBOdGjPq1I-XLYyA-1; Wed, 09 Jul 2025 10:51:09 -0400","by mail-wr1-f69.google.com with SMTP id\n\tffacd0b85a97d-3b39cc43f15so8342f8f.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 09 Jul 2025 07:51:08 -0700 (PDT)","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\tffacd0b85a97d-3b4708d0b9bsm16256813f8f.30.2025.07.09.07.51.05\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 09 Jul 2025 07:51:06 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"QXXIy1e0\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1752072671;\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=3SWPhpAOvC611OtefKQ2Yb+2tV3VjRdx9nv2f3Qe8vc=;\n\tb=QXXIy1e04uXyF4vJWGlydwl1KgOGQx7N+bgqjFvQ6qDP+PdtNiesG6pajXAaw5VaphRwZe\n\tr0buVjumAO8I/Q7TZzwGk2+viUUSQpksRfNEeDPRK75P53r2HM6qJWCWE/ownRSh6gx6Kh\n\t7XGJOqMM2+xX4O7Bv4BGg8KSVdreoKA=","X-MC-Unique":"P72d7mHBOdGjPq1I-XLYyA-1","X-Mimecast-MFC-AGG-ID":"P72d7mHBOdGjPq1I-XLYyA_1752072668","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1752072667; x=1752677467;\n\th=mime-version:user-agent:message-id:date:references:in-reply-to\n\t:subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=3SWPhpAOvC611OtefKQ2Yb+2tV3VjRdx9nv2f3Qe8vc=;\n\tb=wcJY23ruYPPEcPiAi9sctykcQjQxhHHRffS8n/Tx1Xi9REfKnKgZX9eay8JeoOtr5K\n\t9dMdMl6i7QhOqfFUrfMysxCQDMAOdyI9gsfR4PEbSzBEmWZCpWKffldQctqf2/4z4Sck\n\tT3OUKlDt+veENE2e9DzBl5hV43wTmHarHpqVJKjb4NLwMCVyUJ1UJuJVnyaVYYyyNh09\n\toUUIbQGbuhJCARh0MfPnBNhAa4BXjQkxB9P4/AG13NQEZBb0auJu+S5u7rBoay4Rd7cv\n\t1sjyd6p1SGt/u8y9Pjf/mQYYIP8mNfieeAko6k/MhPvxBMonEvy3zjLvX1XPUA2CHpNW\n\tNwTg==","X-Gm-Message-State":"AOJu0Yx49XYq0NlGl9BDs1hBLjXcyu5GieQ1Yv/W+lM6dy16gl/WAolU\n\ts0lkN2ZDK4mqrLGqBv0nx0txMGmyAkhSJyXCPdinYZaiKdHOzmISh/y9Qn/LAiLaJj4kbbxFpk1\n\tJxSDCNwB4OlyblzuDu1Ig0LHEXbqnfBH0wnqEZyX9gD3xgNfmxJLGnaBegMKdkXaupN2WeJXE3L\n\tZXj+Onie/fBaH9S8J+Yc8vUSfpcZQYYPVrPQwrGxvpYfn15Cw2qYypbqUTMyw=","X-Gm-Gg":"ASbGncvQf8/jZyKVcdPFLzttUod1H9S20so4FyNUyz5n6vpsJQ6NTsyaTlyd1kteimh\n\tZK5Kb+n0nwKCQl4lYHZYE66XZHeWFOcpgKfnXlXyOqKEeCLRrngokYZg9LvEbdOuev9bZLR6pI4\n\tB4w7RD6o3GQTYofSOwfrmBJkoGFGSiRsOyto5hHwcxBo1P2dbSheqbWhluhJPd9bQH/K9dNAx/A\n\t8fDb70vxZBJ/kAnkuvL96+bmSrzUixmiCAGt2p/X6uADf63fzuzaeN3b5EfB1Qyu8QAHwvwSAJm\n\txixnkiZRqghnlxeA2HQnPy5SlzMVA9HiopZC9wvZiKtxwnzeOkhfMGrtqhqqG2iKSib1/yHBUW0\n\t=","X-Received":["by 2002:a05:6000:2a04:b0:3a4:ed62:c7e1 with SMTP id\n\tffacd0b85a97d-3b5e788d468mr146621f8f.12.1752072667268; \n\tWed, 09 Jul 2025 07:51:07 -0700 (PDT)","by 2002:a05:6000:2a04:b0:3a4:ed62:c7e1 with SMTP id\n\tffacd0b85a97d-3b5e788d468mr146596f8f.12.1752072666703; \n\tWed, 09 Jul 2025 07:51:06 -0700 (PDT)"],"X-Google-Smtp-Source":"AGHT+IGnugIb6FUDBGLl9Jm0yRr6Xsx/NmDFnJMM+TdYtFVWworutVMRqg7W3I25gUBOZrc2yY7IAw==","From":"Milan Zamazal <mzamazal@redhat.com>","To":"Umang Jain <uajain@igalia.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH 1/2] libcamera: simple: Detect Bayer pattern change\n\tduring configure()","In-Reply-To":"<20250709134229.135949-2-uajain@igalia.com> (Umang Jain's\n\tmessage of \"Wed, 9 Jul 2025 19:12:28 +0530\")","References":"<20250709134229.135949-1-uajain@igalia.com>\n\t<20250709134229.135949-2-uajain@igalia.com>","Date":"Wed, 09 Jul 2025 16:51:05 +0200","Message-ID":"<85ms9dwh7q.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":"3ijhV1T5--FAJoyjUZ-jbPp7m10LQnAbN7_zsNHkuhQ_1752072668","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":34836,"web_url":"https://patchwork.libcamera.org/comment/34836/","msgid":"<axgfr542tbahdzumkr6cd7vsnogo2fdc43wax3z35snxbzg4uv@v234zhtk76m3>","date":"2025-07-10T03:30:23","subject":"Re: [PATCH 1/2] libcamera: simple: Detect Bayer pattern change\n\tduring configure()","submitter":{"id":232,"url":"https://patchwork.libcamera.org/api/people/232/","name":"Umang Jain","email":"uajain@igalia.com"},"content":"Hi Milan\n\nOn Wed, Jul 09, 2025 at 04:51:05PM +0200, Milan Zamazal wrote:\n> Hi Umang,\n> \n> thank you for the patch.\n> \n> Umang Jain <uajain@igalia.com> writes:\n> \n> > Bayer pattern on the sensor can change while configuring it with the\n> > intended capture format. This is due to the transform being applied on\n> > the sensor which supports [v/h]flips.\n> >\n> > During configure(), the simple pipeline handler does not detect any\n> > bayer pattern changes that can arise due to the transformations being\n> > applied via SimpleCameraData:setupFormats(). In such cases, the video\n> > node will be configured in-correctly, without realising the bayer\n> > pattern has changed on the sensor, for the given capture format.\n> >\n> > This patch detects the bayer pattern change after the sensor has\n> > been configured and retrieves the corresponding V4L2 pixel format\n> > to correctly configure the video node.\n> \n> The patches make software ISP working on my RPi 4B but red and blue\n> are swapped (tested with `cam -D').\n\nUsing IMX219 right?\n\nI think that is happening due to the fact this patch did not update the\ncached pipeConfig_, after the flips are applied. So swISP_ is getting\nfed a (outdated)pipeConfig where no flips are applied.\n\n....\nah, but for that to happen, we need to make the cached pipeConfig_ mutable eek!\n\n> \n> > Signed-off-by: Umang Jain <uajain@igalia.com>\n> > ---\n> >  src/libcamera/pipeline/simple/simple.cpp | 16 ++++++++++++++--\n> >  1 file changed, 14 insertions(+), 2 deletions(-)\n> >\n> > diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\n> > index efb07051..e2a48724 100644\n> > --- a/src/libcamera/pipeline/simple/simple.cpp\n> > +++ b/src/libcamera/pipeline/simple/simple.cpp\n> > @@ -1353,8 +1353,20 @@ int SimplePipelineHandler::configure(Camera *camera, CameraConfiguration *c)\n> >  \tif (ret < 0)\n> >  \t\treturn ret;\n> >  \n> > -\t/* Configure the video node. */\n> > -\tV4L2PixelFormat videoFormat = video->toV4L2PixelFormat(pipeConfig->captureFormat);\n> > +\t/* Configure the video node, taking into account any Bayer pattern change. */\n> > +\tV4L2PixelFormat videoFormat;\n> > +\tif (format.code == pipeConfig->code) {\n> > +\t\tvideoFormat = video->toV4L2PixelFormat(pipeConfig->captureFormat);\n> > +\t} else {\n> > +\t\t/*\n> > +\t\t * Bayer pattern has changed because of the transform that was applied on\n> > +\t\t * the sensor. Get the V4L2PixelFormat corresponding to the configured Bayer\n> > +\t\t * pattern.\n> > +\t\t */\n> > +\t\tBayerFormat cfgBayer = BayerFormat::fromPixelFormat(pipeConfig->captureFormat);\n> > +\t\tcfgBayer.order = data->sensor_->bayerOrder(config->combinedTransform());\n> > +\t\tvideoFormat = cfgBayer.toV4L2PixelFormat();\n> > +\t}\n> >  \n> >  \tV4L2DeviceFormat captureFormat;\n> >  \tcaptureFormat.fourcc = videoFormat;\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 5B86CC3237\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 10 Jul 2025 03:30:24 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3FAAC68EF7;\n\tThu, 10 Jul 2025 05:30:23 +0200 (CEST)","from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1D85061518\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 10 Jul 2025 05:30:21 +0200 (CEST)","from [49.36.69.85] (helo=uajain) by fanzine2.igalia.com with\n\tesmtpsa \n\t(Cipher TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256)\n\t(Exim) id 1uZhzH-00ElQk-No; Thu, 10 Jul 2025 05:30:20 +0200"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=igalia.com header.i=@igalia.com\n\theader.b=\"P4dW2PQN\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com;\n\ts=20170329;\n\th=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:\n\tSubject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID:\n\tContent-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc\n\t:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe:\n\tList-Post:List-Owner:List-Archive;\n\tbh=fXUThxjjEsrfOfFD4za86D8MZEYGCvld1GVr43sPI7c=;\n\tb=P4dW2PQNX0JKqtv/x8RnstiZoM\n\tS0f2GDzWs4wFdDBF6HHPB9X8NtAUDVE+oxQDfKhCdVKXdltoc8wCKOASqcq9EiMpBeQkekVppUYxa\n\t6LuKCpJ8J8xQMfBum31d2ry/udn8CwQnjKb9fBG2SC2TZLbj7vZuUL/KmpbJJhdNrxSg9FS7gogm+\n\tUyXHRVEMULlPDyiJqr2aMtvxZnAVFrtWOVZwRTV1vSWNrgXjpo4BgP/hlM8te7lAytYhGvi2sdfxg\n\tIKFOt8pKwJ8OBbKjkmtUu/tBCo8b+2L2KBVmwcFtpipB0/NCyDziIig4zU24c41uDdNT8WOY9XRHU\n\t4UAdGOSA==;","Date":"Thu, 10 Jul 2025 09:00:23 +0530","From":"Umang Jain <uajain@igalia.com>","To":"Milan Zamazal <mzamazal@redhat.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH 1/2] libcamera: simple: Detect Bayer pattern change\n\tduring configure()","Message-ID":"<axgfr542tbahdzumkr6cd7vsnogo2fdc43wax3z35snxbzg4uv@v234zhtk76m3>","References":"<20250709134229.135949-1-uajain@igalia.com>\n\t<20250709134229.135949-2-uajain@igalia.com>\n\t<85ms9dwh7q.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<85ms9dwh7q.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","User-Agent":"NeoMutt/20250510-dirty","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":34840,"web_url":"https://patchwork.libcamera.org/comment/34840/","msgid":"<85y0swh44q.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","date":"2025-07-10T07:55:01","subject":"Re: [PATCH 1/2] libcamera: simple: Detect Bayer pattern change\n\tduring configure()","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Umang Jain <uajain@igalia.com> writes:\n\n> Hi Milan\n>\n> On Wed, Jul 09, 2025 at 04:51:05PM +0200, Milan Zamazal wrote:\n>> Hi Umang,\n>> \n>> thank you for the patch.\n>> \n>> Umang Jain <uajain@igalia.com> writes:\n>> \n>> > Bayer pattern on the sensor can change while configuring it with the\n>> > intended capture format. This is due to the transform being applied on\n>> > the sensor which supports [v/h]flips.\n>> >\n>> > During configure(), the simple pipeline handler does not detect any\n>> > bayer pattern changes that can arise due to the transformations being\n>> > applied via SimpleCameraData:setupFormats(). In such cases, the video\n>> > node will be configured in-correctly, without realising the bayer\n>> > pattern has changed on the sensor, for the given capture format.\n>> >\n>> > This patch detects the bayer pattern change after the sensor has\n>> > been configured and retrieves the corresponding V4L2 pixel format\n>> > to correctly configure the video node.\n>> \n>> The patches make software ISP working on my RPi 4B but red and blue\n>> are swapped (tested with `cam -D').\n>\n> Using IMX219 right?\n\nRight.\n\n> I think that is happening due to the fact this patch did not update the\n> cached pipeConfig_, after the flips are applied. So swISP_ is getting\n> fed a (outdated)pipeConfig where no flips are applied.\n>\n> ....\n> ah, but for that to happen, we need to make the cached pipeConfig_ mutable eek!\n>\n>> \n>> > Signed-off-by: Umang Jain <uajain@igalia.com>\n>> > ---\n>> >  src/libcamera/pipeline/simple/simple.cpp | 16 ++++++++++++++--\n>> >  1 file changed, 14 insertions(+), 2 deletions(-)\n>> >\n>> > diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\n>> > index efb07051..e2a48724 100644\n>> > --- a/src/libcamera/pipeline/simple/simple.cpp\n>> > +++ b/src/libcamera/pipeline/simple/simple.cpp\n>> > @@ -1353,8 +1353,20 @@ int SimplePipelineHandler::configure(Camera *camera, CameraConfiguration *c)\n>> >  \tif (ret < 0)\n>> >  \t\treturn ret;\n>> >  \n>> > -\t/* Configure the video node. */\n>> > -\tV4L2PixelFormat videoFormat = video->toV4L2PixelFormat(pipeConfig->captureFormat);\n>> > +\t/* Configure the video node, taking into account any Bayer pattern change. */\n>> > +\tV4L2PixelFormat videoFormat;\n>> > +\tif (format.code == pipeConfig->code) {\n>> > +\t\tvideoFormat = video->toV4L2PixelFormat(pipeConfig->captureFormat);\n>> > +\t} else {\n>> > +\t\t/*\n>> > +\t\t * Bayer pattern has changed because of the transform that was applied on\n>> > +\t\t * the sensor. Get the V4L2PixelFormat corresponding to the configured Bayer\n>> > +\t\t * pattern.\n>> > +\t\t */\n>> > +\t\tBayerFormat cfgBayer = BayerFormat::fromPixelFormat(pipeConfig->captureFormat);\n>> > +\t\tcfgBayer.order = data->sensor_->bayerOrder(config->combinedTransform());\n>> > +\t\tvideoFormat = cfgBayer.toV4L2PixelFormat();\n>> > +\t}\n>> >  \n>> >  \tV4L2DeviceFormat captureFormat;\n>> >  \tcaptureFormat.fourcc = videoFormat;\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 CA603C3237\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 10 Jul 2025 07:55:11 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id EB81C68EFB;\n\tThu, 10 Jul 2025 09:55:10 +0200 (CEST)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.129.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3950068EAF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 10 Jul 2025 09:55:09 +0200 (CEST)","from mail-ej1-f72.google.com (mail-ej1-f72.google.com\n\t[209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-561-nBXMOe3CO3OQntfy6s_3Lg-1; Thu, 10 Jul 2025 03:55:06 -0400","by mail-ej1-f72.google.com with SMTP id\n\ta640c23a62f3a-adb33457610so90228366b.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 10 Jul 2025 00:55:05 -0700 (PDT)","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\ta640c23a62f3a-ae6e82dedf4sm86031566b.148.2025.07.10.00.55.02\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 10 Jul 2025 00:55:02 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"RJ2k5kpk\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1752134107;\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=llKvjyOS0F51D5bLdTZJKRxOL4uk6TxWnkfNbclD6Nc=;\n\tb=RJ2k5kpkLICw7wjZVGOztFvuh5/8uG0WGVTNJ/NsDb1DkiWt0N/PYFRyJrFJOW2QRZvf1t\n\tBVkGmqxKOUT08PJext0by+5mxSrUQENpA4N2Ve4mCJpA/1lMAmuVAFTfvqaP1Hq6R4k9kz\n\toUI/3Id62xyY0h69yyuHMSuE7H84NNU=","X-MC-Unique":"nBXMOe3CO3OQntfy6s_3Lg-1","X-Mimecast-MFC-AGG-ID":"nBXMOe3CO3OQntfy6s_3Lg_1752134104","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1752134103; x=1752738903;\n\th=mime-version:user-agent:message-id:date:references:in-reply-to\n\t:subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=llKvjyOS0F51D5bLdTZJKRxOL4uk6TxWnkfNbclD6Nc=;\n\tb=k5WodLtWehbNYdQt3gwcX7Q7bvyyu0e70f3gkGfqOjPLljEawGKgk/QraEj057y6mm\n\tHWfNRydp52cT0s8P9HPVbQ3itLb4PrcJRDvZkS5djhwLziPbt/Z8gNpbZpJj2F8cMman\n\tv6T3CNpOVrDAuGwMYA8fp6rjYXAhcEbXulHjX0y8u7pzsqyn2HjiGog48cKWc0RCny9G\n\tsNUNEzcysDUcOgPQqyCw6rqUiAAnxXuzChMPSWqEojZfJGX61Mbojv8qaCDDWKwnwvZ6\n\tlvG50bqtinMLoWdY1IzzCvekK+g7nR7SPTpQu5DpIBmtj1Vrm9i1mMB0U8Gn6KnsdYrQ\n\t32HA==","X-Gm-Message-State":"AOJu0YwuQxSsj8YzYxvBpMoeR51DfpcmiPpXZlUqIRg3WqzgPVuFqj2l\n\tK54GeiFy2689v2tnhQ4xPl/Ks4YARoA1y7ogqTG+a8R+qv/M3qBAekWGsgGgSV0KSFAkE94ChK4\n\tPiKMQOZ29atW9DokmRWYU2awQdgNm+X+Aor5XjMV6+wVGZGtJ9qMK6zlhGT+Dp3dZ+mJsdCkk1X\n\tKNeBc2EJfgTQnLodW6CNdDkpwxrtk8xtI/XV7Wi12Ft5GMmQrf9koJZDRYd/U=","X-Gm-Gg":"ASbGncsSkl7vln+rFMYTYgyf/48mk940GQG+rmPJ94vhQBOSV4zKgJxyp7NRspkRmhr\n\tM+JiOj4HhoH+fI6OQfryQ5AeSNkZjFEI/8gY2PUhvXQtJqo2gNvls1xu76qcmTXbzo9kmGxZUpz\n\tujjziMh4Yzx+7h3W20vStLfgV+4eXBS1TT3r66RLR6BxGqnhBxIz5nKUCV1r8cdX8fTn1NCxX+1\n\t7utmiUX5QKj9o11R8lRf81XpUPmMaYhVTnovi/5/VGKiTX4uJ8FN+v248vQSASiLKll+D2QB4Ob\n\tF4FohJUaJVghYF2kOB2aqgiUOTiLxBAx7hFpaGv8Wg9CHIgRSj8ST3F35/tu2Q5sDbmIOOAX66g\n\t=","X-Received":["by 2002:a17:907:9717:b0:ae3:cc60:8ce7 with SMTP id\n\ta640c23a62f3a-ae6e6e7a9f9mr215647666b.19.1752134103509; \n\tThu, 10 Jul 2025 00:55:03 -0700 (PDT)","by 2002:a17:907:9717:b0:ae3:cc60:8ce7 with SMTP id\n\ta640c23a62f3a-ae6e6e7a9f9mr215644566b.19.1752134103011; \n\tThu, 10 Jul 2025 00:55:03 -0700 (PDT)"],"X-Google-Smtp-Source":"AGHT+IHsMBh3kKODT2Itl57feV8aNgeYaKIYc3++U7ehvbCRIseQc96tQ/Nb0tv8DlPK+oLlwz0Gvg==","From":"Milan Zamazal <mzamazal@redhat.com>","To":"Umang Jain <uajain@igalia.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH 1/2] libcamera: simple: Detect Bayer pattern change\n\tduring configure()","In-Reply-To":"<axgfr542tbahdzumkr6cd7vsnogo2fdc43wax3z35snxbzg4uv@v234zhtk76m3>\n\t(Umang Jain's message of \"Thu, 10 Jul 2025 09:00:23 +0530\")","References":"<20250709134229.135949-1-uajain@igalia.com>\n\t<20250709134229.135949-2-uajain@igalia.com>\n\t<85ms9dwh7q.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>\n\t<axgfr542tbahdzumkr6cd7vsnogo2fdc43wax3z35snxbzg4uv@v234zhtk76m3>","Date":"Thu, 10 Jul 2025 09:55:01 +0200","Message-ID":"<85y0swh44q.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":"J6pO-XBddVo1wd2v2QpgTwYDipiMs03W5AG-Eq20TxI_1752134104","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>"}}]