From mboxrd@z Thu Jan 1 00:00:00 1970 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 51F1F333730 for ; Thu, 23 Apr 2026 14:21:53 +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=1776954115; cv=none; b=LxMo2inZsHqAF8UQ7vq01LaUEfylJu1crTBu7NAub+r4iBOqUXa1RnBGJZWNA/5WRBa+sduK6bixg1CICjssCY5hIflZ19pTuNognYT6NN7ZuD4ZXektzh/1P67fOhMO9wIFTzMxQvPbxuxDAOlvZS/p+Y7z+0BoilewzuTDgLY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776954115; c=relaxed/simple; bh=dGb4kJxgZbjxrUSuLpRxKbg9L3YRSArGDCi3VLYuquI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=HUeI/x1hrgngH48k62AZ4ohQ8HXtIn1f99qS+T496G63hNeIE17LMJKWAgs2xSks6zwyiQqnCmOLwrWRllSES01LKZqUQ+8lBhBaw0AI1gWyLUrV5YEwhZrOz9kgsJ2hExaZaT+Ki6sUWRs1lFdZLEQzknQz2WpQYPXJb+Qzx5s= 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=Vcq94l7G; 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="Vcq94l7G" 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 B203D11EB; Thu, 23 Apr 2026 16:20:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1776954009; bh=dGb4kJxgZbjxrUSuLpRxKbg9L3YRSArGDCi3VLYuquI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Vcq94l7GSoKlhTKr49VDz28Vx2tQ2swmefkB56lpmOfL23KEF7lg1sXfYIfh3BuyP PgxQF8mXHCZQbj0hFjCFTf0TZQKsUT6/UEWgQupAOr+bTJcWgqxUBmisBpJnyj/7y5 jOvSiz090XNlhupE8IAFv0cVjEKmFxn7D49Kgz2o= From: Tomi Valkeinen Date: Thu, 23 Apr 2026 17:21:14 +0300 Subject: [PATCH v10 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: 7bit Message-Id: <20260423-xilinx-formats-v10-3-c690c2b8ea89@ideasonboard.com> References: <20260423-xilinx-formats-v10-0-c690c2b8ea89@ideasonboard.com> In-Reply-To: <20260423-xilinx-formats-v10-0-c690c2b8ea89@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=dGb4kJxgZbjxrUSuLpRxKbg9L3YRSArGDCi3VLYuquI=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBp6ir0K++6isXdFpdPZY2kpGhd2I28M1s5loAW/ fV6mSOTX+SJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCaeoq9AAKCRD6PaqMvJYe 9VA8D/wMAPw79XcsJLOROdCF58RO9P+KvzZMRJKRSUKGoTFR7SNBeRDqStz163mXPZid6wVMQiD lF7HTH859pcSUEWuHqLB4ybfjAy5uxRXgn9hvcjkoGjsLaxoVCXZchVqTwWCQ9FWu9HbFJX36dv kSH1nWI6EynQA/fFowjMea14GfLwviYmddnLPqKRLrXyOFAsX7eTUsUYxEQA3aIPi92/gckyLQe /ScCY641KOjUmXmXJwAC7gdhN6bObOxVe9hpobpu+v4/igjeAsQDe7uY1UcppuEM+WsuBZAJqIJ rxs+lWpw5RKQd0CGFYTQ68IyxEBWf4l8iLx10RKLMtnlG5YlA/fRpomYOucdD1r9uUnwiosKpEW N+6kAcH5y6Cr2jXDvYb8xPamOcLW2IWuwb+IlWxXMgAG/+j0hzD4Y/h0RafYjJ1w0TIZi00bKSd /zxh4YDWjhUbbHHiVeV0x+3+V57vY6i0JXSKVMRbHe+00DGlhwOil9CgF1cvON4FYbxa/Vg6YsU S4bJKmNxiIxWweZQrD81VDt/YicTjm9+gS91yRG2GEZfuFg0SEAEu5Upu5dIf7oNsmn+MHyNxrb aSt2fJsbN0E4I0F6lhwlAGhTZe2oO/BXhat7PV0XbqPd2vPt6UIZ8oEMPcoKBZAHH0FbmgNjsIU drK8sJCm2+HUVXA== 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 5b6d8f4686c4..c30266b8d051 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 format) { .format = DRM_FORMAT_YVU422, .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, .hsub = 2, .vsub = 1, .is_yuv = true }, { .format = DRM_FORMAT_YUV444, .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, .hsub = 1, .vsub = 1, .is_yuv = true }, { .format = DRM_FORMAT_YVU444, .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, .hsub = 1, .vsub = 1, .is_yuv = true }, + { .format = DRM_FORMAT_Y8, .depth = 8, .num_planes = 1, .cpp = { 1, 0, 0 }, .hsub = 1, .vsub = 1, .is_yuv = true }, { .format = DRM_FORMAT_NV12, .depth = 0, .num_planes = 2, .cpp = { 1, 2, 0 }, .hsub = 2, .vsub = 2, .is_yuv = true }, { .format = DRM_FORMAT_NV21, .depth = 0, .num_planes = 2, .cpp = { 1, 2, 0 }, .hsub = 2, .vsub = 2, .is_yuv = true }, { .format = DRM_FORMAT_NV16, .depth = 0, .num_planes = 2, .cpp = { 1, 2, 0 }, .hsub = 2, .vsub = 1, .is_yuv = true }, diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h index 0f2f79542121..c5b64ed3b00a 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-subsampled Cb (1) and Cr (2) planes */ #define DRM_FORMAT_YVU444 fourcc_code('Y', 'V', '2', '4') /* non-subsampled Cr (1) and Cb (2) planes */ +/* + * Y-only (greyscale) formats + * + * The Y-only formats are handled similarly to the YCbCr formats in the display + * 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 */ /* * Format Modifiers: -- 2.43.0