[{"id":27488,"web_url":"https://patchwork.libcamera.org/comment/27488/","msgid":"<168857592512.4136131.16953562293677185735@Monstersaurus>","date":"2023-07-05T16:52:05","subject":"Re: [libcamera-devel] [PATCH] pipeline: rpi: Account for Bayer\n\tpacking when validating format","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Naushir Patuck via libcamera-devel (2023-06-30 14:42:32)\n> RPiCameraConfiguration::validate() did not account for user supplied\n> Bayer packing when validating the RAW stream configuration. Fix this\n> by seeing what packing (if any) has been specified selecting the output\n> RAW stream format.\n> \n> Fixes: 6c71ee1f1530 (\"pipeline: raspberrypi: Introduce PipelineHandlerBase class\")\n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> ---\n>  src/libcamera/pipeline/rpi/common/pipeline_base.cpp | 4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n> \n> diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n> index df7482920e75..2eb71beaff55 100644\n> --- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n> +++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n> @@ -288,8 +288,8 @@ CameraConfiguration::Status RPiCameraConfiguration::validate()\n>                 unsigned int bitDepth = info.isValid() ? info.bitsPerPixel : defaultRawBitDepth;\n>                 V4L2SubdeviceFormat sensorFormat = findBestFormat(data_->sensorFormats_, cfg.size, bitDepth);\n>  \n> -               rawFormat.size = sensorFormat.size;\n> -               rawFormat.fourcc = raw.dev->toV4L2PixelFormat(cfg.pixelFormat);\n> +               BayerFormat::Packing packing = BayerFormat::fromPixelFormat(cfg.pixelFormat).packing;\n> +               rawFormat = PipelineHandlerBase::toV4L2DeviceFormat(raw.dev, sensorFormat, packing);\n>  \n>                 int ret = raw.dev->tryFormat(&rawFormat);\n>                 if (ret)\n> -- \n> 2.34.1\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 CC626BDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  5 Jul 2023 16:52:11 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 41B1E628BC;\n\tWed,  5 Jul 2023 18:52:11 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0C4AC61E37\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  5 Jul 2023 18:52:09 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(aztw-30-b2-v4wan-166917-cust845.vm26.cable.virginm.net\n\t[82.37.23.78])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id F2CDC905;\n\tWed,  5 Jul 2023 18:51:23 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1688575931;\n\tbh=Jax51XBZV3x53oCYzB4rbKpkSKfP5Uj/pOsodExKpws=;\n\th=In-Reply-To:References:To:Date:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=Y9uN/AcDlta8UX/BGiBgR2FpbvoERa/+lfJ7lYuEN6DlW17DeWQGEvJSj35Z8f4Iz\n\tLiawewZTnsWAQwCDI8/Rh9OhzU5nDcDDQVmW/zYChapo/DrlLEwvJ87qfj5qoUpuNg\n\tc5GGajtvpaF1TbKb1zuPksxUfJgE4LlcS6qcRZJ9atACSBMrTiLM9yRAUW3p7f3eDx\n\tPQFPvK1zDJYX8Xs2pNGjqYsG3ohLACMd3/fJynFrPRogvfTWaVPNy5w2kB73PwqT/y\n\t7CyJoxbOk3ZXIpeB0nPrH9KqnieR6vLq0zjx8vYEf1ZVsfNOWwSIV+r5eCSyMs9QRY\n\t8vGy/HG/x3ICA==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1688575884;\n\tbh=Jax51XBZV3x53oCYzB4rbKpkSKfP5Uj/pOsodExKpws=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=Nn6tCoCDlUQFPUAbVYlIy/f8qZtyWrpWIrl5XXspecnjqJ8IOIY9tGds7l+qhnsCK\n\t3kqc+dq3BAb9QHXfm6e0dGJWe/NI2HCXc9UUwKfO1SraBoLhFNc1pOVuwdEusiFuUw\n\tfpkjMxVI5R7tKfwAZy8jlERkYVfXfzLW48e2wYKY="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"Nn6tCoCD\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20230630134232.1295-1-naush@raspberrypi.com>","References":"<20230630134232.1295-1-naush@raspberrypi.com>","To":"Naushir Patuck <naush@raspberrypi.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Wed, 05 Jul 2023 17:52:05 +0100","Message-ID":"<168857592512.4136131.16953562293677185735@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH] pipeline: rpi: Account for Bayer\n\tpacking when validating format","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>","From":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":27491,"web_url":"https://patchwork.libcamera.org/comment/27491/","msgid":"<CAHW6GYLXB-UQouheBt9eUejJwoRieV_xXWEUf-YoCYjcwLAPig@mail.gmail.com>","date":"2023-07-06T09:01:36","subject":"Re: [libcamera-devel] [PATCH] pipeline: rpi: Account for Bayer\n\tpacking when validating format","submitter":{"id":42,"url":"https://patchwork.libcamera.org/api/people/42/","name":"David Plowman","email":"david.plowman@raspberrypi.com"},"content":"Hi Naush\n\nThanks for the patch.\n\nOn Wed, 5 Jul 2023 at 17:52, Kieran Bingham via libcamera-devel\n<libcamera-devel@lists.libcamera.org> wrote:\n>\n> Quoting Naushir Patuck via libcamera-devel (2023-06-30 14:42:32)\n> > RPiCameraConfiguration::validate() did not account for user supplied\n> > Bayer packing when validating the RAW stream configuration. Fix this\n> > by seeing what packing (if any) has been specified selecting the output\n> > RAW stream format.\n> >\n> > Fixes: 6c71ee1f1530 (\"pipeline: raspberrypi: Introduce PipelineHandlerBase class\")\n> > Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n>\n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\n\nThanks!\nDavid\n\n>\n> > ---\n> >  src/libcamera/pipeline/rpi/common/pipeline_base.cpp | 4 ++--\n> >  1 file changed, 2 insertions(+), 2 deletions(-)\n> >\n> > diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n> > index df7482920e75..2eb71beaff55 100644\n> > --- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n> > +++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n> > @@ -288,8 +288,8 @@ CameraConfiguration::Status RPiCameraConfiguration::validate()\n> >                 unsigned int bitDepth = info.isValid() ? info.bitsPerPixel : defaultRawBitDepth;\n> >                 V4L2SubdeviceFormat sensorFormat = findBestFormat(data_->sensorFormats_, cfg.size, bitDepth);\n> >\n> > -               rawFormat.size = sensorFormat.size;\n> > -               rawFormat.fourcc = raw.dev->toV4L2PixelFormat(cfg.pixelFormat);\n> > +               BayerFormat::Packing packing = BayerFormat::fromPixelFormat(cfg.pixelFormat).packing;\n> > +               rawFormat = PipelineHandlerBase::toV4L2DeviceFormat(raw.dev, sensorFormat, packing);\n> >\n> >                 int ret = raw.dev->tryFormat(&rawFormat);\n> >                 if (ret)\n> > --\n> > 2.34.1\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 6A719BDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  6 Jul 2023 09:01:51 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C9E1B628BF;\n\tThu,  6 Jul 2023 11:01:50 +0200 (CEST)","from mail-vs1-xe2a.google.com (mail-vs1-xe2a.google.com\n\t[IPv6:2607:f8b0:4864:20::e2a])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id ADC0061E33\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  6 Jul 2023 11:01:48 +0200 (CEST)","by mail-vs1-xe2a.google.com with SMTP id\n\tada2fe7eead31-440b4b0147bso79666137.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 06 Jul 2023 02:01:48 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1688634110;\n\tbh=3gqyz3fJbco0DlzPUnPgVor2dGOgkWkKjF1K8D6E9fo=;\n\th=References:In-Reply-To:Date:To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=Ce4qg+w+ZSxyt7GAoISpg1LTd8e3YNllkXcOb7jYiX3JrYPlaZohxu498AWh9+89C\n\tTMUEEAzrTEz+tVn5NDL4J5x0DMWwmQjVWdTPz/tr+1/6Ub8c0v4AMv+RnLl3mEJdf5\n\tcPx5/ysFGoT3oPYhrI/i5ROaBOOn+mPr/C7h2IZMPzI0z9u/x3GblMyjDcq/tVlLbG\n\tQftLDfNfbbaZ9nTsF+9BJZRWuErCpfrAvMsW2RLi6HW96UyRqMfUQrr07I51Bqs/zK\n\temAGdBi/Oci/Mlu/qAb53y1SctmqU9nNl6oqOmcM7g1Iris5co0vCh1LfQDiHI5zJR\n\tT7NJW+OdNQ2jQ==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1688634107; x=1691226107;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:from:to:cc:subject:date:message-id:reply-to;\n\tbh=s8NhiXLP/g8F6MogWCcS7JYMQ3/xs7YRzM/Xpiavelc=;\n\tb=YVDggFLE5+flvVACSHHjkXoSzKjBkL5immnqYcScQI3QQDt+qlFd+YSIFb4xHilDrh\n\tyHISxXtQZ1YCRpOdaa+m2Db1XfMq8IFM5e/Z5NHv9WNYUSue/viwAQOo50EOScIcPQss\n\tArYL9OHl1wD7CiTpyvpV68GVGkjhCJ2/bVkm4heaj7+hi352lswor/AL/doZMtuIcckY\n\toqQbzjnTwg0nBELo2wjPCu8bUtLc1PBPEanafxRgU1wSRNeDhaO/mYhMXOqsAZ2+SdgC\n\tuTLE3qZoUjnpmXSvTYX5xy/pW3qKyLxBnj7KRHi1F4zgbj+QB/uU662Ycis2hHKASHCi\n\tRlxg=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"YVDggFLE\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20221208; t=1688634107; x=1691226107;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=s8NhiXLP/g8F6MogWCcS7JYMQ3/xs7YRzM/Xpiavelc=;\n\tb=C53wmM0inI3D3A4wn559B0XF+9rRMVKN5MV7vxUpK2YyftPdPPsOL+lPNi/ZYAkSSE\n\tV/7R6JWs9H1/EX8aKISiDaQBHJAX4j1+lbRnHfqp1WNlU2a+3UdIoiNoJd2YQ4KusoJs\n\tSpF07j0L1ZeXYfP3060ylDUREeo9HuEFPRO+qw6ywvZwGPyEO5/MauXxhAQlAsEsRV0i\n\tESXi+UOJbI3AU1LZ9nlKMR0uc+Ge8EKZ4zYmCcpLFWwDWk9WlbKgvfDihSN4MQtE4zqh\n\tReXEVetWJuu3J9XitDPMruiiCZTmXqmwAw/NS/eG2Tjbhs+2fm3gAbesJ1ftvb80oEf0\n\tJRPQ==","X-Gm-Message-State":"ABy/qLbizA+pmD+/ZtCk6d75iLfy5Bx7GGqjtMUmOI16rYgPXJ6aejK8\n\t1FgVbZfASXUrBBJ1vdiYKOB4unxASSd2r/rH6VKiCgvGDLoGJHvN5brGFA==","X-Google-Smtp-Source":"APBJJlHyvXBnsEwvhwSbrCJlkxQIxC/C1a3lUHEWk9cvWFRLS5qjxOFIvYdA72Ez9wd0th8XDmwjrb2mU0ehxUeY45g=","X-Received":"by 2002:a67:fb5a:0:b0:444:d19c:8ff5 with SMTP id\n\te26-20020a67fb5a000000b00444d19c8ff5mr397910vsr.30.1688634107304;\n\tThu, 06 Jul 2023 02:01:47 -0700 (PDT)","MIME-Version":"1.0","References":"<20230630134232.1295-1-naush@raspberrypi.com>\n\t<168857592512.4136131.16953562293677185735@Monstersaurus>","In-Reply-To":"<168857592512.4136131.16953562293677185735@Monstersaurus>","Date":"Thu, 6 Jul 2023 10:01:36 +0100","Message-ID":"<CAHW6GYLXB-UQouheBt9eUejJwoRieV_xXWEUf-YoCYjcwLAPig@mail.gmail.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH] pipeline: rpi: Account for Bayer\n\tpacking when validating format","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>","From":"David Plowman via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"David Plowman <david.plowman@raspberrypi.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]