[{"id":23306,"web_url":"https://patchwork.libcamera.org/comment/23306/","msgid":"<20220603145513.76ofrg757ozk5skk@uno.localdomain>","date":"2022-06-03T14:55:13","subject":"Re: [libcamera-devel] [PATCH v1.1 1/5] libcamera: formats: Add\n\tYVU422 pixel format","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Laurent,\n\nOn Fri, May 06, 2022 at 06:32:07PM +0300, Laurent Pinchart wrote:\n> The YVU422 pixel format is defined in both DRM and V4L2. libcamera\n> already supports YUV422, add support for the opposite chroma order.\n>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n> Changes since v1:\n>\n> - Fix YVU422M in vpf2pf map\n\nLooks good now\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\nThanks\n   j\n\n> ---\n>  src/libcamera/formats.cpp          | 13 +++++++++++++\n>  src/libcamera/formats.yaml         |  2 ++\n>  src/libcamera/v4l2_pixelformat.cpp |  2 ++\n>  3 files changed, 17 insertions(+)\n>\n> diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp\n> index afcaabc519f7..c5cca37b02c2 100644\n> --- a/src/libcamera/formats.cpp\n> +++ b/src/libcamera/formats.cpp\n> @@ -469,6 +469,19 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t\t.pixelsPerGroup = 2,\n>  \t\t.planes = {{ { 2, 1 }, { 1, 1 }, { 1, 1 } }},\n>  \t} },\n> +\t{ formats::YVU422, {\n> +\t\t.name = \"YVU422\",\n> +\t\t.format = formats::YVU422,\n> +\t\t.v4l2Formats = {\n> +\t\t\t.single = V4L2PixelFormat(),\n> +\t\t\t.multi = V4L2PixelFormat(V4L2_PIX_FMT_YVU422M),\n> +\t\t},\n> +\t\t.bitsPerPixel = 16,\n> +\t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n> +\t\t.packed = false,\n> +\t\t.pixelsPerGroup = 2,\n> +\t\t.planes = {{ { 2, 1 }, { 1, 1 }, { 1, 1 } }},\n> +\t} },\n>\n>  \t/* Greyscale formats. */\n>  \t{ formats::R8, {\n> diff --git a/src/libcamera/formats.yaml b/src/libcamera/formats.yaml\n> index 1f3f043302c3..0b527dbefe32 100644\n> --- a/src/libcamera/formats.yaml\n> +++ b/src/libcamera/formats.yaml\n> @@ -69,6 +69,8 @@ formats:\n>        fourcc: DRM_FORMAT_YVU420\n>    - YUV422:\n>        fourcc: DRM_FORMAT_YUV422\n> +  - YVU422:\n> +      fourcc: DRM_FORMAT_YVU422\n>\n>    - MJPEG:\n>        fourcc: DRM_FORMAT_MJPEG\n> diff --git a/src/libcamera/v4l2_pixelformat.cpp b/src/libcamera/v4l2_pixelformat.cpp\n> index 1dd93baa7a64..40522bf21f6b 100644\n> --- a/src/libcamera/v4l2_pixelformat.cpp\n> +++ b/src/libcamera/v4l2_pixelformat.cpp\n> @@ -113,6 +113,8 @@ const std::map<V4L2PixelFormat, V4L2PixelFormat::Info> vpf2pf{\n>  \t\t{ formats::YUV422, \"Planar YUV 4:2:2\" } },\n>  \t{ V4L2PixelFormat(V4L2_PIX_FMT_YUV422M),\n>  \t\t{ formats::YUV422, \"Planar YUV 4:2:2 (N-C)\" } },\n> +\t{ V4L2PixelFormat(V4L2_PIX_FMT_YVU422M),\n> +\t\t{ formats::YVU422, \"Planar YVU 4:2:2 (N-C)\" } },\n>\n>  \t/* Greyscale formats. */\n>  \t{ V4L2PixelFormat(V4L2_PIX_FMT_GREY),\n>\n> base-commit: 1e4c4ad5f78ad7abc73854646f6e9902dc3c1925\n> --\n> Regards,\n>\n> Laurent Pinchart\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 35AA5BD161\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  3 Jun 2022 14:55:18 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4965C65633;\n\tFri,  3 Jun 2022 16:55:17 +0200 (CEST)","from relay12.mail.gandi.net (relay12.mail.gandi.net\n\t[217.70.178.232])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6EE6560105\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  3 Jun 2022 16:55:16 +0200 (CEST)","(Authenticated sender: jacopo@jmondi.org)\n\tby mail.gandi.net (Postfix) with ESMTPSA id E261920000C;\n\tFri,  3 Jun 2022 14:55:15 +0000 (UTC)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1654268117;\n\tbh=HAXj3R4OvuI9LHaa48dpgVvGyZ0MdErmH/f5tpQHY8g=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=RZCtxRA1I4k8LsfCAmNgrBzWbr6myr2g7+/b2ky4LjWwHJbUPtpS9hQbsPXhqmTEP\n\txiretbYvixUx+aPXva17SLAKm2OTgGMzI4xP8RIeTuDUnZHUv9xV8bTiw6DBeX/y2N\n\tn4H9h+gaAE+a7lQfhI4vP7ufApIiCuQzaCtNha1BGSfy99Wr1TxKvtuhNPBd5iYDHp\n\t2gvr3Yo1hzrTF2PR65M21ljYoztp0OvVaF73BAC7iIExJOsl+4TUQKt5l21pBCuPAW\n\tCG+r/ZyY+LcmTT8VNm+23AOl6j71Z9fFlDVIbMjjlBxdI4am0/QnfaPfEzGX4nhOM+\n\t+Kc+MUhtEzmeA==","Date":"Fri, 3 Jun 2022 16:55:13 +0200","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Message-ID":"<20220603145513.76ofrg757ozk5skk@uno.localdomain>","References":"<20220506120424.qjhfminkgwefcmc2@uno.localdomain>\n\t<20220506153207.19055-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20220506153207.19055-1-laurent.pinchart@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v1.1 1/5] libcamera: formats: Add\n\tYVU422 pixel 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":"Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":23307,"web_url":"https://patchwork.libcamera.org/comment/23307/","msgid":"<a179610e-313a-11b2-5a53-3ff75f66b6ae@ideasonboard.com>","date":"2022-06-03T14:55:35","subject":"Re: [libcamera-devel] [PATCH v1.1 1/5] libcamera: formats: Add\n\tYVU422 pixel format","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"content":"Hi Laurent\n\nOn 5/6/22 17:32, Laurent Pinchart via libcamera-devel wrote:\n> The YVU422 pixel format is defined in both DRM and V4L2. libcamera\n> already supports YUV422, add support for the opposite chroma order.\n>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n\nLooks good!\n\nReviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n\n> ---\n> Changes since v1:\n>\n> - Fix YVU422M in vpf2pf map\n> ---\n>   src/libcamera/formats.cpp          | 13 +++++++++++++\n>   src/libcamera/formats.yaml         |  2 ++\n>   src/libcamera/v4l2_pixelformat.cpp |  2 ++\n>   3 files changed, 17 insertions(+)\n>\n> diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp\n> index afcaabc519f7..c5cca37b02c2 100644\n> --- a/src/libcamera/formats.cpp\n> +++ b/src/libcamera/formats.cpp\n> @@ -469,6 +469,19 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>   \t\t.pixelsPerGroup = 2,\n>   \t\t.planes = {{ { 2, 1 }, { 1, 1 }, { 1, 1 } }},\n>   \t} },\n> +\t{ formats::YVU422, {\n> +\t\t.name = \"YVU422\",\n> +\t\t.format = formats::YVU422,\n> +\t\t.v4l2Formats = {\n> +\t\t\t.single = V4L2PixelFormat(),\n> +\t\t\t.multi = V4L2PixelFormat(V4L2_PIX_FMT_YVU422M),\n> +\t\t},\n> +\t\t.bitsPerPixel = 16,\n> +\t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n> +\t\t.packed = false,\n> +\t\t.pixelsPerGroup = 2,\n> +\t\t.planes = {{ { 2, 1 }, { 1, 1 }, { 1, 1 } }},\n> +\t} },\n>   \n>   \t/* Greyscale formats. */\n>   \t{ formats::R8, {\n> diff --git a/src/libcamera/formats.yaml b/src/libcamera/formats.yaml\n> index 1f3f043302c3..0b527dbefe32 100644\n> --- a/src/libcamera/formats.yaml\n> +++ b/src/libcamera/formats.yaml\n> @@ -69,6 +69,8 @@ formats:\n>         fourcc: DRM_FORMAT_YVU420\n>     - YUV422:\n>         fourcc: DRM_FORMAT_YUV422\n> +  - YVU422:\n> +      fourcc: DRM_FORMAT_YVU422\n>   \n>     - MJPEG:\n>         fourcc: DRM_FORMAT_MJPEG\n> diff --git a/src/libcamera/v4l2_pixelformat.cpp b/src/libcamera/v4l2_pixelformat.cpp\n> index 1dd93baa7a64..40522bf21f6b 100644\n> --- a/src/libcamera/v4l2_pixelformat.cpp\n> +++ b/src/libcamera/v4l2_pixelformat.cpp\n> @@ -113,6 +113,8 @@ const std::map<V4L2PixelFormat, V4L2PixelFormat::Info> vpf2pf{\n>   \t\t{ formats::YUV422, \"Planar YUV 4:2:2\" } },\n>   \t{ V4L2PixelFormat(V4L2_PIX_FMT_YUV422M),\n>   \t\t{ formats::YUV422, \"Planar YUV 4:2:2 (N-C)\" } },\n> +\t{ V4L2PixelFormat(V4L2_PIX_FMT_YVU422M),\n> +\t\t{ formats::YVU422, \"Planar YVU 4:2:2 (N-C)\" } },\n>   \n>   \t/* Greyscale formats. */\n>   \t{ V4L2PixelFormat(V4L2_PIX_FMT_GREY),\n>\n> base-commit: 1e4c4ad5f78ad7abc73854646f6e9902dc3c1925","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 3DA2BBD161\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  3 Jun 2022 14:55:41 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DF02365634;\n\tFri,  3 Jun 2022 16:55:40 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0153660105\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  3 Jun 2022 16:55:39 +0200 (CEST)","from [192.168.0.71] (static-127-186-62-95.ipcom.comunitel.net\n\t[95.62.186.127])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 82B5510DD;\n\tFri,  3 Jun 2022 16:55:38 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1654268140;\n\tbh=D7SupXhbTe6HRs5i/rF6SUhXjJThfA9ME/Z2LG8ykT8=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=xVEXibk/2lEIN1BSUi/libtEOB/m6GuYTe5Xg6D0JM/QYFEB9aeWy2GpyRmjF9sH+\n\tJHKELt4eEObgUNHKop9Fx7luZJkSLJHnMRqOW1sPDszHaITdtW2jv401UkZqQ11NNl\n\tegbe5yFkocRYjQBTGKmhN6QL/5fsh3mALp1Le5JXZ5LUTZgly4slAyq3GLH4ItMLO8\n\tw/OPGkOxN7JPYD9SNKayf7nE1qiDxWMwy1Oh68OdfJ11OXwsQOPIn0xlA+f978tjDd\n\tKlbArUb75b8tmLTwg1YBMluP6xLQADjH4LS2MAlxk4VgaKbheKNZhYkusS7XXrvW0R\n\tddHnMok7hEOwA==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1654268138;\n\tbh=D7SupXhbTe6HRs5i/rF6SUhXjJThfA9ME/Z2LG8ykT8=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=wDBnGYovmWQAgzKN0JnZ7YyMNQGQGoQ2pXJ+h51dXmR4Sqn//fRwwq4sSJdl2tnjJ\n\tQNe1lkb6PDc8uW2+gpQ5w+91jdKcrGHRqHaIfLtqKRHheN3LBlfNjdt+2xrXqHGtW5\n\tGy2EiR6rqXSTSkDaxHpNdx5onhTmm1LTittjti2k="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"wDBnGYov\"; dkim-atps=neutral","Message-ID":"<a179610e-313a-11b2-5a53-3ff75f66b6ae@ideasonboard.com>","Date":"Fri, 3 Jun 2022 16:55:35 +0200","MIME-Version":"1.0","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101\n\tThunderbird/91.4.1","Content-Language":"en-US","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20220506120424.qjhfminkgwefcmc2@uno.localdomain>\n\t<20220506153207.19055-1-laurent.pinchart@ideasonboard.com>","In-Reply-To":"<20220506153207.19055-1-laurent.pinchart@ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH v1.1 1/5] libcamera: formats: Add\n\tYVU422 pixel 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":"Umang Jain via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Umang Jain <umang.jain@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]