[{"id":20602,"web_url":"https://patchwork.libcamera.org/comment/20602/","msgid":"<163542330236.2498920.5479481647399842897@Monstersaurus>","date":"2021-10-28T12:15:02","subject":"Re: [libcamera-devel] [PATCH v4 03/10] libcamera: formats: Add\n\tR10_CSI2P format","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Naushir Patuck (2021-10-28 09:46:39)\n> This new formats corresponds to the V4L2 V4L2_PIX_FMT_Y10P format, and is a\n> CSI2-packed version of the DRM_FORMAT_R10 format.\n> \n\nRelating to your question in the cover letter, I think it's better to\nkeep this separate.\n\n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> ---\n>  src/libcamera/formats.cpp  | 13 +++++++++++++\n>  src/libcamera/formats.yaml |  4 ++++\n>  2 files changed, 17 insertions(+)\n> \n> diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp\n> index d4781dfb3874..9b6ccdca0663 100644\n> --- a/src/libcamera/formats.cpp\n> +++ b/src/libcamera/formats.cpp\n> @@ -510,6 +510,19 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>                 .pixelsPerGroup = 1,\n>                 .planes = {{ { 2, 1 }, { 0, 0 }, { 0, 0 } }},\n>         } },\n> +       { formats::R10_CSI2P, {\n> +               .name = \"R10_CSI2P\",\n> +               .format = formats::R10,\n> +               .v4l2Formats = {\n> +                       .single = V4L2PixelFormat(V4L2_PIX_FMT_Y10P),\n> +                       .multi = V4L2PixelFormat(),\n> +               },\n> +               .bitsPerPixel = 10,\n> +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n> +               .packed = true,\n> +               .pixelsPerGroup = 1,\n\nIs this correct for a packed format?\n\nShouldn't this be pixelsPerGroup = 4; bytesPerGroup = 5; ?\n\nhttps://01.org/linuxgraphics/gfx-docs/drm/media/uapi/v4l/pixfmt-y10p.html\nstates:\n\n\"\"\"\nThis is a packed grey-scale image format with a depth of 10 bits per\npixel. Every four consecutive pixels are packed into 5 bytes.  Each of\nthe first 4 bytes contain the 8 high order bits of the pixels, and the\n5th byte contains the 2 least significants bits of each pixel, in the\nsame order.\n\"\"\"\n\n\n\n> +               .planes = {{ { 2, 1 }, { 0, 0 }, { 0, 0 } }},\n\nAnd therefore I'd expect this to be { 5, 1 }, instead of { 2, 1 } ...\n\n> +       } },\n>  \n>         /* Bayer formats. */\n>         { formats::SBGGR8, {\n> diff --git a/src/libcamera/formats.yaml b/src/libcamera/formats.yaml\n> index 22a8e473a183..1f3f043302c3 100644\n> --- a/src/libcamera/formats.yaml\n> +++ b/src/libcamera/formats.yaml\n> @@ -109,6 +109,10 @@ formats:\n>    - SBGGR16:\n>        fourcc: DRM_FORMAT_SBGGR16\n>  \n> +  - R10_CSI2P:\n> +      fourcc: DRM_FORMAT_R10\n> +      mod: MIPI_FORMAT_MOD_CSI2_PACKED\n> +\n>    - SRGGB10_CSI2P:\n>        fourcc: DRM_FORMAT_SRGGB10\n>        mod: MIPI_FORMAT_MOD_CSI2_PACKED\n> -- \n> 2.25.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 D659BBDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 28 Oct 2021 12:15:07 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DA24E600BA;\n\tThu, 28 Oct 2021 14:15:06 +0200 (CEST)","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 F1D7A600B5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 28 Oct 2021 14:15:04 +0200 (CEST)","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 943C4513;\n\tThu, 28 Oct 2021 14:15:04 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"Brnn9bde\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1635423304;\n\tbh=+vZrZp0vD+cv3dbXrU7vo3rWZRabra/iPd1x26zRn6A=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=Brnn9bdeLpz4al1JX5vWuhurSL/GoxSmg1FjHVmfNduoEFyzGbyjrnT2S9i93jBA5\n\tkeZZO0q2MlmCMLwRyzXFFoh48GzW85jf1BHl/FusR2aC/G/ssCawLSmHA6kmnWwLYg\n\tOmSqpAorZ4j4Btsf6h8nigTLuqZm5dXlKNkPepNM=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20211028084646.453775-4-naush@raspberrypi.com>","References":"<20211028084646.453775-1-naush@raspberrypi.com>\n\t<20211028084646.453775-4-naush@raspberrypi.com>","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"Naushir Patuck <naush@raspberrypi.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Thu, 28 Oct 2021 13:15:02 +0100","Message-ID":"<163542330236.2498920.5479481647399842897@Monstersaurus>","User-Agent":"alot/0.9.1","Subject":"Re: [libcamera-devel] [PATCH v4 03/10] libcamera: formats: Add\n\tR10_CSI2P 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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":20603,"web_url":"https://patchwork.libcamera.org/comment/20603/","msgid":"<CAEmqJPrk6e2vmuTPLQLDczybwOGuaxWf3GM8YGjcOsg+3vuc7Q@mail.gmail.com>","date":"2021-10-28T12:18:38","subject":"Re: [libcamera-devel] [PATCH v4 03/10] libcamera: formats: Add\n\tR10_CSI2P format","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"content":"Hi Kieran,\n\nOn Thu, 28 Oct 2021 at 13:15, Kieran Bingham <\nkieran.bingham@ideasonboard.com> wrote:\n\n> Quoting Naushir Patuck (2021-10-28 09:46:39)\n> > This new formats corresponds to the V4L2 V4L2_PIX_FMT_Y10P format, and\n> is a\n> > CSI2-packed version of the DRM_FORMAT_R10 format.\n> >\n>\n> Relating to your question in the cover letter, I think it's better to\n> keep this separate.\n>\n> > Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> > ---\n> >  src/libcamera/formats.cpp  | 13 +++++++++++++\n> >  src/libcamera/formats.yaml |  4 ++++\n> >  2 files changed, 17 insertions(+)\n> >\n> > diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp\n> > index d4781dfb3874..9b6ccdca0663 100644\n> > --- a/src/libcamera/formats.cpp\n> > +++ b/src/libcamera/formats.cpp\n> > @@ -510,6 +510,19 @@ const std::map<PixelFormat, PixelFormatInfo>\n> pixelFormatInfo{\n> >                 .pixelsPerGroup = 1,\n> >                 .planes = {{ { 2, 1 }, { 0, 0 }, { 0, 0 } }},\n> >         } },\n> > +       { formats::R10_CSI2P, {\n> > +               .name = \"R10_CSI2P\",\n> > +               .format = formats::R10,\n> > +               .v4l2Formats = {\n> > +                       .single = V4L2PixelFormat(V4L2_PIX_FMT_Y10P),\n> > +                       .multi = V4L2PixelFormat(),\n> > +               },\n> > +               .bitsPerPixel = 10,\n> > +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n> > +               .packed = true,\n> > +               .pixelsPerGroup = 1,\n>\n> Is this correct for a packed format?\n>\n> Shouldn't this be pixelsPerGroup = 4; bytesPerGroup = 5; ?\n>\n> https://01.org/linuxgraphics/gfx-docs/drm/media/uapi/v4l/pixfmt-y10p.html\n> states:\n>\n> \"\"\"\n> This is a packed grey-scale image format with a depth of 10 bits per\n> pixel. Every four consecutive pixels are packed into 5 bytes.  Each of\n> the first 4 bytes contain the 8 high order bits of the pixels, and the\n> 5th byte contains the 2 least significants bits of each pixel, in the\n> same order.\n> \"\"\"\n>\n>\n>\n> > +               .planes = {{ { 2, 1 }, { 0, 0 }, { 0, 0 } }},\n>\n> And therefore I'd expect this to be { 5, 1 }, instead of { 2, 1 } ...\n>\n\nUgh, good catch!  That was a copy-paste error on my part.  I meant to update\nthe planes but forgot :-(\n\nNaush\n\n\n\n>\n> > +       } },\n> >\n> >         /* Bayer formats. */\n> >         { formats::SBGGR8, {\n> > diff --git a/src/libcamera/formats.yaml b/src/libcamera/formats.yaml\n> > index 22a8e473a183..1f3f043302c3 100644\n> > --- a/src/libcamera/formats.yaml\n> > +++ b/src/libcamera/formats.yaml\n> > @@ -109,6 +109,10 @@ formats:\n> >    - SBGGR16:\n> >        fourcc: DRM_FORMAT_SBGGR16\n> >\n> > +  - R10_CSI2P:\n> > +      fourcc: DRM_FORMAT_R10\n> > +      mod: MIPI_FORMAT_MOD_CSI2_PACKED\n> > +\n> >    - SRGGB10_CSI2P:\n> >        fourcc: DRM_FORMAT_SRGGB10\n> >        mod: MIPI_FORMAT_MOD_CSI2_PACKED\n> > --\n> > 2.25.1\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 DCEFDBF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 28 Oct 2021 12:18:57 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2A473600BA;\n\tThu, 28 Oct 2021 14:18:57 +0200 (CEST)","from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com\n\t[IPv6:2a00:1450:4864:20::22f])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9DD11600B5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 28 Oct 2021 14:18:55 +0200 (CEST)","by mail-lj1-x22f.google.com with SMTP id d23so8985089ljj.10\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 28 Oct 2021 05:18:55 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"FuBgQWyb\"; 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=Gym4cTdqL0IURdYPVoTXwJTJ5Rwm6No5c/C88CHRtrk=;\n\tb=FuBgQWybbWZTaiFCkleih15iBNtfYsNDRBdDgvsYjX6kCl6QsG/SP2gENXWh8tk0vN\n\tDtOKI/Rd5KOuKGvSR80bLg9snLcsquXppZ5kkEtBmoFvsmkqm7S5XWFiDct3LcNjEP0+\n\tUjwn3wBhUqyoZuaet5Z3I4ysKqvleGGcV5MW6tMoQMw8VZmsfCYlTyIyM66WfzI/G4ZC\n\tZ3tYyjwhVrDyU/mWRCNnOSEwRutbwm6tYkD8TJdIeVkD1YyCz1ry21vSC+FMk8xn0zwP\n\tuDBJQBN3DSQ1xks99hMUjbC7A7Xo7oV74RnPr6vFWcaclpq090pPJk2hi5oUSCjiJ+B4\n\tj9mQ==","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=Gym4cTdqL0IURdYPVoTXwJTJ5Rwm6No5c/C88CHRtrk=;\n\tb=ax3Yvva7d5tQ+0fCaBAoZiNR8K4ILmq8gTDhxX7yin/K2OQ/0aVAI6m321hmW0X/RJ\n\tNT98RYH9JvfdYwvSSjrlEV1TEmP7OACXR9fx6Sis7F5qFIDy2A3qeVFUc5E3IWnDesZ6\n\tCmLtcfdMITwNBGnPaHWll83F6WFqFxG7cLQpjcoGNjh8d1Uon3myfNfmoong8SdAM+dM\n\tsFYPooqhX1IGaMk/2De/5vVmumAlNn/tlEub6f85FgZCi1ncXZ17R1mP9Zmjg+l1YtBO\n\tUgkovJbH3CU3OlKdWztqOJ6jMWWBa1Wyns9grDDyFAGsYbueh1m3nWrVs9i6jhm5dBRv\n\ty2Qw==","X-Gm-Message-State":"AOAM530fJ2Meg4K/ZQcVc6lOHsdu7hPvocLgznsDOyXdYEBbexODkx8t\n\tdwnN4qGsSotdQci/s9s7vgqUi90uCDIlVk8B9DP5Qh06hvBrnw==","X-Google-Smtp-Source":"ABdhPJzqUIgPVhvyI2xFg/dsVCjBQL3ZaQI6eQh0mckCqvzo4LcQ+rilzo6PSgyfnDWWB929Tqsm4ZpVrE1+uxuX3qg=","X-Received":"by 2002:a2e:a78e:: with SMTP id\n\tc14mr4447023ljf.208.1635423534819; \n\tThu, 28 Oct 2021 05:18:54 -0700 (PDT)","MIME-Version":"1.0","References":"<20211028084646.453775-1-naush@raspberrypi.com>\n\t<20211028084646.453775-4-naush@raspberrypi.com>\n\t<163542330236.2498920.5479481647399842897@Monstersaurus>","In-Reply-To":"<163542330236.2498920.5479481647399842897@Monstersaurus>","From":"Naushir Patuck <naush@raspberrypi.com>","Date":"Thu, 28 Oct 2021 13:18:38 +0100","Message-ID":"<CAEmqJPrk6e2vmuTPLQLDczybwOGuaxWf3GM8YGjcOsg+3vuc7Q@mail.gmail.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Content-Type":"multipart/alternative; boundary=\"000000000000d9c21a05cf68b6da\"","Subject":"Re: [libcamera-devel] [PATCH v4 03/10] libcamera: formats: Add\n\tR10_CSI2P 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>","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>"}}]