From patchwork Fri May 10 10:02:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 20036 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 2C9D3BDE6B for ; Fri, 10 May 2024 10:02:21 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3D84863463; Fri, 10 May 2024 12:02:16 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="fsnhebiK"; dkim-atps=neutral Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B65B66343B for ; Fri, 10 May 2024 12:02:12 +0200 (CEST) Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-41b21ed19f5so12891795e9.2 for ; Fri, 10 May 2024 03:02:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1715335332; x=1715940132; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Ij7ZABzn5EvOMlgIX/LnCzlrNPGZ8O383wxIGTpg9Lk=; b=fsnhebiKL9D4O9AyiL3F2/g08mP/l8wZgZlZ8WW7Jgds9Dt32VMvz5xe7PskIyad/y KC/gNd1SdsbrFXlkQeL7tXcEwRwoRm7pgNMs9DACiVxaK1fxEz2aIsy2mrAev78Z9lJP +R3d2CU2aUk4P9PgCgLUVWLihvkz8mSVopSgyRQZ31T54HsLcOuVSC0gpCw+FBaBleQw BBGXDbUBzrSxN/ogqUjU0CHOqs/U9h+UWSUCJozJXC3yuLAMMX4WVdJdwrtyJJas0lEQ 3fDovrpN3G5gQDbjz5PjfV1FXAFfzlR4h+PQUnZN2GA3JxrpJ1ivCalMKhiUnXZLn9eW 7ptg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715335332; x=1715940132; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ij7ZABzn5EvOMlgIX/LnCzlrNPGZ8O383wxIGTpg9Lk=; b=HF4rJ+4FhBp34tn/chbtEzOttnbNBQNvvsUPKXhZecFwdOaRkurSp1RTzk5S420nOy Nz0Kk8c1FNxOK/O0Ium/+TEnXkmJpz1/ww5cPZobJFVK44JirOpyImbjxmPPdcsgGWXw wWHKylMuDCthOwiC8NGx4o1/kelEf1onk3sjEKEqUovLlUo749Tjwl0QgCb7vhbbX8Wj /1EEy2loeBn+qeSIDTPJZcW7iI/TQhCw0DuzjoDOwHCudZpZvIMpu0EZIXh/6nv5hwAi AlBgd4K4A7g9blEbKso2/6XrnFpX5j2Qe4c2g+NDsuUqhhxcL6gAouGhOjTABHOG4P2y GWKg== X-Gm-Message-State: AOJu0Yx238SsaC+M5+wfHSTp8EOxgP7p2Re3CxWNu5n0U1I30QEEIesJ TPdDSSIdqnMlbvlgEO68jzoyqr87Eq/iUW046uKCYpvAyFeRXihIHHhYNjdNP/dLhMQ6w6Co23V 4 X-Google-Smtp-Source: AGHT+IHhi5GuMg+zQl46/vWGZy5COK4ObRxFgAxhmdsEiZYFmZ/rOyUuaBmqgyZqgEkGIO48sTDZNw== X-Received: by 2002:a05:600c:3548:b0:419:f3f9:8ee3 with SMTP id 5b1f17b1804b1-41fea93a80amr18045525e9.5.1715335331898; Fri, 10 May 2024 03:02:11 -0700 (PDT) Received: from localhost.localdomain ([188.39.149.98]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-41fccee9318sm57936385e9.30.2024.05.10.03.02.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 May 2024 03:02:11 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Cc: Naushir Patuck , Jacopo Mondi , Kieran Bingham Subject: [PATCH v3 1/7] include: linux: Add RGB48 formats Date: Fri, 10 May 2024 11:02:02 +0100 Message-Id: <20240510100208.12188-2-naush@raspberrypi.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240510100208.12188-1-naush@raspberrypi.com> References: <20240510100208.12188-1-naush@raspberrypi.com> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Add support for 16-bps (48-bpp) RGB output formats in the uapi headers. These new formats are defined for the RGB and BGR ordering. The corresponding change submitted to the linux-media and DRM mailing lists can be found at: https://lore.kernel.org/linux-media/20240502110503.38412-3-jacopo.mondi@ideasonboard.com/ and https://lore.kernel.org/dri-devel/20240226132544.82817-1-jacopo.mondi@ideasonboard.com/ respectively. Signed-off-by: Naushir Patuck Reviewed-by: Jacopo Mondi Reviewed-by: Kieran Bingham --- include/linux/drm_fourcc.h | 4 ++++ include/linux/videodev2.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/include/linux/drm_fourcc.h b/include/linux/drm_fourcc.h index d6c83d9c49f4..5133a6551a34 100644 --- a/include/linux/drm_fourcc.h +++ b/include/linux/drm_fourcc.h @@ -210,6 +210,10 @@ extern "C" { #define DRM_FORMAT_RGBA1010102 fourcc_code('R', 'A', '3', '0') /* [31:0] R:G:B:A 10:10:10:2 little endian */ #define DRM_FORMAT_BGRA1010102 fourcc_code('B', 'A', '3', '0') /* [31:0] B:G:R:A 10:10:10:2 little endian */ +/* 48 bpp RGB */ +#define DRM_FORMAT_RGB161616 fourcc_code('R', 'G', '4', '8') /* [47:0] R:G:B 16:16:16 little endian */ +#define DRM_FORMAT_BGR161616 fourcc_code('B', 'G', '4', '8') /* [47:0] B:G:R 16:16:16 little endian */ + /* 64 bpp RGB */ #define DRM_FORMAT_XRGB16161616 fourcc_code('X', 'R', '4', '8') /* [63:0] x:R:G:B 16:16:16:16 little endian */ #define DRM_FORMAT_XBGR16161616 fourcc_code('X', 'B', '4', '8') /* [63:0] x:B:G:R 16:16:16:16 little endian */ diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index 7e556911c9e1..4fdd91494041 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h @@ -555,6 +555,8 @@ struct v4l2_pix_format { /* RGB formats (6 or 8 bytes per pixel) */ #define V4L2_PIX_FMT_BGR48_12 v4l2_fourcc('B', '3', '1', '2') /* 48 BGR 12-bit per component */ +#define V4L2_PIX_FMT_BGR48 v4l2_fourcc('B', 'G', 'R', '6') /* 48 BGR 16-bit per component */ +#define V4L2_PIX_FMT_RGB48 v4l2_fourcc('R', 'G', 'B', '6') /* 48 RGB 16-bit per component */ #define V4L2_PIX_FMT_ABGR64_12 v4l2_fourcc('B', '4', '1', '2') /* 64 BGRA 12-bit per component */ /* Grey formats */