Commit 96f0ef50 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915/crt: Populate connector->ddc

Populate connector->ddc, and thus create the "ddc" symlink
in sysfs for analog VGA connectors.

As a bonus we can replace a bunch of intel_gmbus_get_adapter()
lookups with just the connector->ddc pointer. Sadly one extra
lookup still remains due to the g4x DVI-I shenanigans. We could
perhaps consider borrowing the ddc proxy idea from SDVO to deal
with that in a perhaps nicer way, but can't really be bothered
right now at least. Also not sure exposing such a dual ddc bus
to userspace would be quite wise.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230829113920.13713-6-ville.syrjala@linux.intel.comReviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
parent 08a629ff
...@@ -652,11 +652,9 @@ static bool intel_crt_detect_ddc(struct drm_connector *connector) ...@@ -652,11 +652,9 @@ static bool intel_crt_detect_ddc(struct drm_connector *connector)
struct intel_crt *crt = intel_attached_crt(to_intel_connector(connector)); struct intel_crt *crt = intel_attached_crt(to_intel_connector(connector));
struct drm_i915_private *dev_priv = to_i915(crt->base.base.dev); struct drm_i915_private *dev_priv = to_i915(crt->base.base.dev);
const struct drm_edid *drm_edid; const struct drm_edid *drm_edid;
struct i2c_adapter *ddc;
bool ret = false; bool ret = false;
ddc = intel_gmbus_get_adapter(dev_priv, dev_priv->display.vbt.crt_ddc_pin); drm_edid = intel_crt_get_edid(connector, connector->ddc);
drm_edid = intel_crt_get_edid(connector, ddc);
if (drm_edid) { if (drm_edid) {
/* /*
...@@ -922,8 +920,7 @@ static int intel_crt_get_modes(struct drm_connector *connector) ...@@ -922,8 +920,7 @@ static int intel_crt_get_modes(struct drm_connector *connector)
wakeref = intel_display_power_get(dev_priv, wakeref = intel_display_power_get(dev_priv,
intel_encoder->power_domain); intel_encoder->power_domain);
ddc = intel_gmbus_get_adapter(dev_priv, dev_priv->display.vbt.crt_ddc_pin); ret = intel_crt_ddc_get_modes(connector, connector->ddc);
ret = intel_crt_ddc_get_modes(connector, ddc);
if (ret || !IS_G4X(dev_priv)) if (ret || !IS_G4X(dev_priv))
goto out; goto out;
...@@ -987,6 +984,7 @@ void intel_crt_init(struct drm_i915_private *dev_priv) ...@@ -987,6 +984,7 @@ void intel_crt_init(struct drm_i915_private *dev_priv)
struct intel_crt *crt; struct intel_crt *crt;
struct intel_connector *intel_connector; struct intel_connector *intel_connector;
i915_reg_t adpa_reg; i915_reg_t adpa_reg;
u8 ddc_pin;
u32 adpa; u32 adpa;
if (HAS_PCH_SPLIT(dev_priv)) if (HAS_PCH_SPLIT(dev_priv))
...@@ -1023,10 +1021,14 @@ void intel_crt_init(struct drm_i915_private *dev_priv) ...@@ -1023,10 +1021,14 @@ void intel_crt_init(struct drm_i915_private *dev_priv)
return; return;
} }
ddc_pin = dev_priv->display.vbt.crt_ddc_pin;
connector = &intel_connector->base; connector = &intel_connector->base;
crt->connector = intel_connector; crt->connector = intel_connector;
drm_connector_init(&dev_priv->drm, &intel_connector->base, drm_connector_init_with_ddc(&dev_priv->drm, connector,
&intel_crt_connector_funcs, DRM_MODE_CONNECTOR_VGA); &intel_crt_connector_funcs,
DRM_MODE_CONNECTOR_VGA,
intel_gmbus_get_adapter(dev_priv, ddc_pin));
drm_encoder_init(&dev_priv->drm, &crt->base.base, &intel_crt_enc_funcs, drm_encoder_init(&dev_priv->drm, &crt->base.base, &intel_crt_enc_funcs,
DRM_MODE_ENCODER_DAC, "CRT"); DRM_MODE_ENCODER_DAC, "CRT");
......
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