Skip to contentSkip to conversation

drm/gma500: replace drm_detect_hdmi_monitor() with drm_display_info.is_hdmi

PATCH Superseded Tejas Vipin 2 participants 2 messages Sep 10, 2024

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/gma500: replace drm_detect_hdmi_monitor() with drm_display_info.is_hdmi

Replace drm_detect_hdmi_monitor() with drm_display_info.is_hdmi since monitor HDMI information is available after EDID is parsed. Additionally rewrite the code the code to have fewer indentation levels.

---
 drivers/gpu/drm/gma500/cdv_intel_hdmi.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/gpu/drm/gma500/cdv_intel_hdmi.c +9 -9
index 2d95e0471291..cfbf3137e144 100644
@@ -135,16 +135,16 @@ static enum drm_connector_status cdv_hdmi_detect(
 
 	hdmi_priv->has_hdmi_sink = false;
 	hdmi_priv->has_hdmi_audio = false;
-	if (edid) {
-		if (edid->input & DRM_EDID_INPUT_DIGITAL) {
-			status = connector_status_connected;
-			hdmi_priv->has_hdmi_sink =
-						drm_detect_hdmi_monitor(edid);
-			hdmi_priv->has_hdmi_audio =
-						drm_detect_monitor_audio(edid);
-		}
-		kfree(edid);
+	if (!edid)
+		return status;
+
+	if (edid->input & DRM_EDID_INPUT_DIGITAL) {
+		status = connector_status_connected;
+		hdmi_priv->has_hdmi_sink = connector->display_info.is_hdmi;
+		hdmi_priv->has_hdmi_audio = drm_detect_monitor_audio(edid);
 	}
+	kfree(edid);
+
 	return status;
 }
 
Signature · 1 line
2.46.0
#1 lore raw
Quoted 23 lines · Tejas Vipin

Replace drm_detect_hdmi_monitor() with drm_display_info.is_hdmi since monitor HDMI information is available after EDID is parsed. Additionally rewrite the code the code to have fewer indentation levels.

---
 drivers/gpu/drm/gma500/cdv_intel_hdmi.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/gpu/drm/gma500/cdv_intel_hdmi.c +0 -6
index 2d95e0471291..cfbf3137e144 100644
@@ -135,16 +135,16 @@ static enum drm_connector_status cdv_hdmi_detect(
 
 	hdmi_priv->has_hdmi_sink = false;
 	hdmi_priv->has_hdmi_audio = false;
-	if (edid) {
-		if (edid->input & DRM_EDID_INPUT_DIGITAL) {
-			status = connector_status_connected;
-			hdmi_priv->has_hdmi_sink =
-						drm_detect_hdmi_monitor(edid);
-			hdmi_priv->has_hdmi_audio =

drivers/gpu/drm/gma500/cdv_intel_hdmi.c static enum drm_connector_status cdv_hdmi_detect( · line 144

Quoted 10 lines
drivers/gpu/drm/gma500/cdv_intel_hdmi.c +7 -3
-						drm_detect_monitor_audio(edid);
-		}
-		kfree(edid);
+	if (!edid)
+		return status;
+
+	if (edid->input & DRM_EDID_INPUT_DIGITAL) {
+		status = connector_status_connected;
+		hdmi_priv->has_hdmi_sink = connector->display_info.is_hdmi;
+		hdmi_priv->has_hdmi_audio = drm_detect_monitor_audio(edid);

display_info.has_audio

drivers/gpu/drm/gma500/cdv_intel_hdmi.c static enum drm_connector_status cdv_hdmi_detect( · line 147

Quoted 3 lines
drivers/gpu/drm/gma500/cdv_intel_hdmi.c +2 -0
 	}
+	kfree(edid);
+

Please switch the code to use struct drm_edid and the related functions drm_edid_read(), drm_edid_connector_update() and drm_edid_connector_add_modes() while you're at it. See git log --grep=drm_edid for a number of examples.

BR,
Jani.

Quoted 2 lines
drivers/gpu/drm/gma500/cdv_intel_hdmi.c +0 -0
 	return status;
 }
Signature · 1 line
Jani Nikula, Intel