Re: [PATCH 10/12] drm/i915/hdmi: Nuke hdmi->ddc_bus

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 29 Aug 2023, Ville Syrjala <ville.syrjala@xxxxxxxxxxxxxxx> wrote:
> From: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
>
> Remove the mostly redundant hdmi->ddc_bus. The only thing that needs
> it anymore is get_encoder_by_ddc_bus(), but that can be replaced with
> a slight detour through attached_connector+intel_gmbus_get_adapter().
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>

Reviewed-by: Jani Nikula <jani.nikula@xxxxxxxxx>


> ---
>  drivers/gpu/drm/i915/display/intel_display_types.h |  1 -
>  drivers/gpu/drm/i915/display/intel_hdmi.c          | 13 +++++++++----
>  2 files changed, 9 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
> index c62f4ec315e8..363b6573a5f9 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_types.h
> +++ b/drivers/gpu/drm/i915/display/intel_display_types.h
> @@ -1581,7 +1581,6 @@ struct intel_watermark_params {
>  
>  struct intel_hdmi {
>  	i915_reg_t hdmi_reg;
> -	int ddc_bus;
>  	struct {
>  		enum drm_dp_dual_mode_type type;
>  		int max_tmds_clock;
> diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c
> index efa9bb93cfb1..6b8754290304 100644
> --- a/drivers/gpu/drm/i915/display/intel_hdmi.c
> +++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
> @@ -2900,13 +2900,17 @@ get_encoder_by_ddc_pin(struct intel_encoder *encoder, u8 ddc_pin)
>  	struct intel_encoder *other;
>  
>  	for_each_intel_encoder(&i915->drm, other) {
> +		struct intel_connector *connector;
> +
>  		if (other == encoder)
>  			continue;
>  
>  		if (!intel_encoder_is_dig_port(other))
>  			continue;
>  
> -		if (enc_to_dig_port(other)->hdmi.ddc_bus == ddc_pin)
> +		connector = enc_to_dig_port(other)->hdmi.attached_connector;
> +
> +		if (connector && connector->base.ddc == intel_gmbus_get_adapter(i915, ddc_pin))
>  			return other;
>  	}
>  
> @@ -3000,6 +3004,7 @@ void intel_hdmi_init_connector(struct intel_digital_port *dig_port,
>  	struct drm_i915_private *dev_priv = to_i915(dev);
>  	enum port port = intel_encoder->port;
>  	struct cec_connector_info conn_info;
> +	u8 ddc_pin;
>  
>  	drm_dbg_kms(&dev_priv->drm,
>  		    "Adding HDMI connector on [ENCODER:%d:%s]\n",
> @@ -3014,14 +3019,14 @@ void intel_hdmi_init_connector(struct intel_digital_port *dig_port,
>  		     intel_encoder->base.name))
>  		return;
>  
> -	intel_hdmi->ddc_bus = intel_hdmi_ddc_pin(intel_encoder);
> -	if (!intel_hdmi->ddc_bus)
> +	ddc_pin = intel_hdmi_ddc_pin(intel_encoder);
> +	if (!ddc_pin)
>  		return;
>  
>  	drm_connector_init_with_ddc(dev, connector,
>  				    &intel_hdmi_connector_funcs,
>  				    DRM_MODE_CONNECTOR_HDMIA,
> -				    intel_gmbus_get_adapter(dev_priv, intel_hdmi->ddc_bus));
> +				    intel_gmbus_get_adapter(dev_priv, ddc_pin));
>  
>  	drm_connector_helper_add(connector, &intel_hdmi_connector_helper_funcs);

-- 
Jani Nikula, Intel Open Source Graphics Center




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux