diff options
author | Paulo Zanoni <paulo.r.zanoni@intel.com> | 2012-10-15 14:51:33 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-10-18 15:19:22 -0400 |
commit | 247d89f62230f3369aeaab85dca34978f79dcb86 (patch) | |
tree | 88679cef58dc20a445f3762c3559db515195de16 /drivers/gpu/drm/i915/intel_ddi.c | |
parent | 6547fef887b057ee860f4266fa2923b7bbbf1850 (diff) |
drm/i915: add DP support to intel_ddi_mode_set
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_ddi.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_ddi.c | 61 |
1 files changed, 44 insertions, 17 deletions
diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c index aabbeb850ac7..510317270ad1 100644 --- a/drivers/gpu/drm/i915/intel_ddi.c +++ b/drivers/gpu/drm/i915/intel_ddi.c | |||
@@ -650,28 +650,55 @@ void intel_ddi_mode_set(struct drm_encoder *encoder, | |||
650 | { | 650 | { |
651 | struct drm_crtc *crtc = encoder->crtc; | 651 | struct drm_crtc *crtc = encoder->crtc; |
652 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | 652 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); |
653 | struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder); | 653 | struct intel_encoder *intel_encoder = to_intel_encoder(encoder); |
654 | int port = intel_hdmi->ddi_port; | 654 | int port = intel_ddi_get_encoder_port(intel_encoder); |
655 | int pipe = intel_crtc->pipe; | 655 | int pipe = intel_crtc->pipe; |
656 | int type = intel_encoder->type; | ||
656 | 657 | ||
657 | /* On Haswell, we need to enable the clocks and prepare DDI function to | 658 | DRM_DEBUG_KMS("Preparing DDI mode for Haswell on port %c, pipe %c\n", |
658 | * work in HDMI mode for this pipe. | 659 | port_name(port), pipe_name(pipe)); |
659 | */ | ||
660 | DRM_DEBUG_KMS("Preparing HDMI DDI mode for Haswell on port %c, pipe %c\n", port_name(port), pipe_name(pipe)); | ||
661 | 660 | ||
662 | if (intel_hdmi->has_audio) { | 661 | if (type == INTEL_OUTPUT_DISPLAYPORT || type == INTEL_OUTPUT_EDP) { |
663 | /* Proper support for digital audio needs a new logic and a new set | 662 | struct intel_dp *intel_dp = enc_to_intel_dp(encoder); |
664 | * of registers, so we leave it for future patch bombing. | ||
665 | */ | ||
666 | DRM_DEBUG_DRIVER("HDMI audio on pipe %c on DDI\n", | ||
667 | pipe_name(intel_crtc->pipe)); | ||
668 | 663 | ||
669 | /* write eld */ | 664 | intel_dp->DP = DDI_BUF_CTL_ENABLE | DDI_BUF_EMP_400MV_0DB_HSW; |
670 | DRM_DEBUG_DRIVER("HDMI audio: write eld information\n"); | 665 | switch (intel_dp->lane_count) { |
671 | intel_write_eld(encoder, adjusted_mode); | 666 | case 1: |
672 | } | 667 | intel_dp->DP |= DDI_PORT_WIDTH_X1; |
668 | break; | ||
669 | case 2: | ||
670 | intel_dp->DP |= DDI_PORT_WIDTH_X2; | ||
671 | break; | ||
672 | case 4: | ||
673 | intel_dp->DP |= DDI_PORT_WIDTH_X4; | ||
674 | break; | ||
675 | default: | ||
676 | intel_dp->DP |= DDI_PORT_WIDTH_X4; | ||
677 | WARN(1, "Unexpected DP lane count %d\n", | ||
678 | intel_dp->lane_count); | ||
679 | break; | ||
680 | } | ||
681 | |||
682 | intel_dp_init_link_config(intel_dp); | ||
673 | 683 | ||
674 | intel_hdmi->set_infoframes(encoder, adjusted_mode); | 684 | } else if (type == INTEL_OUTPUT_HDMI) { |
685 | struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder); | ||
686 | |||
687 | if (intel_hdmi->has_audio) { | ||
688 | /* Proper support for digital audio needs a new logic | ||
689 | * and a new set of registers, so we leave it for future | ||
690 | * patch bombing. | ||
691 | */ | ||
692 | DRM_DEBUG_DRIVER("HDMI audio on pipe %c on DDI\n", | ||
693 | pipe_name(intel_crtc->pipe)); | ||
694 | |||
695 | /* write eld */ | ||
696 | DRM_DEBUG_DRIVER("HDMI audio: write eld information\n"); | ||
697 | intel_write_eld(encoder, adjusted_mode); | ||
698 | } | ||
699 | |||
700 | intel_hdmi->set_infoframes(encoder, adjusted_mode); | ||
701 | } | ||
675 | } | 702 | } |
676 | 703 | ||
677 | static struct intel_encoder * | 704 | static struct intel_encoder * |