Commit 9fe2a4ad authored by Jani Nikula's avatar Jani Nikula

drm/i915/hdmi: stop caching has_audio in struct intel_hdmi

Use the information stored in display info.
Reviewed-by: default avatarAnkit Nautiyal <ankit.k.nautiyal@intel.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/710286536d6b07ba8aa068b65b2b2c0c7743220e.1685437500.git.jani.nikula@intel.com
parent 7ffa2f27
...@@ -252,13 +252,11 @@ static void intel_dp_mst_info(struct seq_file *m, ...@@ -252,13 +252,11 @@ static void intel_dp_mst_info(struct seq_file *m,
} }
static void intel_hdmi_info(struct seq_file *m, static void intel_hdmi_info(struct seq_file *m,
struct intel_connector *intel_connector) struct intel_connector *connector)
{ {
struct intel_encoder *intel_encoder = intel_attached_encoder(intel_connector); bool has_audio = connector->base.display_info.has_audio;
struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(intel_encoder);
seq_printf(m, "\taudio support: %s\n", seq_printf(m, "\taudio support: %s\n", str_yes_no(has_audio));
str_yes_no(intel_hdmi->has_audio));
} }
static void intel_connector_info(struct seq_file *m, static void intel_connector_info(struct seq_file *m,
......
...@@ -1587,7 +1587,6 @@ struct intel_hdmi { ...@@ -1587,7 +1587,6 @@ struct intel_hdmi {
int max_tmds_clock; int max_tmds_clock;
} dp_dual_mode; } dp_dual_mode;
bool has_hdmi_sink; bool has_hdmi_sink;
bool has_audio;
struct intel_connector *attached_connector; struct intel_connector *attached_connector;
struct cec_notifier *cec_notifier; struct cec_notifier *cec_notifier;
}; };
......
...@@ -2169,7 +2169,7 @@ static bool intel_hdmi_has_audio(struct intel_encoder *encoder, ...@@ -2169,7 +2169,7 @@ static bool intel_hdmi_has_audio(struct intel_encoder *encoder,
const struct intel_crtc_state *crtc_state, const struct intel_crtc_state *crtc_state,
const struct drm_connector_state *conn_state) const struct drm_connector_state *conn_state)
{ {
struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder); struct drm_connector *connector = conn_state->connector;
const struct intel_digital_connector_state *intel_conn_state = const struct intel_digital_connector_state *intel_conn_state =
to_intel_digital_connector_state(conn_state); to_intel_digital_connector_state(conn_state);
...@@ -2177,7 +2177,7 @@ static bool intel_hdmi_has_audio(struct intel_encoder *encoder, ...@@ -2177,7 +2177,7 @@ static bool intel_hdmi_has_audio(struct intel_encoder *encoder,
return false; return false;
if (intel_conn_state->force_audio == HDMI_AUDIO_AUTO) if (intel_conn_state->force_audio == HDMI_AUDIO_AUTO)
return intel_hdmi->has_audio; return connector->display_info.has_audio;
else else
return intel_conn_state->force_audio == HDMI_AUDIO_ON; return intel_conn_state->force_audio == HDMI_AUDIO_ON;
} }
...@@ -2386,7 +2386,6 @@ intel_hdmi_unset_edid(struct drm_connector *connector) ...@@ -2386,7 +2386,6 @@ intel_hdmi_unset_edid(struct drm_connector *connector)
struct intel_hdmi *intel_hdmi = intel_attached_hdmi(to_intel_connector(connector)); struct intel_hdmi *intel_hdmi = intel_attached_hdmi(to_intel_connector(connector));
intel_hdmi->has_hdmi_sink = false; intel_hdmi->has_hdmi_sink = false;
intel_hdmi->has_audio = false;
intel_hdmi->dp_dual_mode.type = DRM_DP_DUAL_MODE_NONE; intel_hdmi->dp_dual_mode.type = DRM_DP_DUAL_MODE_NONE;
intel_hdmi->dp_dual_mode.max_tmds_clock = 0; intel_hdmi->dp_dual_mode.max_tmds_clock = 0;
...@@ -2479,7 +2478,6 @@ intel_hdmi_set_edid(struct drm_connector *connector) ...@@ -2479,7 +2478,6 @@ intel_hdmi_set_edid(struct drm_connector *connector)
/* FIXME: Get rid of drm_edid_raw() */ /* FIXME: Get rid of drm_edid_raw() */
edid = drm_edid_raw(drm_edid); edid = drm_edid_raw(drm_edid);
if (edid && edid->input & DRM_EDID_INPUT_DIGITAL) { if (edid && edid->input & DRM_EDID_INPUT_DIGITAL) {
intel_hdmi->has_audio = drm_detect_monitor_audio(edid);
intel_hdmi->has_hdmi_sink = drm_detect_hdmi_monitor(edid); intel_hdmi->has_hdmi_sink = drm_detect_hdmi_monitor(edid);
intel_hdmi_dp_dual_mode_detect(connector); intel_hdmi_dp_dual_mode_detect(connector);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment