From nobody Fri Apr 3 01:24:33 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 75F0D3DBD6E for ; Wed, 25 Mar 2026 14:02:00 +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=1774447322; cv=none; b=f4takV5/ENcBQbchrgUlSaiKbpT3VUgDf7bPdOYYeqsV2vA26WdnLvBde3VzGnTKf3JgDztA6iSLtHITb4qZWsniWq0sk3OMCYN0QqoUoTglkHW/enouA8KfDvU0n1IUs0qEodDPsq1qhnWLXy48dD3V1ILIzUSbo37FGQbzGrM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774447322; c=relaxed/simple; bh=nCrTvG2jfseeZ/eRmUeub8cMM55Js0Xo68tYrLSNyU0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=sMxAXCPvJf1lD+gPCFmIXULhdva3jPvdOWJGLh1UKr/upG/h26QplOSmfkvsrPmaj3xmTVCOuofD4bKfofHyiFp9BWRBG7s1tjWWoCZWhRxyqWOQfr1Sg3PWjkQXUnO4VR+LO1uDcXXtDBNyL1DniiKVCOUKzd0wHrGx9qiyQI8= 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=lTrq/akr; 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="lTrq/akr" 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 26B4B1ADE; Wed, 25 Mar 2026 15:00:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1774447237; bh=nCrTvG2jfseeZ/eRmUeub8cMM55Js0Xo68tYrLSNyU0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=lTrq/akrZ/cDvcHxIsphDGr1xlspwy4KQlGhnpeYZjrHA+vqHaMtAZm0UVn47eYlb oA249rla4McqX1KFp23MTowg4cvKYva33wdd547VJZ53zJhzIu1VE+XvLFmZhoLr07 YbYaY3nfPo1Zx97u9uO9o53VJpF/mEiU6WgypR0o= From: Tomi Valkeinen Date: Wed, 25 Mar 2026 16:01:26 +0200 Subject: [PATCH v9 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: <20260325-xilinx-formats-v9-3-d03b7e3752e4@ideasonboard.com> References: <20260325-xilinx-formats-v9-0-d03b7e3752e4@ideasonboard.com> In-Reply-To: <20260325-xilinx-formats-v9-0-d03b7e3752e4@ideasonboard.com> To: Vishal Sagar , Anatoliy Klymenko , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Laurent Pinchart , Michal Simek , Simon Ser 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=2939; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=nCrTvG2jfseeZ/eRmUeub8cMM55Js0Xo68tYrLSNyU0=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBpw+rKOZh6y/kojehxYsu1HWilOVqtDOI1zCHIm kRARLOgjRmJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCacPqygAKCRD6PaqMvJYe 9QGZEACQYzCy2nGRUT8yKGRzbuIC710UE8KODVctb7tXpLIm9grU6PfgDgIHuWwjs7z4Yo7Hp3B W849Je5MugW+xUqymZ6V/E184laVE98/MWU1kd9ZJX14uvVPQB/NavXhSwpt33cWiu2NUub3nKD UySvT9jOzNVI3j3CzUnlaTDySz51PrqopzSuaqiRHGGe2KeIggG05yP3zQGfBUcHMBR+eKxQffM UTG6D7gyE8QiHfvotyP1mJR4qnCLJcg8+lyMmE5MGYO4qsAbqcLRR/nMShbyK4aIoET91XAcaGk Uuey92Im3rx4zd5IIGEhRmRRAGoisaAtk44jBacwOkJL0vMjo4h4lmgZZ0c22pwE1nTRYYsCCEs DubTIgqCJZhipcMj2Fnscs2k/Dpg+kJNFJ/VvWeFnPKiQH3o0uWXFAWys5n0ddK5/HRqP4HQXS+ 6FVw2RMfd/TrUMZ1EQJh4uCIyEYLwUTIgPk3cw4F6VqEQAfouUi3feE1ZPIR+Z23EVVmOaq3P4X 87aYXUfOs5ebjIF7YRXSTiAuecNgNNO7KODYfVF+q+whV6un0v0O0gQIenJ10NARum8WfIVIgzQ 3+y87oPEreV8BbTzfUwqG9gxpLSe3a5OCuL9M5M2/UCAxntYrIPuRYIkVLfiwEtDhukP+CbBE7+ A0KExLNkmQthvpA== 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 Reviewed-by: Laurent Pinchart Signed-off-by: Tomi Valkeinen --- 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 4fd37226b647..a8ea1f3660cb 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 10cc13bdb495..02205ec4a75a 100644 --- a/include/uapi/drm/drm_fourcc.h +++ b/include/uapi/drm/drm_fourcc.h @@ -458,6 +458,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