diff options
author | Jesse Barnes <jbarnes@virtuousgeek.org> | 2011-07-08 14:31:57 -0400 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2011-07-29 13:08:47 -0400 |
commit | b055c8f3ef9f7bc6ba415d900f298d7801a9d1d4 (patch) | |
tree | f9ac04a295263ca94a729ca1e923136c6e2538ec /drivers/gpu/drm/i915/intel_hdmi.c | |
parent | cb0e093162d7b6589c2217a00e2abfef686b32d6 (diff) |
drm/i915/hdmi: send AVI info frames on ILK+ as well
On Ironlake and above, we have per-transcoder DIP registers, so use them
for sending DIPs like AVI infoframes on ILK and above.
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_hdmi.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_hdmi.c | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c index aa0a8e83142e..c220255ef1d9 100644 --- a/drivers/gpu/drm/i915/intel_hdmi.c +++ b/drivers/gpu/drm/i915/intel_hdmi.c | |||
@@ -112,6 +112,40 @@ static void intel_hdmi_set_avi_infoframe(struct drm_encoder *encoder) | |||
112 | VIDEO_DIP_ENABLE_AVI); | 112 | VIDEO_DIP_ENABLE_AVI); |
113 | } | 113 | } |
114 | 114 | ||
115 | static void intel_ironlake_hdmi_set_avi_infoframe(struct drm_encoder *encoder) | ||
116 | { | ||
117 | struct dip_infoframe avi_if = { | ||
118 | .type = DIP_TYPE_AVI, | ||
119 | .ver = DIP_VERSION_AVI, | ||
120 | .len = DIP_LEN_AVI, | ||
121 | }; | ||
122 | uint32_t *data = (uint32_t *)&avi_if; | ||
123 | struct drm_device *dev = encoder->dev; | ||
124 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
125 | struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder); | ||
126 | struct drm_crtc *crtc = encoder->crtc; | ||
127 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | ||
128 | int reg = TVIDEO_DIP_CTL(intel_crtc->pipe); | ||
129 | unsigned i; | ||
130 | |||
131 | if (!intel_hdmi->has_hdmi_sink) | ||
132 | return; | ||
133 | |||
134 | intel_wait_for_vblank(dev, intel_crtc->pipe); | ||
135 | |||
136 | I915_WRITE(reg, VIDEO_DIP_SELECT_AVI); | ||
137 | |||
138 | intel_dip_infoframe_csum(&avi_if); | ||
139 | for (i = 0; i < sizeof(avi_if); i += 4) { | ||
140 | I915_WRITE(TVIDEO_DIP_DATA(intel_crtc->pipe), *data); | ||
141 | data++; | ||
142 | } | ||
143 | |||
144 | I915_WRITE(reg, VIDEO_DIP_ENABLE | VIDEO_DIP_SELECT_AVI | | ||
145 | VIDEO_DIP_FREQ_VSYNC | (DIP_LEN_AVI << 8) | | ||
146 | VIDEO_DIP_ENABLE_AVI); | ||
147 | } | ||
148 | |||
115 | static void intel_hdmi_mode_set(struct drm_encoder *encoder, | 149 | static void intel_hdmi_mode_set(struct drm_encoder *encoder, |
116 | struct drm_display_mode *mode, | 150 | struct drm_display_mode *mode, |
117 | struct drm_display_mode *adjusted_mode) | 151 | struct drm_display_mode *adjusted_mode) |
@@ -149,7 +183,10 @@ static void intel_hdmi_mode_set(struct drm_encoder *encoder, | |||
149 | I915_WRITE(intel_hdmi->sdvox_reg, sdvox); | 183 | I915_WRITE(intel_hdmi->sdvox_reg, sdvox); |
150 | POSTING_READ(intel_hdmi->sdvox_reg); | 184 | POSTING_READ(intel_hdmi->sdvox_reg); |
151 | 185 | ||
152 | intel_hdmi_set_avi_infoframe(encoder); | 186 | if (HAS_PCH_SPLIT(dev)) |
187 | intel_ironlake_hdmi_set_avi_infoframe(encoder); | ||
188 | else | ||
189 | intel_hdmi_set_avi_infoframe(encoder); | ||
153 | } | 190 | } |
154 | 191 | ||
155 | static void intel_hdmi_dpms(struct drm_encoder *encoder, int mode) | 192 | static void intel_hdmi_dpms(struct drm_encoder *encoder, int mode) |