[{"id":22044,"web_url":"https://patchwork.libcamera.org/comment/22044/","msgid":"<164241855389.10801.5229998335112168804@Monstersaurus>","date":"2022-01-17T11:22:33","subject":"Re: [libcamera-devel] [PATCH v2 2/2] pipeline: raspberrypi:\n\tSimplify calculation of sensor's native Bayer order","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting David Plowman (2022-01-13 14:15:58)\n> Now that the sensor is defined to list mbus codes using its native\n> (untransformed) Bayer order, the method of obtaining it can be\n> simplified. We don't have to try and reset the flips, we just use the\n> value directly from the sensor.\n> \n> Signed-off-by: David Plowman <david.plowman@raspberrypi.com>\n\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> ---\n>  src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 9 ++-------\n>  1 file changed, 2 insertions(+), 7 deletions(-)\n> \n> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> index 49d7ff23..79cb75c6 100644\n> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> @@ -1279,8 +1279,8 @@ int PipelineHandlerRPi::registerCamera(MediaDevice *unicam, MediaDevice *isp, Me\n>          * Thirdly, what is the \"native\" Bayer order, when no transforms are\n>          * applied?\n>          *\n> -        * As part of answering the final question, we reset the camera to\n> -        * no transform at all.\n> +        * We note that the sensor's cached list of supported formats is\n> +        * already in the \"native\" order, with any flips having been undone.\n>          */\n>         const V4L2Subdevice *sensor = data->sensor_->device();\n>         const struct v4l2_query_ext_ctrl *hflipCtrl = sensor->controlInfo(V4L2_CID_HFLIP);\n> @@ -1288,11 +1288,6 @@ int PipelineHandlerRPi::registerCamera(MediaDevice *unicam, MediaDevice *isp, Me\n>                 /* We assume it will support vflips too... */\n>                 data->supportsFlips_ = true;\n>                 data->flipsAlterBayerOrder_ = hflipCtrl->flags & V4L2_CTRL_FLAG_MODIFY_LAYOUT;\n> -\n> -               ControlList ctrls(data->sensor_->controls());\n> -               ctrls.set(V4L2_CID_HFLIP, 0);\n> -               ctrls.set(V4L2_CID_VFLIP, 0);\n> -               data->setSensorControls(ctrls);\n>         }\n>  \n>         /* Look for a valid Bayer format. */\n> -- \n> 2.30.2\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 A8C91BE086\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 17 Jan 2022 11:22:37 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 63C1F604F8;\n\tMon, 17 Jan 2022 12:22:37 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9314B60217\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 17 Jan 2022 12:22:36 +0100 (CET)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 4A33B596;\n\tMon, 17 Jan 2022 12:22:36 +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=\"o/P1kkaf\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1642418556;\n\tbh=mVIwkUyXv0R9zqo5gChxopq2m6dDg/Phvg3o+rurc8E=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=o/P1kkafRG63SFq7E9QeKHCSpNnENijVqiW62BDkNT0HK06yyEnftJXMEfpaSrxNk\n\tanyTZdQG792Ry4/d/5peLCpm9SvyyLlro6F5PzYKCoWdXD5+RVxhksE8Ta2r/OQX91\n\tfFEN6FZ9PLHel8GRfVHDoJ/MWKdz/4jljSnEVBTQ=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20220113141558.5805-3-david.plowman@raspberrypi.com>","References":"<20220113141558.5805-1-david.plowman@raspberrypi.com>\n\t<20220113141558.5805-3-david.plowman@raspberrypi.com>","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"David Plowman <david.plowman@raspberrypi.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Mon, 17 Jan 2022 11:22:33 +0000","Message-ID":"<164241855389.10801.5229998335112168804@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH v2 2/2] pipeline: raspberrypi:\n\tSimplify calculation of sensor's native Bayer order","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":22046,"web_url":"https://patchwork.libcamera.org/comment/22046/","msgid":"<CAEmqJPprdWk6xaQ4DAYJQbx2iUWTsy-1BSJseooOUU714XQrUQ@mail.gmail.com>","date":"2022-01-17T14:58:05","subject":"Re: [libcamera-devel] [PATCH v2 2/2] pipeline: raspberrypi:\n\tSimplify calculation of sensor's native Bayer order","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"content":"Hi David,\n\nThank you for your patch.\n\nOn Thu, 13 Jan 2022 at 14:16, David Plowman <david.plowman@raspberrypi.com>\nwrote:\n\n> Now that the sensor is defined to list mbus codes using its native\n> (untransformed) Bayer order, the method of obtaining it can be\n> simplified. We don't have to try and reset the flips, we just use the\n> value directly from the sensor.\n>\n> Signed-off-by: David Plowman <david.plowman@raspberrypi.com>\n>\n\nReviewed-by: Naushir Patuck <naush@raspberrypi.com>\n\n\n> ---\n>  src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 9 ++-------\n>  1 file changed, 2 insertions(+), 7 deletions(-)\n>\n> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> index 49d7ff23..79cb75c6 100644\n> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> @@ -1279,8 +1279,8 @@ int PipelineHandlerRPi::registerCamera(MediaDevice\n> *unicam, MediaDevice *isp, Me\n>          * Thirdly, what is the \"native\" Bayer order, when no transforms\n> are\n>          * applied?\n>          *\n> -        * As part of answering the final question, we reset the camera to\n> -        * no transform at all.\n> +        * We note that the sensor's cached list of supported formats is\n> +        * already in the \"native\" order, with any flips having been\n> undone.\n>          */\n>         const V4L2Subdevice *sensor = data->sensor_->device();\n>         const struct v4l2_query_ext_ctrl *hflipCtrl =\n> sensor->controlInfo(V4L2_CID_HFLIP);\n> @@ -1288,11 +1288,6 @@ int PipelineHandlerRPi::registerCamera(MediaDevice\n> *unicam, MediaDevice *isp, Me\n>                 /* We assume it will support vflips too... */\n>                 data->supportsFlips_ = true;\n>                 data->flipsAlterBayerOrder_ = hflipCtrl->flags &\n> V4L2_CTRL_FLAG_MODIFY_LAYOUT;\n> -\n> -               ControlList ctrls(data->sensor_->controls());\n> -               ctrls.set(V4L2_CID_HFLIP, 0);\n> -               ctrls.set(V4L2_CID_VFLIP, 0);\n> -               data->setSensorControls(ctrls);\n>         }\n>\n>         /* Look for a valid Bayer format. */\n> --\n> 2.30.2\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 3D95EBE086\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 17 Jan 2022 14:58:23 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id EC0106093D;\n\tMon, 17 Jan 2022 15:58:22 +0100 (CET)","from mail-lf1-x129.google.com (mail-lf1-x129.google.com\n\t[IPv6:2a00:1450:4864:20::129])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D4D4260217\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 17 Jan 2022 15:58:21 +0100 (CET)","by mail-lf1-x129.google.com with SMTP id m1so58655502lfq.4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 17 Jan 2022 06:58:21 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"ILdwMUbo\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=rakE1lTW5mjvckkBlxa2zXJAK+RV2wbyjwR0xkltIOU=;\n\tb=ILdwMUbob/1Z5hg7dP5AIT+uEOHvF76Hu4VoO47OFNdGTJ81eCOTphRPS2yO5X5PRm\n\tdR2EmpGnELyO3RYNaGOtXhZlw2HuHk1Yj0Br458iTrfDbyhI7RD7Bc9RLR3dsPTyknUG\n\tScU5kpYaGulZjhF/Rh6lRkahBjEuoE1LDV3rC+Lq0KAiz12LTbQmfrDc3TYyr4qQ3Tzg\n\tJd/zxgZbzrK/H/GbCEdhkS72PDwp/3NBxbPpLl6pi93DK8QSw0hhN9jv/0jf+Aijb7Bi\n\tAXiPAyf2t5i+qiPiKTi86tloQ6awVsg4CV/UJlKeJyKXkvmIixtienbhp2mekNhYfYBy\n\tEYeA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=rakE1lTW5mjvckkBlxa2zXJAK+RV2wbyjwR0xkltIOU=;\n\tb=1QMCUfdxATPmFzFr//GmrP28GFvJn+2BYsN2IOqGi8lNx5akL9GCnKKaejSLPuXmqt\n\tOQ6qcq1G4XYzbMtJ5hyhf4ME2ZQp12NcENf37RD1o1tGOGS1pXHxWV0POnjXzJl4xJgB\n\tebKEqqlNSYFol4t3wgqMHQToh/ni29UH+f3YqWER9RxMy5suyHG7NPx2ZLG4FvWLzIHX\n\tzaUsOKr2/4zw7zRuvtNMbn8q/9Bl/iZWXjk5GgaNVC+jmqBSjanZIWaYoaGLCaULKkHx\n\tFaZ63bbDrlVu81Un7zvBahoftCN0HnvyAe1ZVmGI7jKsiHzeefDLKfNJS6gbQAX0Zm4h\n\tpLNA==","X-Gm-Message-State":"AOAM533aS3vYn8uVmNQrH+48wb4AiOfao/kdP35PAt7tNusPEJV7r5F1\n\tqJC+Ro35qAT81rtXJgtI9l0x/b/DsNiU2L7a872Sqgrs7OCe+o7y","X-Google-Smtp-Source":"ABdhPJy67tMZ6hRDKZgJGPtqKxgaDeLeCCSv9gZGX8bmzKE3JGpHPGv0G5hgfgNNnZ1qFow7NM3Iv+tLHwFisNq4/58=","X-Received":"by 2002:a05:6512:3056:: with SMTP id\n\tb22mr17337100lfb.611.1642431501296; \n\tMon, 17 Jan 2022 06:58:21 -0800 (PST)","MIME-Version":"1.0","References":"<20220113141558.5805-1-david.plowman@raspberrypi.com>\n\t<20220113141558.5805-3-david.plowman@raspberrypi.com>","In-Reply-To":"<20220113141558.5805-3-david.plowman@raspberrypi.com>","From":"Naushir Patuck <naush@raspberrypi.com>","Date":"Mon, 17 Jan 2022 14:58:05 +0000","Message-ID":"<CAEmqJPprdWk6xaQ4DAYJQbx2iUWTsy-1BSJseooOUU714XQrUQ@mail.gmail.com>","To":"David Plowman <david.plowman@raspberrypi.com>","Content-Type":"multipart/alternative; boundary=\"00000000000033f75d05d5c862c7\"","Subject":"Re: [libcamera-devel] [PATCH v2 2/2] pipeline: raspberrypi:\n\tSimplify calculation of sensor's native Bayer order","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>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]