{"id":14378,"url":"https://patchwork.libcamera.org/api/1.1/patches/14378/?format=json","web_url":"https://patchwork.libcamera.org/patch/14378/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/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":"<20211028084646.453775-3-naush@raspberrypi.com>","date":"2021-10-28T08:46:38","name":"[libcamera-devel,v4,02/10] libcamera: formats: Add R10 and R12 formats","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"6d814e18bb7dbe85096c33104580c03035f3b018","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/1.1/people/34/?format=json","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/14378/mbox/","series":[{"id":2671,"url":"https://patchwork.libcamera.org/api/1.1/series/2671/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2671","date":"2021-10-28T08:46:36","name":"Raspberry Pi: Conversion to media controller","version":4,"mbox":"https://patchwork.libcamera.org/series/2671/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/14378/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/14378/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 E74A6BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 28 Oct 2021 08:46:59 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 99958600F9;\n\tThu, 28 Oct 2021 10:46:58 +0200 (CEST)","from mail-wm1-x336.google.com (mail-wm1-x336.google.com\n\t[IPv6:2a00:1450:4864:20::336])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B02EC600B7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 28 Oct 2021 10:46:54 +0200 (CEST)","by mail-wm1-x336.google.com with SMTP id\n\ta20-20020a1c7f14000000b003231d13ee3cso8623084wmd.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 28 Oct 2021 01:46:54 -0700 (PDT)","from naush-laptop.pitowers.org\n\t([2a00:1098:3142:14:b894:feb0:b828:13b])\n\tby smtp.gmail.com with ESMTPSA id\n\tz2sm1955281wmk.19.2021.10.28.01.46.53\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 28 Oct 2021 01:46:53 -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=\"GzskVOnR\"; 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=RG3zcG/cyCZQubLgG1F5CIX3ibyjzBGfN4/E1yy8ruU=;\n\tb=GzskVOnROpR2033pDx5/vpT4XDF2F14uiM2vPtup7IovgmlnUtZFYXJVlshB1TgjPK\n\ttFo5Y2F+p83/yo9j2LK8OFezJrs8wUOyv2qVlo50cokDJ1eA/llH5pmNlZd0dj7O7AB2\n\t7YYNUTf3vZyc3CCONq81wa2aGZnzQ+njh58wal6xRLtzriNinMF6g5J4zANkJEtuZ5RH\n\tcpGMC2qeoiXhhWv8yqUxoecYazWrW9jRFxKaUDaRT/P6IwITDmcEokGbtHO+nem9dzli\n\t8wLlfT+Dnrp5vxBe8HIN8ZX1ft/fFoDdp7lptmmJjswxGTDyva1ZDLI1Xgynsel/YKWJ\n\tiWow==","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=RG3zcG/cyCZQubLgG1F5CIX3ibyjzBGfN4/E1yy8ruU=;\n\tb=aE80l1/NGXN/WAjlsJWehcL2dnReqkhwPzBBdmZCynhApXSsfM+O+TevOZ1g8aMeI3\n\t9u4PrlySDPcXLEdxOPjlhVlRv1N82FaatE1xfF4NioH4BkpAVhoJeUZhACIPchX/Fhf9\n\t4spdHSw7owDIwRTHUtmkKfb2Br25B8h89ACjRucuPaYOMlgaUsa0WFCE95etqkhDmIjP\n\t/VUoKNjkUUg73ZZIOJKbV2v+PYoaDhe6cE5/rmqU0uTc6Z8TF88f7ssuH1+kAvPhOV81\n\t7zHtN/z63N7vX3jMPrFGUIprW6+oPbMt0xyLjza1/MDhXL9cRuz3D1+3DPsyEdHnCv63\n\tO5DA==","X-Gm-Message-State":"AOAM533Q2M+T74PpH693u6iN8Rk0UpBfYcRhuujvnEcTP3uJsT/4eFPZ\n\tEFMa2OBZNkhm0w0uXtVg1XQb6HHlyESMNTn2","X-Google-Smtp-Source":"ABdhPJzijmtEskSjN7q4DsvdcreD6a8LS4FAxg0yy/AdixbSih2QDNqkF1RU685O7//wAR+FEs5UyQ==","X-Received":"by 2002:a7b:c049:: with SMTP id u9mr3088638wmc.102.1635410814197;\n\tThu, 28 Oct 2021 01:46:54 -0700 (PDT)","From":"Naushir Patuck <naush@raspberrypi.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Thu, 28 Oct 2021 09:46:38 +0100","Message-Id":"<20211028084646.453775-3-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.25.1","In-Reply-To":"<20211028084646.453775-1-naush@raspberrypi.com>","References":"<20211028084646.453775-1-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v4 02/10] 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>\nReviewed-by: Naushir Patuck <naush@raspberrypi.com>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.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..d4781dfb3874 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 = 12,\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","v4","02/10"]}