Commit ac6dcb63 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915/hdmi: Nuke hdmi->ddc_bus

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: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230829113920.13713-11-ville.syrjala@linux.intel.comReviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
parent e046d156
...@@ -1583,7 +1583,6 @@ struct intel_watermark_params { ...@@ -1583,7 +1583,6 @@ struct intel_watermark_params {
struct intel_hdmi { struct intel_hdmi {
i915_reg_t hdmi_reg; i915_reg_t hdmi_reg;
int ddc_bus;
struct { struct {
enum drm_dp_dual_mode_type type; enum drm_dp_dual_mode_type type;
int max_tmds_clock; int max_tmds_clock;
......
...@@ -2897,13 +2897,17 @@ get_encoder_by_ddc_pin(struct intel_encoder *encoder, u8 ddc_pin) ...@@ -2897,13 +2897,17 @@ get_encoder_by_ddc_pin(struct intel_encoder *encoder, u8 ddc_pin)
struct intel_encoder *other; struct intel_encoder *other;
for_each_intel_encoder(&i915->drm, other) { for_each_intel_encoder(&i915->drm, other) {
struct intel_connector *connector;
if (other == encoder) if (other == encoder)
continue; continue;
if (!intel_encoder_is_dig_port(other)) if (!intel_encoder_is_dig_port(other))
continue; 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; return other;
} }
...@@ -2997,6 +3001,7 @@ void intel_hdmi_init_connector(struct intel_digital_port *dig_port, ...@@ -2997,6 +3001,7 @@ void intel_hdmi_init_connector(struct intel_digital_port *dig_port,
struct drm_i915_private *dev_priv = to_i915(dev); struct drm_i915_private *dev_priv = to_i915(dev);
enum port port = intel_encoder->port; enum port port = intel_encoder->port;
struct cec_connector_info conn_info; struct cec_connector_info conn_info;
u8 ddc_pin;
drm_dbg_kms(&dev_priv->drm, drm_dbg_kms(&dev_priv->drm,
"Adding HDMI connector on [ENCODER:%d:%s]\n", "Adding HDMI connector on [ENCODER:%d:%s]\n",
...@@ -3011,14 +3016,14 @@ void intel_hdmi_init_connector(struct intel_digital_port *dig_port, ...@@ -3011,14 +3016,14 @@ void intel_hdmi_init_connector(struct intel_digital_port *dig_port,
intel_encoder->base.name)) intel_encoder->base.name))
return; return;
intel_hdmi->ddc_bus = intel_hdmi_ddc_pin(intel_encoder); ddc_pin = intel_hdmi_ddc_pin(intel_encoder);
if (!intel_hdmi->ddc_bus) if (!ddc_pin)
return; return;
drm_connector_init_with_ddc(dev, connector, drm_connector_init_with_ddc(dev, connector,
&intel_hdmi_connector_funcs, &intel_hdmi_connector_funcs,
DRM_MODE_CONNECTOR_HDMIA, 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); drm_connector_helper_add(connector, &intel_hdmi_connector_helper_funcs);
......
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