{"id":14372,"url":"https://patchwork.libcamera.org/api/1.1/patches/14372/?format=json","web_url":"https://patchwork.libcamera.org/patch/14372/","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":"<20211027233140.12268-1-laurent.pinchart@ideasonboard.com>","date":"2021-10-27T23:31:40","name":"[libcamera-devel] drm: Add R10 and R12 FourCC","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"e918327866417b1f9e4fe5e3ec961613c584e950","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/1.1/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/14372/mbox/","series":[{"id":2669,"url":"https://patchwork.libcamera.org/api/1.1/series/2669/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2669","date":"2021-10-27T23:31:40","name":"[libcamera-devel] drm: Add R10 and R12 FourCC","version":1,"mbox":"https://patchwork.libcamera.org/series/2669/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/14372/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/14372/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 E1B1DBDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 27 Oct 2021 23:35:32 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 40BAD60009;\n\tThu, 28 Oct 2021 01:35:32 +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 809BC60006\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 28 Oct 2021 01:32:08 +0200 (CEST)","from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 4FAB0276;\n\tThu, 28 Oct 2021 01:32:07 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"XAbmLUcu\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1635377527;\n\tbh=a9jy9hdTyXufD2ZitJq7wGdYp6+SpY1HvNoATvCVuSk=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=XAbmLUcuwRGIN2ST3diQIVuBujY5cNyk2C7k9uUiyx0HmvKnnVgVWZIa09oQRuLqV\n\tl1Ntq1zksOolCMXFGADtr5degTBabcmrlpGvo7XElC+seuTH5Nhbowe/WtlsT25n9g\n\t1OWvBXKv43kFZEaoOx4dM5vh0FUV97mbbftaXE8E=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"dri-devel@lists.freedesktop.org","Date":"Thu, 28 Oct 2021 02:31:40 +0300","Message-Id":"<20211027233140.12268-1-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.32.0","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","X-Mailman-Approved-At":"Thu, 28 Oct 2021 01:35:31 +0200","Subject":"[libcamera-devel] [PATCH] drm: Add R10 and R12 FourCC","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":"David Airlie <airlied@linux.ie>,\n\tMaarten Lankhorst <maarten.lankhorst@linux.intel.com>,\n\tThomas Zimmermann <tzimmermann@suse.de>,\n\tDaniel Vetter <daniel@ffwll.ch>, Maxime Ripard <mripard@kernel.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Add FourCCs for 10- and 12-bit red formats with padding to 16 bits.\nThey correspond to the V4L2 10- and 12-bit greyscale (V4L2_PIX_FMT_Y10\nand V4L2_PIX_FMT_Y12) formats, as well as the Bayer formats with the\nsame bit depth (V4L2_PIX_FMT_SBGGR{10,12} and all other Bayer pattern\npermutations).\n\nThese formats are not used by any kernel driver at this point, but need\nto be exposed to applications by libcamera, which uses DRM FourCCs for\npixel formats.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n drivers/gpu/drm/drm_fourcc.c  | 2 ++\n include/uapi/drm/drm_fourcc.h | 6 ++++++\n 2 files changed, 8 insertions(+)\n\n\nbase-commit: 367fe8dc299c968eabdae890536d55d80ea55e01","diff":"diff --git a/drivers/gpu/drm/drm_fourcc.c b/drivers/gpu/drm/drm_fourcc.c\nindex 783844bfecc1..25837b1d6639 100644\n--- a/drivers/gpu/drm/drm_fourcc.c\n+++ b/drivers/gpu/drm/drm_fourcc.c\n@@ -134,6 +134,8 @@ const struct drm_format_info *__drm_format_info(u32 format)\n \tstatic const struct drm_format_info formats[] = {\n \t\t{ .format = DRM_FORMAT_C8,\t\t.depth = 8,  .num_planes = 1, .cpp = { 1, 0, 0 }, .hsub = 1, .vsub = 1 },\n \t\t{ .format = DRM_FORMAT_R8,\t\t.depth = 8,  .num_planes = 1, .cpp = { 1, 0, 0 }, .hsub = 1, .vsub = 1 },\n+\t\t{ .format = DRM_FORMAT_R10,\t\t.depth = 10, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1 },\n+\t\t{ .format = DRM_FORMAT_R12,\t\t.depth = 12, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1 },\n \t\t{ .format = DRM_FORMAT_RGB332,\t\t.depth = 8,  .num_planes = 1, .cpp = { 1, 0, 0 }, .hsub = 1, .vsub = 1 },\n \t\t{ .format = DRM_FORMAT_BGR233,\t\t.depth = 8,  .num_planes = 1, .cpp = { 1, 0, 0 }, .hsub = 1, .vsub = 1 },\n \t\t{ .format = DRM_FORMAT_XRGB4444,\t.depth = 0,  .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1 },\ndiff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h\nindex 45a914850be0..7f652c96845b 100644\n--- a/include/uapi/drm/drm_fourcc.h\n+++ b/include/uapi/drm/drm_fourcc.h\n@@ -104,6 +104,12 @@ extern \"C\" {\n /* 8 bpp Red */\n #define DRM_FORMAT_R8\t\tfourcc_code('R', '8', ' ', ' ') /* [7:0] R */\n \n+/* 10 bpp Red */\n+#define DRM_FORMAT_R10\t\tfourcc_code('R', '1', '0', ' ') /* [15:0] x:R 6:10 little endian */\n+\n+/* 12 bpp Red */\n+#define DRM_FORMAT_R12\t\tfourcc_code('R', '1', '2', ' ') /* [15:0] x:R 4:12 little endian */\n+\n /* 16 bpp Red */\n #define DRM_FORMAT_R16\t\tfourcc_code('R', '1', '6', ' ') /* [15:0] R little endian */\n \n","prefixes":["libcamera-devel"]}