From 5e4a63005a5f126a930768e9a10da9752b3e7af4 Mon Sep 17 00:00:00 2001
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
Date: Tue, 28 Jan 2025 17:40:03 +0000
Subject: [PATCH] drm/edid: When reset, assume HDMI displays support RGB444

If an HDMI connector has no EDID and the mode is set via the
kernel command line, then drm_reset_display_info() is the only
thing that will have set up any of connector->display_info.

With commit 26ff1c38fc29 ("drm/connector: hdmi: Compute bpc
and format automatically"), it is now checked that
DRM_COLOR_FORMAT_RGB444 is supported. Whilst it doesn't fail
the request, it does log dev_warn for every commit, spamming
the log.

For HDMI connectors initialise the color_format field to say
it supports RGB444.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
---
 drivers/gpu/drm/drm_edid.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -6609,7 +6609,11 @@ static void drm_reset_display_info(struc
 	info->height_mm = 0;
 
 	info->bpc = 0;
-	info->color_formats = 0;
+	if (connector->connector_type == DRM_MODE_CONNECTOR_HDMIA ||
+	    connector->connector_type == DRM_MODE_CONNECTOR_HDMIB)
+		info->color_formats = DRM_COLOR_FORMAT_RGB444;
+	else
+		info->color_formats = 0;
 	info->cea_rev = 0;
 	info->max_tmds_clock = 0;
 	info->dvi_dual = false;
