aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShobhit Kumar <shobhit.kumar@intel.com>2012-03-28 16:39:32 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-03-28 18:00:09 -0400
commit90b107c8f7ea75ef55db4e0515dda86b245f8978 (patch)
treecf39783a1f391fce99fde217298c9a96134b64f0
parent12a3c0551137425a9678d1b9f0495b625550f092 (diff)
drm/i915: Enable HDMI on ValleyView
HDMI register offsets are different in Valleyview. Add support for the same. v2: drop superfluous comments in HDMI init (Daniel) Signed-off-by: Beeresh G <beeresh.g@intel.com> Signed-off-by: Shobhit Kumar <shobhit.kumar@intel.com> Reviewed-by: Vijay Purushothaman <vijay.a.purushothaman@intel.com> Reviewed-by: Jesse Barnes <jesse.barnes@intel.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/i915/i915_reg.h16
-rw-r--r--drivers/gpu/drm/i915/intel_hdmi.c37
2 files changed, 52 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 2f6576d7ba20..841d0d115a00 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -3419,6 +3419,21 @@
3419#define TVIDEO_DIP_DATA(pipe) _PIPE(pipe, _VIDEO_DIP_DATA_A, _VIDEO_DIP_DATA_B) 3419#define TVIDEO_DIP_DATA(pipe) _PIPE(pipe, _VIDEO_DIP_DATA_A, _VIDEO_DIP_DATA_B)
3420#define TVIDEO_DIP_GCP(pipe) _PIPE(pipe, _VIDEO_DIP_GCP_A, _VIDEO_DIP_GCP_B) 3420#define TVIDEO_DIP_GCP(pipe) _PIPE(pipe, _VIDEO_DIP_GCP_A, _VIDEO_DIP_GCP_B)
3421 3421
3422#define VLV_VIDEO_DIP_CTL_A 0x60220
3423#define VLV_VIDEO_DIP_DATA_A 0x60208
3424#define VLV_VIDEO_DIP_GDCP_PAYLOAD_A 0x60210
3425
3426#define VLV_VIDEO_DIP_CTL_B 0x61170
3427#define VLV_VIDEO_DIP_DATA_B 0x61174
3428#define VLV_VIDEO_DIP_GDCP_PAYLOAD_B 0x61178
3429
3430#define VLV_TVIDEO_DIP_CTL(pipe) \
3431 _PIPE(pipe, VLV_VIDEO_DIP_CTL_A, VLV_VIDEO_DIP_CTL_B)
3432#define VLV_TVIDEO_DIP_DATA(pipe) \
3433 _PIPE(pipe, VLV_VIDEO_DIP_DATA_A, VLV_VIDEO_DIP_DATA_B)
3434#define VLV_TVIDEO_DIP_GCP(pipe) \
3435 _PIPE(pipe, VLV_VIDEO_DIP_GDCP_PAYLOAD_A, VLV_VIDEO_DIP_GDCP_PAYLOAD_B)
3436
3422#define _TRANS_HTOTAL_B 0xe1000 3437#define _TRANS_HTOTAL_B 0xe1000
3423#define _TRANS_HBLANK_B 0xe1004 3438#define _TRANS_HBLANK_B 0xe1004
3424#define _TRANS_HSYNC_B 0xe1008 3439#define _TRANS_HSYNC_B 0xe1008
@@ -3639,6 +3654,7 @@
3639#define ADPA_CRT_HOTPLUG_FORCE_TRIGGER (1<<16) 3654#define ADPA_CRT_HOTPLUG_FORCE_TRIGGER (1<<16)
3640 3655
3641/* or SDVOB */ 3656/* or SDVOB */
3657#define VLV_HDMIB 0x61140
3642#define HDMIB 0xe1140 3658#define HDMIB 0xe1140
3643#define PORT_ENABLE (1 << 31) 3659#define PORT_ENABLE (1 << 31)
3644#define TRANSCODER(pipe) ((pipe) << 30) 3660#define TRANSCODER(pipe) ((pipe) << 30)
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index 1d00f61adce6..7de2d3b85b32 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -177,6 +177,37 @@ static void ironlake_write_infoframe(struct drm_encoder *encoder,
177 177
178 I915_WRITE(reg, VIDEO_DIP_ENABLE | val | flags); 178 I915_WRITE(reg, VIDEO_DIP_ENABLE | val | flags);
179} 179}
180
181static void vlv_write_infoframe(struct drm_encoder *encoder,
182 struct dip_infoframe *frame)
183{
184 uint32_t *data = (uint32_t *)frame;
185 struct drm_device *dev = encoder->dev;
186 struct drm_i915_private *dev_priv = dev->dev_private;
187 struct drm_crtc *crtc = encoder->crtc;
188 struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
189 int reg = VLV_TVIDEO_DIP_CTL(intel_crtc->pipe);
190 unsigned i, len = DIP_HEADER_SIZE + frame->len;
191 u32 flags, val = I915_READ(reg);
192
193 intel_wait_for_vblank(dev, intel_crtc->pipe);
194
195 flags = intel_infoframe_index(frame);
196
197 val &= ~(VIDEO_DIP_SELECT_MASK | 0xf); /* clear DIP data offset */
198
199 I915_WRITE(reg, VIDEO_DIP_ENABLE | val | flags);
200
201 for (i = 0; i < len; i += 4) {
202 I915_WRITE(VLV_TVIDEO_DIP_DATA(intel_crtc->pipe), *data);
203 data++;
204 }
205
206 flags |= intel_infoframe_flags(frame);
207
208 I915_WRITE(reg, VIDEO_DIP_ENABLE | val | flags);
209}
210
180static void intel_set_infoframe(struct drm_encoder *encoder, 211static void intel_set_infoframe(struct drm_encoder *encoder,
181 struct dip_infoframe *frame) 212 struct dip_infoframe *frame)
182{ 213{
@@ -552,7 +583,11 @@ void intel_hdmi_init(struct drm_device *dev, int sdvox_reg)
552 if (!HAS_PCH_SPLIT(dev)) { 583 if (!HAS_PCH_SPLIT(dev)) {
553 intel_hdmi->write_infoframe = i9xx_write_infoframe; 584 intel_hdmi->write_infoframe = i9xx_write_infoframe;
554 I915_WRITE(VIDEO_DIP_CTL, 0); 585 I915_WRITE(VIDEO_DIP_CTL, 0);
555 } else { 586 } else if (IS_VALLEYVIEW(dev)) {
587 intel_hdmi->write_infoframe = vlv_write_infoframe;
588 for_each_pipe(i)
589 I915_WRITE(VLV_TVIDEO_DIP_CTL(i), 0);
590 } else {
556 intel_hdmi->write_infoframe = ironlake_write_infoframe; 591 intel_hdmi->write_infoframe = ironlake_write_infoframe;
557 for_each_pipe(i) 592 for_each_pipe(i)
558 I915_WRITE(TVIDEO_DIP_CTL(i), 0); 593 I915_WRITE(TVIDEO_DIP_CTL(i), 0);