drm/i915: add support for DDI-controlled digital outputs
authorEugeni Dodonov <eugeni.dodonov@intel.com>
Wed, 9 May 2012 18:37:28 +0000 (15:37 -0300)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Sat, 19 May 2012 20:39:50 +0000 (22:39 +0200)
Those are driven by DDIs on Haswell architecture, so we need to keep track
of which DDI is being used on each output.

Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_hdmi.c

index 8da8dfe1b4fa47f0af7220530ea1e134accfa9a5..3b0cf719725461e794501f86e50da177bfca59b6 100644 (file)
@@ -41,6 +41,7 @@ struct intel_hdmi {
        struct intel_encoder base;
        u32 sdvox_reg;
        int ddc_bus;
+       int ddi_port;
        uint32_t color_range;
        bool has_hdmi_sink;
        bool has_audio;
@@ -661,6 +662,24 @@ void intel_hdmi_init(struct drm_device *dev, int sdvox_reg)
                intel_encoder->clone_mask = (1 << INTEL_HDMIF_CLONE_BIT);
                intel_hdmi->ddc_bus = GMBUS_PORT_DPD;
                dev_priv->hotplug_supported_mask |= HDMID_HOTPLUG_INT_STATUS;
+       } else if (sdvox_reg == DDI_BUF_CTL(PORT_B)) {
+               DRM_DEBUG_DRIVER("LPT: detected output on DDI B\n");
+               intel_encoder->clone_mask = (1 << INTEL_HDMIB_CLONE_BIT);
+               intel_hdmi->ddc_bus = GMBUS_PORT_DPB;
+               intel_hdmi->ddi_port = PORT_B;
+               dev_priv->hotplug_supported_mask |= HDMIB_HOTPLUG_INT_STATUS;
+       } else if (sdvox_reg == DDI_BUF_CTL(PORT_C)) {
+               DRM_DEBUG_DRIVER("LPT: detected output on DDI C\n");
+               intel_encoder->clone_mask = (1 << INTEL_HDMIC_CLONE_BIT);
+               intel_hdmi->ddc_bus = GMBUS_PORT_DPC;
+               intel_hdmi->ddi_port = PORT_C;
+               dev_priv->hotplug_supported_mask |= HDMIC_HOTPLUG_INT_STATUS;
+       } else if (sdvox_reg == DDI_BUF_CTL(PORT_D)) {
+               DRM_DEBUG_DRIVER("LPT: detected output on DDI D\n");
+               intel_encoder->clone_mask = (1 << INTEL_HDMID_CLONE_BIT);
+               intel_hdmi->ddc_bus = GMBUS_PORT_DPD;
+               intel_hdmi->ddi_port = PORT_D;
+               dev_priv->hotplug_supported_mask |= HDMID_HOTPLUG_INT_STATUS;
        } else {
                /* If we got an unknown sdvox_reg, things are pretty much broken
                 * in a way that we should let the kernel know about it */