[Intel-gfx] [PATCH 9/9] drm/rockchip: convert to using has_audio from display_info

Jani Nikula jani.nikula at intel.com
Thu Sep 1 12:47:11 UTC 2022


Prefer the parsed results for has_audio in display info over calling
drm_detect_monitor_audio().

Cc: Sandy Huang <hjc at rock-chips.com>
Cc: Heiko Stübner <heiko at sntech.de>
Signed-off-by: Jani Nikula <jani.nikula at intel.com>
---
 drivers/gpu/drm/rockchip/cdn-dp-core.c | 4 ++--
 drivers/gpu/drm/rockchip/inno_hdmi.c   | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.c b/drivers/gpu/drm/rockchip/cdn-dp-core.c
index f77bdf5f5168..50af9861553b 100644
--- a/drivers/gpu/drm/rockchip/cdn-dp-core.c
+++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c
@@ -272,10 +272,10 @@ static int cdn_dp_connector_get_modes(struct drm_connector *connector)
 		DRM_DEV_DEBUG_KMS(dp->dev, "got edid: width[%d] x height[%d]\n",
 				  edid->width_cm, edid->height_cm);
 
-		dp->sink_has_audio = drm_detect_monitor_audio(edid);
-
 		drm_connector_update_edid_property(connector, edid);
 		ret = drm_add_edid_modes(connector, edid);
+
+		dp->sink_has_audio = connector->display_info.has_audio;
 	}
 	mutex_unlock(&dp->lock);
 
diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c
index 87b2243ea23e..fadaa795fb3d 100644
--- a/drivers/gpu/drm/rockchip/inno_hdmi.c
+++ b/drivers/gpu/drm/rockchip/inno_hdmi.c
@@ -564,10 +564,11 @@ static int inno_hdmi_connector_get_modes(struct drm_connector *connector)
 
 	edid = drm_get_edid(connector, hdmi->ddc);
 	if (edid) {
-		hdmi->hdmi_data.sink_has_audio = drm_detect_monitor_audio(edid);
 		drm_connector_update_edid_property(connector, edid);
 		ret = drm_add_edid_modes(connector, edid);
 		kfree(edid);
+
+		hdmi->hdmi_data.sink_has_audio = connector->display_info.has_audio;
 	}
 
 	return ret;
-- 
2.34.1



More information about the Intel-gfx mailing list