From nobody Mon Feb 9 22:03:41 2026 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 26647332EAD for ; Wed, 28 Jan 2026 17:26:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769621170; cv=none; b=JqmUWT4iQtzSOMyHTavYaBTexGE01Dx+VFCPtnNyrUnh1hLBl2hLtqDDFI4KEUdR81szQCqopaS9JJBiNHlQNfhrguFJ8q5dS3WxnwMGdsNgFtm6les8ahUbh3WNFo7WLG3dLb5u2QD0jR6SEASACPC68+oejkiInb2GapARjXQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769621170; c=relaxed/simple; bh=CPBrLo43D5oobjFdNES++lKWPeHTSF5yifInInVgzyQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=n923gDF3OfhQhQUvHeV/Ko8NCUXm5NQbsPHtlQsB0zmn7PlsNHBJXXrdpEHiTx6dfaMrAIjFZX3XJ34sHtmcS2/XdaNgQMG1t6gtT+TRgZxFobYyDgn285P9aVus9CA0iCIf/B+47+Nt16MYJ+9ZyMKaoqDwTV2nG+UlXEGJK88= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=Hv1xNPW1; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Hv1xNPW1" Received: from [127.0.1.1] (91-158-153-178.elisa-laajakaista.fi [91.158.153.178]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 575491FBC; Wed, 28 Jan 2026 18:25:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1769621126; bh=CPBrLo43D5oobjFdNES++lKWPeHTSF5yifInInVgzyQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Hv1xNPW1XVuyxGkJfo90BLs032W3Ee/Ph8VReBl+kSYmiXa6mtlxrpVIyjAfCPvie 2y3WmQ1SDXx0zQ4ZUO+yN14mHg9BZRmnyT3DA8Vw9X27DeCLkptvq+yNNp04Do81Xp ptr9Tgg8G7EYNTuPIOHs19WaWjcA56PfRmdtO5wk= From: Tomi Valkeinen Date: Wed, 28 Jan 2026 19:25:28 +0200 Subject: [PATCH v8 03/11] drm/fourcc: Add DRM_FORMAT_Y8 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260128-xilinx-formats-v8-3-9ea8adb70269@ideasonboard.com> References: <20260128-xilinx-formats-v8-0-9ea8adb70269@ideasonboard.com> In-Reply-To: <20260128-xilinx-formats-v8-0-9ea8adb70269@ideasonboard.com> To: Vishal Sagar , Anatoliy Klymenko , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Laurent Pinchart , Michal Simek Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Geert Uytterhoeven , Dmitry Baryshkov , Pekka Paalanen , Tomi Valkeinen , Pekka Paalanen , Dmitry Baryshkov X-Mailer: b4 0.15-dev-c25d1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2872; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=CPBrLo43D5oobjFdNES++lKWPeHTSF5yifInInVgzyQ=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBpekajBaskN7062G6E2JXiphLfHUZn7dO6S7sMc Y589AvzpleJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCaXpGowAKCRD6PaqMvJYe 9bm9EACORx8IhavHIWLnb1Rbxrtzv2sUen9MWfXUbKtxhzIUJVZ8oz77bhKf7Dp1GFYqee7QNjR SDT21ZNKE9wBD4jMAZjhtbyj8/q7fxq9hbu8Vat40SL0cjpgGGQ1BtCSZvDB5K6ICwe+2mv/rGr M5hlKXO1Z5pKJGVwWSZJI4ZL4vLFdG9qLBUVzus/GXYeacObYrKY0Gtrvn5RdN8ywOa29Nw+YPl h0MBNiBKRbqvYjWTvVHWqD4FwJKp3vgwdP59lgywGlX8zkKTIIagidYmO1TIfLyNRjR/EyQm3dJ zZ0f1SaKCwF5BOwcni+KmR74lYe04H75/OsN8Wz8O/JxgXD6V+qYV2rrSpNg7IEs8WNn4ARKj86 oYkbaXcVsGKogeW9LbGLzZ7nPnWGHwRL9Z0WpvR88m8JIbPCyZXMz+clebAdyB9nNVBU3x2Bks3 bAISvnwxR0nyA01KT3SdryfdRkxJIdsR5lOv5nfEPZ2V2ib5AIYbzh1DZBcKzXGAjIYLllooV04 xMLPxVeS9945/W/N3PSBRqoCxuP0YGzTKsyajT+qZGe7DWAH+bbqdazsY0Nr4czmUxyYO5ermcw pW31seZkLPvNOWaynMbTCBLrDLlRECsFD1b8XLr9YeTw9SKgXDdPdPifp0xvwLLGGtJiFcziz96 T9aqVAQ2NRW1jqw== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 Add greyscale Y8 format. The 8-bit greyscale format has been discussed before, and the earlier guidance was to use DRM_FORMAT_R8, as a single-channel 8-bit pixel. However, adding DRM_FORMAT_Y8 makes sense, we can mark it as 'is_yuv' in the drm_format_info, and this can help the drivers handle e.g. full/limited range. This will distinguish two single-channel formats: R8, which is a RGB format with the same value for all components, and Y8, which is a Y-only YCbCr format, with Cb and Cr being neutral. Acked-by: Dmitry Baryshkov Reviewed-by: Pekka Paalanen Reviewed-by: Vishal Sagar Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/drm_fourcc.c | 1 + include/uapi/drm/drm_fourcc.h | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/drivers/gpu/drm/drm_fourcc.c b/drivers/gpu/drm/drm_fourcc.c index b22ef86428a1..a39b9d7a5b62 100644 --- a/drivers/gpu/drm/drm_fourcc.c +++ b/drivers/gpu/drm/drm_fourcc.c @@ -275,6 +275,7 @@ const struct drm_format_info *__drm_format_info(u32 for= mat) { .format =3D DRM_FORMAT_YVU422, .depth =3D 0, .num_planes =3D 3, .cpp= =3D { 1, 1, 1 }, .hsub =3D 2, .vsub =3D 1, .is_yuv =3D true }, { .format =3D DRM_FORMAT_YUV444, .depth =3D 0, .num_planes =3D 3, .cpp= =3D { 1, 1, 1 }, .hsub =3D 1, .vsub =3D 1, .is_yuv =3D true }, { .format =3D DRM_FORMAT_YVU444, .depth =3D 0, .num_planes =3D 3, .cpp= =3D { 1, 1, 1 }, .hsub =3D 1, .vsub =3D 1, .is_yuv =3D true }, + { .format =3D DRM_FORMAT_Y8, .depth =3D 8, .num_planes =3D 1, .cpp =3D= { 1, 0, 0 }, .hsub =3D 1, .vsub =3D 1, .is_yuv =3D true }, { .format =3D DRM_FORMAT_NV12, .depth =3D 0, .num_planes =3D 2, .cpp = =3D { 1, 2, 0 }, .hsub =3D 2, .vsub =3D 2, .is_yuv =3D true }, { .format =3D DRM_FORMAT_NV21, .depth =3D 0, .num_planes =3D 2, .cpp = =3D { 1, 2, 0 }, .hsub =3D 2, .vsub =3D 2, .is_yuv =3D true }, { .format =3D DRM_FORMAT_NV16, .depth =3D 0, .num_planes =3D 2, .cpp = =3D { 1, 2, 0 }, .hsub =3D 2, .vsub =3D 1, .is_yuv =3D true }, diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h index 6c786701238e..e4451668499a 100644 --- a/include/uapi/drm/drm_fourcc.h +++ b/include/uapi/drm/drm_fourcc.h @@ -459,6 +459,15 @@ extern "C" { #define DRM_FORMAT_YUV444 fourcc_code('Y', 'U', '2', '4') /* non-subsample= d Cb (1) and Cr (2) planes */ #define DRM_FORMAT_YVU444 fourcc_code('Y', 'V', '2', '4') /* non-subsample= d Cr (1) and Cb (2) planes */ =20 +/* + * Y-only (greyscale) formats + * + * The Y-only formats are handled similarly to the YCbCr formats in the di= splay + * pipeline, with the Cb and Cr implicitly neutral (0.0 in nominal values)= . This + * also means that COLOR_RANGE property applies to the Y-only formats. + */ + +#define DRM_FORMAT_Y8 fourcc_code('G', 'R', 'E', 'Y') /* 8-bit Y-only */ =20 /* * Format Modifiers: --=20 2.43.0