{"id":14356,"url":"https://patchwork.libcamera.org/api/patches/14356/?format=json","web_url":"https://patchwork.libcamera.org/patch/14356/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20211027092803.3671096-3-naush@raspberrypi.com>","date":"2021-10-27T09:27:56","name":"[libcamera-devel,v3,2/9] libcamera: formats: Add R10 and R12 formats","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"ce82db97a38867fdd4a572152cebfa1bd4af3f58","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/?format=json","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/14356/mbox/","series":[{"id":2660,"url":"https://patchwork.libcamera.org/api/series/2660/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2660","date":"2021-10-27T09:27:54","name":"Raspberry Pi: Conversion to media controller","version":3,"mbox":"https://patchwork.libcamera.org/series/2660/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/14356/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/14356/checks/","tags":{},"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 99749BDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 27 Oct 2021 09:28:14 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3474D6488C;\n\tWed, 27 Oct 2021 11:28:14 +0200 (CEST)","from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com\n\t[IPv6:2a00:1450:4864:20::42c])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5EF2664883\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 27 Oct 2021 11:28:09 +0200 (CEST)","by mail-wr1-x42c.google.com with SMTP id d13so2938854wrf.11\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 27 Oct 2021 02:28:09 -0700 (PDT)","from naush-laptop.pitowers.org\n\t([2a00:1098:3142:14:6561:eb24:3f00:ce98])\n\tby smtp.gmail.com with ESMTPSA id\n\tx2sm2861360wmj.3.2021.10.27.02.28.07\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 27 Oct 2021 02:28:08 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"VHGYUORu\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=ak4WdejPa9HUDndTNCMXCBy684jtdEGrsEPQLBKMh3U=;\n\tb=VHGYUORuH1hZNhfDO0oN6kldDnyhRcytJoHplWB2aK0q0VvVQ/IWX51raIqTHLE9NU\n\tm66mXeUPZ8HR5cNushYhohew4aDDgPZnamgD5XK8FmhN6wh97mE4QShEak1SKkAGyjUD\n\tCuLF5W3e3+RFWMH6KmVJUft4Vpy0mqcvZuH6+SpARNoQTQ5NjnFlwxrxwikeT99gj3wT\n\toC1QIQ2ECKCegcZG4VKuJ1IsPcqHr5EinxvKk2so2lMTKZ46y5JjsESzZoVuonMY5laT\n\tDsi3HiSjXL8mpPeRIDXMFtYhGRTq9d9qqtiUOzGjbhQ9muHXzHldY2SpZRhM+30y0Nj8\n\tG4KA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=ak4WdejPa9HUDndTNCMXCBy684jtdEGrsEPQLBKMh3U=;\n\tb=VofU8tjU+q0ugvxCyZIwB3yfCoatj+QrGSrrc80np51R3b5x3d4JnZBtMesoM8jXNm\n\tKyEzj0n7+wgCwjIKknCKdogLIlK1iVO66MQimipLkHKDzjUytJ0eC7sNGUrqhUme1dXd\n\tBaYVetdl66RCTcTc9EPIMmczMNWGzZmJLkzXlI5VViEOsqJBR0yqaFwbMBEltnhHXgI0\n\tD6Itm27l7TuO9F9Ht7JGroOdf3hQ43OptxHrqS4q1xKQbm8jUVOGOWa4orhMn2I7HhGP\n\tTi9cEESBMKglNGY7Lve1vZD5qB+AVP9Mg7Ll2j4kujyQZ6FxloYNVVdWnz4uqg265RDU\n\tmgXA==","X-Gm-Message-State":"AOAM532iYe0PBeKnwzzWtyJa2RkPi7wyjvJIsBMLg10OfmGPs8GOPhqe\n\tYkzVbuq5NnotEDsegWzd/0gzqgOJk8P6VBqI","X-Google-Smtp-Source":"ABdhPJxkcre0tC4uymIyuj3zpdl/HU0tqAOYbDQaak5iTvLUJu3Y48OjOVEA9I5Y84WRjNuREUx7Lg==","X-Received":"by 2002:adf:d236:: with SMTP id\n\tk22mr39629190wrh.11.1635326888744; \n\tWed, 27 Oct 2021 02:28:08 -0700 (PDT)","From":"Naushir Patuck <naush@raspberrypi.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Wed, 27 Oct 2021 10:27:56 +0100","Message-Id":"<20211027092803.3671096-3-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.25.1","In-Reply-To":"<20211027092803.3671096-1-naush@raspberrypi.com>","References":"<20211027092803.3671096-1-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v3 2/9] libcamera: formats: Add R10 and\n\tR12 formats","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>"},"content":"From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nThese new formats corresponds to the V4L2 V4L2_PIX_FMT_Y10 and\nV4L2_PIX_FMT_Y12 formats, and are the little-endian version of the\nDRM_FORMAT_R10 and DRM_FORMAT_R12 formats.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n---\n src/libcamera/formats.cpp          | 26 ++++++++++++++++++++++++++\n src/libcamera/formats.yaml         |  4 ++++\n src/libcamera/v4l2_pixelformat.cpp |  4 ++++\n 3 files changed, 34 insertions(+)","diff":"diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp\nindex 1c29e1f2c5ab..9f96e9dc4e41 100644\n--- a/src/libcamera/formats.cpp\n+++ b/src/libcamera/formats.cpp\n@@ -484,6 +484,32 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t\t.pixelsPerGroup = 1,\n \t\t.planes = {{ { 1, 1 }, { 0, 0 }, { 0, 0 } }},\n \t} },\n+\t{ formats::R10, {\n+\t\t.name = \"R10\",\n+\t\t.format = formats::R10,\n+\t\t.v4l2Formats = {\n+\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_Y10),\n+\t\t\t.multi = V4L2PixelFormat(),\n+\t\t},\n+\t\t.bitsPerPixel = 10,\n+\t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n+\t\t.packed = false,\n+\t\t.pixelsPerGroup = 1,\n+\t\t.planes = {{ { 2, 1 }, { 0, 0 }, { 0, 0 } }},\n+\t} },\n+\t{ formats::R12, {\n+\t\t.name = \"R12\",\n+\t\t.format = formats::R12,\n+\t\t.v4l2Formats = {\n+\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_Y12),\n+\t\t\t.multi = V4L2PixelFormat(),\n+\t\t},\n+\t\t.bitsPerPixel = 10,\n+\t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n+\t\t.packed = false,\n+\t\t.pixelsPerGroup = 1,\n+\t\t.planes = {{ { 2, 1 }, { 0, 0 }, { 0, 0 } }},\n+\t} },\n \n \t/* Bayer formats. */\n \t{ formats::SBGGR8, {\ndiff --git a/src/libcamera/formats.yaml b/src/libcamera/formats.yaml\nindex 43b5877e08f2..22a8e473a183 100644\n--- a/src/libcamera/formats.yaml\n+++ b/src/libcamera/formats.yaml\n@@ -7,6 +7,10 @@\n formats:\n   - R8:\n       fourcc: DRM_FORMAT_R8\n+  - R10:\n+      fourcc: DRM_FORMAT_R10\n+  - R12:\n+      fourcc: DRM_FORMAT_R12\n \n   - RGB565:\n       fourcc: DRM_FORMAT_RGB565\ndiff --git a/src/libcamera/v4l2_pixelformat.cpp b/src/libcamera/v4l2_pixelformat.cpp\nindex 3649c6002620..0e0da3f0df07 100644\n--- a/src/libcamera/v4l2_pixelformat.cpp\n+++ b/src/libcamera/v4l2_pixelformat.cpp\n@@ -117,6 +117,10 @@ const std::map<V4L2PixelFormat, V4L2PixelFormat::Info> vpf2pf{\n \t/* Greyscale formats. */\n \t{ V4L2PixelFormat(V4L2_PIX_FMT_GREY),\n \t\t{ formats::R8, \"8-bit Greyscale\" } },\n+\t{ V4L2PixelFormat(V4L2_PIX_FMT_Y10),\n+\t\t{ formats::R10, \"10-bit Greyscale\" } },\n+\t{ V4L2PixelFormat(V4L2_PIX_FMT_Y12),\n+\t\t{ formats::R12, \"12-bit Greyscale\" } },\n \n \t/* Bayer formats. */\n \t{ V4L2PixelFormat(V4L2_PIX_FMT_SBGGR8),\n","prefixes":["libcamera-devel","v3","2/9"]}