]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/i915/hdmi: stop caching has_hdmi_sink in struct intel_hdmi
authorJani Nikula <jani.nikula@intel.com>
Tue, 30 May 2023 09:08:18 +0000 (12:08 +0300)
committerJani Nikula <jani.nikula@intel.com>
Fri, 2 Jun 2023 10:21:39 +0000 (13:21 +0300)
Use the information stored in display info.

Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/5cdb4731260b062c0f0ad2f8b64195c9a57bcb76.1685437500.git.jani.nikula@intel.com
drivers/gpu/drm/i915/display/intel_display_types.h
drivers/gpu/drm/i915/display/intel_hdmi.c

index 1ae1519087cbefac79b7bf5af6a3bc595b0f2ec2..731f2ec04d5cdac4e1041aed33297a063dc3c96a 100644 (file)
@@ -1586,7 +1586,6 @@ struct intel_hdmi {
                enum drm_dp_dual_mode_type type;
                int max_tmds_clock;
        } dp_dual_mode;
-       bool has_hdmi_sink;
        struct intel_connector *attached_connector;
        struct cec_notifier *cec_notifier;
 };
index 89a6b574f95a40703b934974ed2e962e21bb8891..7ac5e6c5e00dc2ce6024a3dfc52ae39ce31c8e9a 100644 (file)
@@ -1790,7 +1790,9 @@ static int intel_hdmi_source_max_tmds_clock(struct intel_encoder *encoder)
 static bool intel_has_hdmi_sink(struct intel_hdmi *hdmi,
                                const struct drm_connector_state *conn_state)
 {
-       return hdmi->has_hdmi_sink &&
+       struct intel_connector *connector = hdmi->attached_connector;
+
+       return connector->base.display_info.is_hdmi &&
                READ_ONCE(to_intel_digital_connector_state(conn_state)->force_audio) != HDMI_AUDIO_OFF_DVI;
 }
 
@@ -2385,8 +2387,6 @@ intel_hdmi_unset_edid(struct drm_connector *connector)
 {
        struct intel_hdmi *intel_hdmi = intel_attached_hdmi(to_intel_connector(connector));
 
-       intel_hdmi->has_hdmi_sink = false;
-
        intel_hdmi->dp_dual_mode.type = DRM_DP_DUAL_MODE_NONE;
        intel_hdmi->dp_dual_mode.max_tmds_clock = 0;
 
@@ -2478,8 +2478,6 @@ intel_hdmi_set_edid(struct drm_connector *connector)
        /* FIXME: Get rid of drm_edid_raw() */
        edid = drm_edid_raw(drm_edid);
        if (edid && edid->input & DRM_EDID_INPUT_DIGITAL) {
-               intel_hdmi->has_hdmi_sink = drm_detect_hdmi_monitor(edid);
-
                intel_hdmi_dp_dual_mode_detect(connector);
 
                connected = true;