Skip to contentSkip to conversation

drm/edid: Clear EDID Deep Color Modes in drm_reset_display_info()

PATCH Applied Maxime Ripard 3 participants 4 messages Jan 25, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/edid: Clear EDID Deep Color Modes in drm_reset_display_info()

Even though we have the other drm_display_info fields reset, the DC modes are missing.

This shouldn't be an issue since it's explicitely reset every time a new EDID is parsed.

---
 drivers/gpu/drm/drm_edid.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/drm_edid.c +3 -0
index 5251925e3b92..a76224653e6f 100644
@@ -5340,6 +5340,9 @@ drm_reset_display_info(struct drm_connector *connector)
 	info->rgb_quant_range_selectable = false;
 	memset(&info->hdmi, 0, sizeof(info->hdmi));
 
+	info->edid_hdmi_rgb444_dc_modes = 0;
+	info->edid_hdmi_ycbcr444_dc_modes = 0;
+
 	info->non_desktop = 0;
 	memset(&info->monitor_range, 0, sizeof(info->monitor_range));
 
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Maxime Ripard

Even though we have the other drm_display_info fields reset, the DC modes are missing.

This shouldn't be an issue since it's explicitely reset every time a new EDID is parsed.

It's not really obvious that it can't be an issue. I think we might be saved by info->bpc getting reset to 8 by drm_parse_hdmi_vsdb_video(). But the dc_modes bitfields themselves may be left with stale values.

Hmm, actually drm_add_display_info() re-populates info->bpc *after* drm_parse_hdmi_vsdb_video() so we could in theory end up with bpc>8 and dc_modes!=0 even if the display doesn't support any HDMI deep color modes. Though I suppose a display that doesn't do deep color but declares its max bpc as >8 is a bit nuts. I could maybe imagine it happening if the display supports >8 bpc with DP but not with HDMI, and doesn't bother customizing the EDID sufficiently for each interface.

Quoted 3 lines

drivers/gpu/drm/drm_edid.c drm_reset_display_info(struct drm_connector *connector) · line 5341

Quoted 11 lines
---
 drivers/gpu/drm/drm_edid.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/drm_edid.c +0 -0
index 5251925e3b92..a76224653e6f 100644
@@ -5340,6 +5340,9 @@ drm_reset_display_info(struct drm_connector *connector)
 	info->rgb_quant_range_selectable = false;
 	memset(&info->hdmi, 0, sizeof(info->hdmi));

We should probably just move more stuff into that .hdmi struct...

Quoted 9 lines
drivers/gpu/drm/drm_edid.c +3 -0
+	info->edid_hdmi_rgb444_dc_modes = 0;
+	info->edid_hdmi_ycbcr444_dc_modes = 0;
+
 	info->non_desktop = 0;
 	memset(&info->monitor_range, 0, sizeof(info->monitor_range));
 
Signature · 1 line
2.34.1
Signature · 2 lines
Ville Syrjälä
Intel
Reviewed-by on v1 1/1
#2 lore raw
In reply to Maxime Ripard
Quoted 5 lines · Maxime Ripard

Even though we have the other drm_display_info fields reset, the DC modes are missing.

This shouldn't be an issue since it's explicitely reset every time a new EDID is parsed.

Side note, and hijacking the thread a bit: I think it's a historical mistake we've started accumulating stuff in struct drm_display_info that is *not* derived from the EDID or DisplayID. I think drm_reset_display_info() should just be one memset() and that's it. Adding stuff that should not be reset here feels wrong.

Maybe we should just move all the non-EDID derived members directly to struct drm_connector? Or some other sub-struct.

In the mean time, this patch seems like the right thing to do,

BR,
Jani.

Quoted 20 lines
---
 drivers/gpu/drm/drm_edid.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/drm_edid.c +3 -0
index 5251925e3b92..a76224653e6f 100644
@@ -5340,6 +5340,9 @@ drm_reset_display_info(struct drm_connector *connector)
 	info->rgb_quant_range_selectable = false;
 	memset(&info->hdmi, 0, sizeof(info->hdmi));
 
+	info->edid_hdmi_rgb444_dc_modes = 0;
+	info->edid_hdmi_ycbcr444_dc_modes = 0;
+
 	info->non_desktop = 0;
 	memset(&info->monitor_range, 0, sizeof(info->monitor_range));
Signature · 1 line
Jani Nikula, Intel Open Source Graphics Center
author Applied
#3 lore raw

Re: (subset) [PATCH] drm/edid: Clear EDID Deep Color Modes in drm_reset_display_info()

In reply to Maxime Ripard
Quoted 8 lines · Maxime Ripard

Even though we have the other drm_display_info fields reset, the DC modes are missing.

This shouldn't be an issue since it's explicitely reset every time a new EDID is parsed.

[...]

Applied to drm/drm-misc (drm-misc-next).

Thanks!
Maxime