aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_hdmi.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2014-04-24 17:54:52 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-05-16 05:58:26 -0400
commit9ed109a7b445e3f073d8ea72f888ec80c0532465 (patch)
tree97c7aacdad14a14874dda532295cd5e16d266f91 /drivers/gpu/drm/i915/intel_hdmi.c
parentacfa75b02e72bad7c93564ac379712e29c001432 (diff)
drm/i915: Track has_audio in the pipe config
Including state readout and cross-checking. This allows us to get rid of crtc->eld_vld on hsw+. It also means that fastboot will be unhappy if the BIOS hasn't set up the audio routing like we want it too. Wrt fastboot and external screens I see a few options: - Don't. - Try to fix up eld, infoframes and audio settings after the fact. But that means some pretty extensive reworking of our code which currently does all this while the pipe/port is still off. I won't bother with converting SDVO over to this because the audio support for SDVO is very lacking: - We don't update the eld. - We don't update the audio state on the sdvo encoder. - We don't check whether the platform can even feed audio to the sdvo encoder. I've converted hdmi, dp & ddi all in one go since ddi needs both hdmi and dp converted and so doing it step-by-step would have required a few intermediate hacks. Reviewed-by: Naresh Kumar Kachhi <naresh.kumar.kachhi@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_hdmi.c')
-rw-r--r--drivers/gpu/drm/i915/intel_hdmi.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index 9c9698583acf..0894ade01ab8 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -658,7 +658,7 @@ static void intel_hdmi_mode_set(struct intel_encoder *encoder)
658 if (crtc->config.has_hdmi_sink) 658 if (crtc->config.has_hdmi_sink)
659 hdmi_val |= HDMI_MODE_SELECT_HDMI; 659 hdmi_val |= HDMI_MODE_SELECT_HDMI;
660 660
661 if (intel_hdmi->has_audio) { 661 if (crtc->config.has_audio) {
662 WARN_ON(!crtc->config.has_hdmi_sink); 662 WARN_ON(!crtc->config.has_hdmi_sink);
663 DRM_DEBUG_DRIVER("Enabling HDMI audio on pipe %c\n", 663 DRM_DEBUG_DRIVER("Enabling HDMI audio on pipe %c\n",
664 pipe_name(crtc->pipe)); 664 pipe_name(crtc->pipe));
@@ -726,6 +726,9 @@ static void intel_hdmi_get_config(struct intel_encoder *encoder,
726 if (tmp & HDMI_MODE_SELECT_HDMI) 726 if (tmp & HDMI_MODE_SELECT_HDMI)
727 pipe_config->has_hdmi_sink = true; 727 pipe_config->has_hdmi_sink = true;
728 728
729 if (tmp & HDMI_MODE_SELECT_HDMI)
730 pipe_config->has_audio = true;
731
729 pipe_config->adjusted_mode.flags |= flags; 732 pipe_config->adjusted_mode.flags |= flags;
730 733
731 if ((tmp & SDVO_COLOR_FORMAT_MASK) == HDMI_COLOR_FORMAT_12bpc) 734 if ((tmp & SDVO_COLOR_FORMAT_MASK) == HDMI_COLOR_FORMAT_12bpc)
@@ -748,7 +751,7 @@ static void intel_enable_hdmi(struct intel_encoder *encoder)
748 u32 temp; 751 u32 temp;
749 u32 enable_bits = SDVO_ENABLE; 752 u32 enable_bits = SDVO_ENABLE;
750 753
751 if (intel_hdmi->has_audio) 754 if (intel_crtc->config.has_audio)
752 enable_bits |= SDVO_AUDIO_ENABLE; 755 enable_bits |= SDVO_AUDIO_ENABLE;
753 756
754 temp = I915_READ(intel_hdmi->hdmi_reg); 757 temp = I915_READ(intel_hdmi->hdmi_reg);
@@ -919,6 +922,9 @@ bool intel_hdmi_compute_config(struct intel_encoder *encoder,
919 if (HAS_PCH_SPLIT(dev) && !HAS_DDI(dev)) 922 if (HAS_PCH_SPLIT(dev) && !HAS_DDI(dev))
920 pipe_config->has_pch_encoder = true; 923 pipe_config->has_pch_encoder = true;
921 924
925 if (pipe_config->has_hdmi_sink && intel_hdmi->has_audio)
926 pipe_config->has_audio = true;
927
922 /* 928 /*
923 * HDMI is either 12 or 8, so if the display lets 10bpc sneak 929 * HDMI is either 12 or 8, so if the display lets 10bpc sneak
924 * through, clamp it down. Note that g4x/vlv don't support 12bpc hdmi 930 * through, clamp it down. Note that g4x/vlv don't support 12bpc hdmi