aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_hdmi.c
diff options
context:
space:
mode:
authorPaulo Zanoni <paulo.r.zanoni@intel.com>2012-05-28 15:42:50 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-05-30 15:50:33 -0400
commitf278d97215d3cca43aa1569b5ae712cc17e74702 (patch)
treea30372ce2e347499765cdb0550e814d9e86c7913 /drivers/gpu/drm/i915/intel_hdmi.c
parent0c14c7f957e70c3cb100e3fd6553b0ebea557571 (diff)
drm/i915: only set the HDMI port on the DIP once
Not once for each InfoFrame. Now we have a function that allows us to do this. [danvet: Paulo clarified on irc that a later bugfix patch needs this cleanup.] Signed-off-by: Paulo Zanoni <paulo.r.zanoni@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.c56
1 files changed, 31 insertions, 25 deletions
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index 2f2adc4e511c..1df1ec764a01 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -121,18 +121,9 @@ static void g4x_write_infoframe(struct drm_encoder *encoder,
121 uint32_t *data = (uint32_t *)frame; 121 uint32_t *data = (uint32_t *)frame;
122 struct drm_device *dev = encoder->dev; 122 struct drm_device *dev = encoder->dev;
123 struct drm_i915_private *dev_priv = dev->dev_private; 123 struct drm_i915_private *dev_priv = dev->dev_private;
124 struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder);
125 u32 val = I915_READ(VIDEO_DIP_CTL); 124 u32 val = I915_READ(VIDEO_DIP_CTL);
126 unsigned i, len = DIP_HEADER_SIZE + frame->len; 125 unsigned i, len = DIP_HEADER_SIZE + frame->len;
127 126
128 val &= ~VIDEO_DIP_PORT_MASK;
129 if (intel_hdmi->sdvox_reg == SDVOB)
130 val |= VIDEO_DIP_PORT_B;
131 else if (intel_hdmi->sdvox_reg == SDVOC)
132 val |= VIDEO_DIP_PORT_C;
133 else
134 return;
135
136 val &= ~(VIDEO_DIP_SELECT_MASK | 0xf); /* clear DIP data offset */ 127 val &= ~(VIDEO_DIP_SELECT_MASK | 0xf); /* clear DIP data offset */
137 val |= g4x_infoframe_index(frame); 128 val |= g4x_infoframe_index(frame);
138 129
@@ -160,26 +151,10 @@ static void ibx_write_infoframe(struct drm_encoder *encoder,
160 struct drm_device *dev = encoder->dev; 151 struct drm_device *dev = encoder->dev;
161 struct drm_i915_private *dev_priv = dev->dev_private; 152 struct drm_i915_private *dev_priv = dev->dev_private;
162 struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc); 153 struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc);
163 struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder);
164 int reg = TVIDEO_DIP_CTL(intel_crtc->pipe); 154 int reg = TVIDEO_DIP_CTL(intel_crtc->pipe);
165 unsigned i, len = DIP_HEADER_SIZE + frame->len; 155 unsigned i, len = DIP_HEADER_SIZE + frame->len;
166 u32 val = I915_READ(reg); 156 u32 val = I915_READ(reg);
167 157
168 val &= ~VIDEO_DIP_PORT_MASK;
169 switch (intel_hdmi->sdvox_reg) {
170 case HDMIB:
171 val |= VIDEO_DIP_PORT_B;
172 break;
173 case HDMIC:
174 val |= VIDEO_DIP_PORT_C;
175 break;
176 case HDMID:
177 val |= VIDEO_DIP_PORT_D;
178 break;
179 default:
180 return;
181 }
182
183 intel_wait_for_vblank(dev, intel_crtc->pipe); 158 intel_wait_for_vblank(dev, intel_crtc->pipe);
184 159
185 val &= ~(VIDEO_DIP_SELECT_MASK | 0xf); /* clear DIP data offset */ 160 val &= ~(VIDEO_DIP_SELECT_MASK | 0xf); /* clear DIP data offset */
@@ -369,6 +344,20 @@ static void g4x_set_infoframes(struct drm_encoder *encoder,
369 return; 344 return;
370 } 345 }
371 346
347 val &= ~VIDEO_DIP_PORT_MASK;
348 switch (intel_hdmi->sdvox_reg) {
349 case SDVOB:
350 val |= VIDEO_DIP_PORT_B;
351 break;
352 case SDVOC:
353 val |= VIDEO_DIP_PORT_C;
354 break;
355 default:
356 return;
357 }
358
359 I915_WRITE(reg, val);
360
372 intel_hdmi_set_avi_infoframe(encoder, adjusted_mode); 361 intel_hdmi_set_avi_infoframe(encoder, adjusted_mode);
373 intel_hdmi_set_spd_infoframe(encoder); 362 intel_hdmi_set_spd_infoframe(encoder);
374} 363}
@@ -393,6 +382,23 @@ static void ibx_set_infoframes(struct drm_encoder *encoder,
393 return; 382 return;
394 } 383 }
395 384
385 val &= ~VIDEO_DIP_PORT_MASK;
386 switch (intel_hdmi->sdvox_reg) {
387 case HDMIB:
388 val |= VIDEO_DIP_PORT_B;
389 break;
390 case HDMIC:
391 val |= VIDEO_DIP_PORT_C;
392 break;
393 case HDMID:
394 val |= VIDEO_DIP_PORT_D;
395 break;
396 default:
397 return;
398 }
399
400 I915_WRITE(reg, val);
401
396 intel_hdmi_set_avi_infoframe(encoder, adjusted_mode); 402 intel_hdmi_set_avi_infoframe(encoder, adjusted_mode);
397 intel_hdmi_set_spd_infoframe(encoder); 403 intel_hdmi_set_spd_infoframe(encoder);
398} 404}