[Intel-gfx] [PATCH 06/13] drm/i915/hdmi: stop caching has_hdmi_sink in struct intel_hdmi

Nautiyal, Ankit K ankit.k.nautiyal at intel.com
Mon May 29 05:49:52 UTC 2023


LGTM.

Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal at intel.com>

On 4/21/2023 5:17 PM, Jani Nikula wrote:
> Use the information stored in display info.
>
> Signed-off-by: Jani Nikula <jani.nikula at intel.com>
> ---
>   drivers/gpu/drm/i915/display/intel_display_types.h | 1 -
>   drivers/gpu/drm/i915/display/intel_hdmi.c          | 8 +++-----
>   2 files changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
> index d7ff75167f1f..dc7f3bf731cd 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_types.h
> +++ b/drivers/gpu/drm/i915/display/intel_display_types.h
> @@ -1548,7 +1548,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;
>   };
> diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c
> index 3045bf21ba8f..aa0c726cb525 100644
> --- a/drivers/gpu/drm/i915/display/intel_hdmi.c
> +++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
> @@ -1789,7 +1789,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;
>   }
>   
> @@ -2359,8 +2361,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;
>   
> @@ -2452,8 +2452,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;


More information about the Intel-gfx mailing list