diff options
| -rw-r--r-- | drivers/gpu/drm/i915/intel_ddi.c | 29 | ||||
| -rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 21 | ||||
| -rw-r--r-- | drivers/gpu/drm/i915/intel_drv.h | 1 |
3 files changed, 50 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c index f44aae124771..22bb0dd9a911 100644 --- a/drivers/gpu/drm/i915/intel_ddi.c +++ b/drivers/gpu/drm/i915/intel_ddi.c | |||
| @@ -220,3 +220,32 @@ void hsw_fdi_link_train(struct drm_crtc *crtc) | |||
| 220 | 220 | ||
| 221 | DRM_DEBUG_KMS("FDI train done.\n"); | 221 | DRM_DEBUG_KMS("FDI train done.\n"); |
| 222 | } | 222 | } |
| 223 | |||
| 224 | /* For DDI connections, it is possible to support different outputs over the | ||
| 225 | * same DDI port, such as HDMI or DP or even VGA via FDI. So we don't know by | ||
| 226 | * the time the output is detected what exactly is on the other end of it. This | ||
| 227 | * function aims at providing support for this detection and proper output | ||
| 228 | * configuration. | ||
| 229 | */ | ||
| 230 | void intel_ddi_init(struct drm_device *dev, enum port port) | ||
| 231 | { | ||
| 232 | /* For now, we don't do any proper output detection and assume that we | ||
| 233 | * handle HDMI only */ | ||
| 234 | |||
| 235 | switch(port){ | ||
| 236 | case PORT_A: | ||
| 237 | /* We don't handle eDP and DP yet */ | ||
| 238 | DRM_DEBUG_DRIVER("Found digital output on DDI port A\n"); | ||
| 239 | break; | ||
| 240 | /* Assume that the ports B, C and D are working in HDMI mode for now */ | ||
| 241 | case PORT_B: | ||
| 242 | case PORT_C: | ||
| 243 | case PORT_D: | ||
| 244 | intel_hdmi_init(dev, DDI_BUF_CTL(port)); | ||
| 245 | break; | ||
| 246 | default: | ||
| 247 | DRM_DEBUG_DRIVER("No handlers defined for port %d, skipping DDI initialization\n", | ||
| 248 | port); | ||
| 249 | break; | ||
| 250 | } | ||
| 251 | } | ||
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index f1bb2e2ec173..1a06f97e73f8 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
| @@ -6474,7 +6474,26 @@ static void intel_setup_outputs(struct drm_device *dev) | |||
| 6474 | 6474 | ||
| 6475 | intel_crt_init(dev); | 6475 | intel_crt_init(dev); |
| 6476 | 6476 | ||
| 6477 | if (HAS_PCH_SPLIT(dev)) { | 6477 | if (IS_HASWELL(dev)) { |
| 6478 | int found; | ||
| 6479 | |||
| 6480 | /* Haswell uses DDI functions to detect digital outputs */ | ||
| 6481 | found = I915_READ(DDI_BUF_CTL_A) & DDI_INIT_DISPLAY_DETECTED; | ||
| 6482 | /* DDI A only supports eDP */ | ||
| 6483 | if (found) | ||
| 6484 | intel_ddi_init(dev, PORT_A); | ||
| 6485 | |||
| 6486 | /* DDI B, C and D detection is indicated by the SFUSE_STRAP | ||
| 6487 | * register */ | ||
| 6488 | found = I915_READ(SFUSE_STRAP); | ||
| 6489 | |||
| 6490 | if (found & SFUSE_STRAP_DDIB_DETECTED) | ||
| 6491 | intel_ddi_init(dev, PORT_B); | ||
| 6492 | if (found & SFUSE_STRAP_DDIC_DETECTED) | ||
| 6493 | intel_ddi_init(dev, PORT_C); | ||
| 6494 | if (found & SFUSE_STRAP_DDID_DETECTED) | ||
| 6495 | intel_ddi_init(dev, PORT_D); | ||
| 6496 | } else if (HAS_PCH_SPLIT(dev)) { | ||
| 6478 | int found; | 6497 | int found; |
| 6479 | 6498 | ||
| 6480 | if (I915_READ(HDMIB) & PORT_DETECTED) { | 6499 | if (I915_READ(HDMIB) & PORT_DETECTED) { |
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index 0ad1bb383976..fd96ffbf501b 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h | |||
| @@ -448,6 +448,7 @@ extern void intel_write_eld(struct drm_encoder *encoder, | |||
| 448 | extern void intel_cpt_verify_modeset(struct drm_device *dev, int pipe); | 448 | extern void intel_cpt_verify_modeset(struct drm_device *dev, int pipe); |
| 449 | extern void intel_prepare_ddi(struct drm_device *dev); | 449 | extern void intel_prepare_ddi(struct drm_device *dev); |
| 450 | extern void hsw_fdi_link_train(struct drm_crtc *crtc); | 450 | extern void hsw_fdi_link_train(struct drm_crtc *crtc); |
| 451 | extern void intel_ddi_init(struct drm_device *dev, enum port port); | ||
| 451 | 452 | ||
| 452 | /* For use by IVB LP watermark workaround in intel_sprite.c */ | 453 | /* For use by IVB LP watermark workaround in intel_sprite.c */ |
| 453 | extern void intel_update_watermarks(struct drm_device *dev); | 454 | extern void intel_update_watermarks(struct drm_device *dev); |
