blob: a7871b18c201040cb110d19195a4f9b37269af14 [file] [log] [blame]
Eric Anholt7d573822009-01-02 13:33:00 -08001/*
2 * Copyright 2006 Dave Airlie <airlied@linux.ie>
3 * Copyright © 2006-2009 Intel Corporation
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice (including the next
13 * paragraph) shall be included in all copies or substantial portions of the
14 * Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 *
24 * Authors:
25 * Eric Anholt <eric@anholt.net>
26 * Jesse Barnes <jesse.barnes@intel.com>
27 */
28
29#include <linux/i2c.h>
Tejun Heo5a0e3ad2010-03-24 17:04:11 +090030#include <linux/slab.h>
Eric Anholt7d573822009-01-02 13:33:00 -080031#include <linux/delay.h>
32#include "drmP.h"
33#include "drm.h"
34#include "drm_crtc.h"
Keith Packardaa93d632009-05-05 09:52:46 -070035#include "drm_edid.h"
Eric Anholt7d573822009-01-02 13:33:00 -080036#include "intel_drv.h"
37#include "i915_drm.h"
38#include "i915_drv.h"
39
Eugeni Dodonovf5bbfca2012-05-09 15:37:30 -030040struct intel_hdmi *enc_to_intel_hdmi(struct drm_encoder *encoder)
Chris Wilsonea5b2132010-08-04 13:50:23 +010041{
Chris Wilson4ef69c72010-09-09 15:14:28 +010042 return container_of(encoder, struct intel_hdmi, base.base);
Chris Wilsonea5b2132010-08-04 13:50:23 +010043}
44
Chris Wilsondf0e9242010-09-09 16:20:55 +010045static struct intel_hdmi *intel_attached_hdmi(struct drm_connector *connector)
46{
47 return container_of(intel_attached_encoder(connector),
48 struct intel_hdmi, base);
49}
50
Jesse Barnes45187ac2011-08-03 09:22:55 -070051void intel_dip_infoframe_csum(struct dip_infoframe *frame)
David Härdeman3c17fe42010-09-24 21:44:32 +020052{
Jesse Barnes45187ac2011-08-03 09:22:55 -070053 uint8_t *data = (uint8_t *)frame;
David Härdeman3c17fe42010-09-24 21:44:32 +020054 uint8_t sum = 0;
55 unsigned i;
56
Jesse Barnes45187ac2011-08-03 09:22:55 -070057 frame->checksum = 0;
58 frame->ecc = 0;
David Härdeman3c17fe42010-09-24 21:44:32 +020059
Jesse Barnes64a8fc02011-09-22 11:16:00 +053060 for (i = 0; i < frame->len + DIP_HEADER_SIZE; i++)
David Härdeman3c17fe42010-09-24 21:44:32 +020061 sum += data[i];
62
Jesse Barnes45187ac2011-08-03 09:22:55 -070063 frame->checksum = 0x100 - sum;
David Härdeman3c17fe42010-09-24 21:44:32 +020064}
65
Daniel Vetterbc2481f2012-05-08 15:18:32 +020066static u32 g4x_infoframe_index(struct dip_infoframe *frame)
David Härdeman3c17fe42010-09-24 21:44:32 +020067{
Jesse Barnes45187ac2011-08-03 09:22:55 -070068 u32 flags = 0;
69
70 switch (frame->type) {
71 case DIP_TYPE_AVI:
72 flags |= VIDEO_DIP_SELECT_AVI;
73 break;
74 case DIP_TYPE_SPD:
75 flags |= VIDEO_DIP_SELECT_SPD;
76 break;
77 default:
78 DRM_DEBUG_DRIVER("unknown info frame type %d\n", frame->type);
79 break;
80 }
81
82 return flags;
83}
84
Daniel Vetterbc2481f2012-05-08 15:18:32 +020085static u32 g4x_infoframe_enable(struct dip_infoframe *frame)
Jesse Barnes45187ac2011-08-03 09:22:55 -070086{
87 u32 flags = 0;
88
89 switch (frame->type) {
90 case DIP_TYPE_AVI:
Paulo Zanonifa193ff2012-05-04 17:18:20 -030091 flags |= VIDEO_DIP_ENABLE_AVI;
Jesse Barnes45187ac2011-08-03 09:22:55 -070092 break;
93 case DIP_TYPE_SPD:
Paulo Zanonifa193ff2012-05-04 17:18:20 -030094 flags |= VIDEO_DIP_ENABLE_SPD;
95 break;
96 default:
97 DRM_DEBUG_DRIVER("unknown info frame type %d\n", frame->type);
98 break;
99 }
100
101 return flags;
102}
103
Daniel Vettera3da1df2012-05-08 15:19:06 +0200104static void g4x_write_infoframe(struct drm_encoder *encoder,
105 struct dip_infoframe *frame)
Jesse Barnes45187ac2011-08-03 09:22:55 -0700106{
107 uint32_t *data = (uint32_t *)frame;
David Härdeman3c17fe42010-09-24 21:44:32 +0200108 struct drm_device *dev = encoder->dev;
109 struct drm_i915_private *dev_priv = dev->dev_private;
110 struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder);
Paulo Zanoni22509ec2012-05-04 17:18:17 -0300111 u32 val = I915_READ(VIDEO_DIP_CTL);
Jesse Barnes45187ac2011-08-03 09:22:55 -0700112 unsigned i, len = DIP_HEADER_SIZE + frame->len;
David Härdeman3c17fe42010-09-24 21:44:32 +0200113
David Härdeman3c17fe42010-09-24 21:44:32 +0200114
115 /* XXX first guess at handling video port, is this corrent? */
Paulo Zanoni3e6e6392012-05-04 17:18:19 -0300116 val &= ~VIDEO_DIP_PORT_MASK;
David Härdeman3c17fe42010-09-24 21:44:32 +0200117 if (intel_hdmi->sdvox_reg == SDVOB)
Paulo Zanoni22509ec2012-05-04 17:18:17 -0300118 val |= VIDEO_DIP_PORT_B;
David Härdeman3c17fe42010-09-24 21:44:32 +0200119 else if (intel_hdmi->sdvox_reg == SDVOC)
Paulo Zanoni22509ec2012-05-04 17:18:17 -0300120 val |= VIDEO_DIP_PORT_C;
David Härdeman3c17fe42010-09-24 21:44:32 +0200121 else
122 return;
123
Paulo Zanoni1d4f85a2012-05-04 17:18:18 -0300124 val &= ~(VIDEO_DIP_SELECT_MASK | 0xf); /* clear DIP data offset */
Daniel Vetterbc2481f2012-05-08 15:18:32 +0200125 val |= g4x_infoframe_index(frame);
Jesse Barnes45187ac2011-08-03 09:22:55 -0700126
Daniel Vetterbc2481f2012-05-08 15:18:32 +0200127 val &= ~g4x_infoframe_enable(frame);
Paulo Zanoni22509ec2012-05-04 17:18:17 -0300128 val |= VIDEO_DIP_ENABLE;
129
130 I915_WRITE(VIDEO_DIP_CTL, val);
Jesse Barnes45187ac2011-08-03 09:22:55 -0700131
132 for (i = 0; i < len; i += 4) {
David Härdeman3c17fe42010-09-24 21:44:32 +0200133 I915_WRITE(VIDEO_DIP_DATA, *data);
134 data++;
135 }
136
Daniel Vetterbc2481f2012-05-08 15:18:32 +0200137 val |= g4x_infoframe_enable(frame);
Paulo Zanoni60c5ea22012-05-04 17:18:22 -0300138 val &= ~VIDEO_DIP_FREQ_MASK;
Daniel Vetter4b24c932012-05-08 14:41:00 +0200139 val |= VIDEO_DIP_FREQ_VSYNC;
Jesse Barnes45187ac2011-08-03 09:22:55 -0700140
Paulo Zanoni22509ec2012-05-04 17:18:17 -0300141 I915_WRITE(VIDEO_DIP_CTL, val);
David Härdeman3c17fe42010-09-24 21:44:32 +0200142}
143
Paulo Zanonifdf12502012-05-04 17:18:24 -0300144static void ibx_write_infoframe(struct drm_encoder *encoder,
145 struct dip_infoframe *frame)
146{
147 uint32_t *data = (uint32_t *)frame;
148 struct drm_device *dev = encoder->dev;
149 struct drm_i915_private *dev_priv = dev->dev_private;
150 struct drm_crtc *crtc = encoder->crtc;
151 struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
Paulo Zanoni4e89ee12012-05-04 17:18:26 -0300152 struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder);
Paulo Zanonifdf12502012-05-04 17:18:24 -0300153 int reg = TVIDEO_DIP_CTL(intel_crtc->pipe);
154 unsigned i, len = DIP_HEADER_SIZE + frame->len;
155 u32 val = I915_READ(reg);
156
Paulo Zanoni4e89ee12012-05-04 17:18:26 -0300157 val &= ~VIDEO_DIP_PORT_MASK;
158 switch (intel_hdmi->sdvox_reg) {
159 case HDMIB:
160 val |= VIDEO_DIP_PORT_B;
161 break;
162 case HDMIC:
163 val |= VIDEO_DIP_PORT_C;
164 break;
165 case HDMID:
166 val |= VIDEO_DIP_PORT_D;
167 break;
168 default:
169 return;
170 }
171
Paulo Zanonifdf12502012-05-04 17:18:24 -0300172 intel_wait_for_vblank(dev, intel_crtc->pipe);
173
174 val &= ~(VIDEO_DIP_SELECT_MASK | 0xf); /* clear DIP data offset */
Daniel Vetterbc2481f2012-05-08 15:18:32 +0200175 val |= g4x_infoframe_index(frame);
Paulo Zanonifdf12502012-05-04 17:18:24 -0300176
Daniel Vetterbc2481f2012-05-08 15:18:32 +0200177 val &= ~g4x_infoframe_enable(frame);
Paulo Zanonifdf12502012-05-04 17:18:24 -0300178 val |= VIDEO_DIP_ENABLE;
179
180 I915_WRITE(reg, val);
181
182 for (i = 0; i < len; i += 4) {
183 I915_WRITE(TVIDEO_DIP_DATA(intel_crtc->pipe), *data);
184 data++;
185 }
186
Daniel Vetterbc2481f2012-05-08 15:18:32 +0200187 val |= g4x_infoframe_enable(frame);
Paulo Zanonifdf12502012-05-04 17:18:24 -0300188 val &= ~VIDEO_DIP_FREQ_MASK;
Daniel Vetter4b24c932012-05-08 14:41:00 +0200189 val |= VIDEO_DIP_FREQ_VSYNC;
Paulo Zanonifdf12502012-05-04 17:18:24 -0300190
191 I915_WRITE(reg, val);
192}
193
194static void cpt_write_infoframe(struct drm_encoder *encoder,
195 struct dip_infoframe *frame)
Jesse Barnes45187ac2011-08-03 09:22:55 -0700196{
197 uint32_t *data = (uint32_t *)frame;
198 struct drm_device *dev = encoder->dev;
199 struct drm_i915_private *dev_priv = dev->dev_private;
200 struct drm_crtc *crtc = encoder->crtc;
201 struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
202 int reg = TVIDEO_DIP_CTL(intel_crtc->pipe);
203 unsigned i, len = DIP_HEADER_SIZE + frame->len;
Paulo Zanoni22509ec2012-05-04 17:18:17 -0300204 u32 val = I915_READ(reg);
Jesse Barnes45187ac2011-08-03 09:22:55 -0700205
206 intel_wait_for_vblank(dev, intel_crtc->pipe);
207
Jesse Barnes64a8fc02011-09-22 11:16:00 +0530208 val &= ~(VIDEO_DIP_SELECT_MASK | 0xf); /* clear DIP data offset */
Daniel Vetterbc2481f2012-05-08 15:18:32 +0200209 val |= g4x_infoframe_index(frame);
Jesse Barnes45187ac2011-08-03 09:22:55 -0700210
Paulo Zanoniecb97852012-05-04 17:18:21 -0300211 /* The DIP control register spec says that we need to update the AVI
212 * infoframe without clearing its enable bit */
213 if (frame->type == DIP_TYPE_AVI)
214 val |= VIDEO_DIP_ENABLE_AVI;
215 else
Daniel Vetterbc2481f2012-05-08 15:18:32 +0200216 val &= ~g4x_infoframe_enable(frame);
Paulo Zanoniecb97852012-05-04 17:18:21 -0300217
Paulo Zanoni22509ec2012-05-04 17:18:17 -0300218 val |= VIDEO_DIP_ENABLE;
219
220 I915_WRITE(reg, val);
Jesse Barnes45187ac2011-08-03 09:22:55 -0700221
222 for (i = 0; i < len; i += 4) {
223 I915_WRITE(TVIDEO_DIP_DATA(intel_crtc->pipe), *data);
224 data++;
225 }
226
Daniel Vetterbc2481f2012-05-08 15:18:32 +0200227 val |= g4x_infoframe_enable(frame);
Paulo Zanoni60c5ea22012-05-04 17:18:22 -0300228 val &= ~VIDEO_DIP_FREQ_MASK;
Daniel Vetter4b24c932012-05-08 14:41:00 +0200229 val |= VIDEO_DIP_FREQ_VSYNC;
Jesse Barnes45187ac2011-08-03 09:22:55 -0700230
Paulo Zanoni22509ec2012-05-04 17:18:17 -0300231 I915_WRITE(reg, val);
Jesse Barnes45187ac2011-08-03 09:22:55 -0700232}
Shobhit Kumar90b107c2012-03-28 13:39:32 -0700233
234static void vlv_write_infoframe(struct drm_encoder *encoder,
235 struct dip_infoframe *frame)
236{
237 uint32_t *data = (uint32_t *)frame;
238 struct drm_device *dev = encoder->dev;
239 struct drm_i915_private *dev_priv = dev->dev_private;
240 struct drm_crtc *crtc = encoder->crtc;
241 struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
242 int reg = VLV_TVIDEO_DIP_CTL(intel_crtc->pipe);
243 unsigned i, len = DIP_HEADER_SIZE + frame->len;
Paulo Zanoni22509ec2012-05-04 17:18:17 -0300244 u32 val = I915_READ(reg);
Shobhit Kumar90b107c2012-03-28 13:39:32 -0700245
246 intel_wait_for_vblank(dev, intel_crtc->pipe);
247
Shobhit Kumar90b107c2012-03-28 13:39:32 -0700248 val &= ~(VIDEO_DIP_SELECT_MASK | 0xf); /* clear DIP data offset */
Daniel Vetterbc2481f2012-05-08 15:18:32 +0200249 val |= g4x_infoframe_index(frame);
Shobhit Kumar90b107c2012-03-28 13:39:32 -0700250
Daniel Vetterbc2481f2012-05-08 15:18:32 +0200251 val &= ~g4x_infoframe_enable(frame);
Paulo Zanoni22509ec2012-05-04 17:18:17 -0300252 val |= VIDEO_DIP_ENABLE;
253
254 I915_WRITE(reg, val);
Shobhit Kumar90b107c2012-03-28 13:39:32 -0700255
256 for (i = 0; i < len; i += 4) {
257 I915_WRITE(VLV_TVIDEO_DIP_DATA(intel_crtc->pipe), *data);
258 data++;
259 }
260
Daniel Vetterbc2481f2012-05-08 15:18:32 +0200261 val |= g4x_infoframe_enable(frame);
Paulo Zanoni60c5ea22012-05-04 17:18:22 -0300262 val &= ~VIDEO_DIP_FREQ_MASK;
Daniel Vetter4b24c932012-05-08 14:41:00 +0200263 val |= VIDEO_DIP_FREQ_VSYNC;
Shobhit Kumar90b107c2012-03-28 13:39:32 -0700264
Paulo Zanoni22509ec2012-05-04 17:18:17 -0300265 I915_WRITE(reg, val);
Shobhit Kumar90b107c2012-03-28 13:39:32 -0700266}
267
Eugeni Dodonov8c5f5f72012-05-10 10:18:02 -0300268static void hsw_write_infoframe(struct drm_encoder *encoder,
269 struct dip_infoframe *frame)
270{
271 /* Not implemented yet, so avoid doing anything at all.
272 * This is the placeholder for Paulo Zanoni's infoframe writing patch
273 */
274 DRM_DEBUG_DRIVER("Attempting to write infoframe on Haswell, this is not implemented yet.\n");
275
276 return;
277
278}
279
Jesse Barnes45187ac2011-08-03 09:22:55 -0700280static void intel_set_infoframe(struct drm_encoder *encoder,
281 struct dip_infoframe *frame)
282{
283 struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder);
284
285 if (!intel_hdmi->has_hdmi_sink)
286 return;
287
288 intel_dip_infoframe_csum(frame);
289 intel_hdmi->write_infoframe(encoder, frame);
290}
291
Eugeni Dodonovf5bbfca2012-05-09 15:37:30 -0300292void intel_hdmi_set_avi_infoframe(struct drm_encoder *encoder,
Paulo Zanonic846b612012-04-13 16:31:41 -0300293 struct drm_display_mode *adjusted_mode)
Jesse Barnesb055c8f2011-07-08 11:31:57 -0700294{
295 struct dip_infoframe avi_if = {
296 .type = DIP_TYPE_AVI,
297 .ver = DIP_VERSION_AVI,
298 .len = DIP_LEN_AVI,
299 };
Jesse Barnesb055c8f2011-07-08 11:31:57 -0700300
Paulo Zanonic846b612012-04-13 16:31:41 -0300301 if (adjusted_mode->flags & DRM_MODE_FLAG_DBLCLK)
302 avi_if.body.avi.YQ_CN_PR |= DIP_AVI_PR_2;
303
Jesse Barnes45187ac2011-08-03 09:22:55 -0700304 intel_set_infoframe(encoder, &avi_if);
Jesse Barnesb055c8f2011-07-08 11:31:57 -0700305}
306
Eugeni Dodonovf5bbfca2012-05-09 15:37:30 -0300307void intel_hdmi_set_spd_infoframe(struct drm_encoder *encoder)
Jesse Barnesc0864cb2011-08-03 09:22:56 -0700308{
309 struct dip_infoframe spd_if;
310
311 memset(&spd_if, 0, sizeof(spd_if));
312 spd_if.type = DIP_TYPE_SPD;
313 spd_if.ver = DIP_VERSION_SPD;
314 spd_if.len = DIP_LEN_SPD;
315 strcpy(spd_if.body.spd.vn, "Intel");
316 strcpy(spd_if.body.spd.pd, "Integrated gfx");
317 spd_if.body.spd.sdi = DIP_SPD_PC;
318
319 intel_set_infoframe(encoder, &spd_if);
320}
321
Eric Anholt7d573822009-01-02 13:33:00 -0800322static void intel_hdmi_mode_set(struct drm_encoder *encoder,
323 struct drm_display_mode *mode,
324 struct drm_display_mode *adjusted_mode)
325{
326 struct drm_device *dev = encoder->dev;
327 struct drm_i915_private *dev_priv = dev->dev_private;
328 struct drm_crtc *crtc = encoder->crtc;
329 struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
Chris Wilsonea5b2132010-08-04 13:50:23 +0100330 struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder);
Eric Anholt7d573822009-01-02 13:33:00 -0800331 u32 sdvox;
332
Adam Jacksonb599c0b2010-07-16 14:46:31 -0400333 sdvox = SDVO_ENCODING_HDMI | SDVO_BORDER_ENABLE;
Jesse Barnes5d4fac92011-06-24 12:19:19 -0700334 if (!HAS_PCH_SPLIT(dev))
335 sdvox |= intel_hdmi->color_range;
Adam Jacksonb599c0b2010-07-16 14:46:31 -0400336 if (adjusted_mode->flags & DRM_MODE_FLAG_PVSYNC)
337 sdvox |= SDVO_VSYNC_ACTIVE_HIGH;
338 if (adjusted_mode->flags & DRM_MODE_FLAG_PHSYNC)
339 sdvox |= SDVO_HSYNC_ACTIVE_HIGH;
Eric Anholt7d573822009-01-02 13:33:00 -0800340
Jesse Barnes020f6702011-06-24 12:19:25 -0700341 if (intel_crtc->bpp > 24)
342 sdvox |= COLOR_FORMAT_12bpc;
343 else
344 sdvox |= COLOR_FORMAT_8bpc;
345
Zhenyu Wang2e3d6002010-09-10 10:39:40 +0800346 /* Required on CPT */
347 if (intel_hdmi->has_hdmi_sink && HAS_PCH_CPT(dev))
348 sdvox |= HDMI_MODE_SELECT;
349
David Härdeman3c17fe42010-09-24 21:44:32 +0200350 if (intel_hdmi->has_audio) {
Wu Fengguange0dac652011-09-05 14:25:34 +0800351 DRM_DEBUG_DRIVER("Enabling HDMI audio on pipe %c\n",
352 pipe_name(intel_crtc->pipe));
Eric Anholt7d573822009-01-02 13:33:00 -0800353 sdvox |= SDVO_AUDIO_ENABLE;
David Härdeman3c17fe42010-09-24 21:44:32 +0200354 sdvox |= SDVO_NULL_PACKETS_DURING_VSYNC;
Wu Fengguange0dac652011-09-05 14:25:34 +0800355 intel_write_eld(encoder, adjusted_mode);
David Härdeman3c17fe42010-09-24 21:44:32 +0200356 }
Eric Anholt7d573822009-01-02 13:33:00 -0800357
Jesse Barnes75770562011-10-12 09:01:58 -0700358 if (HAS_PCH_CPT(dev))
359 sdvox |= PORT_TRANS_SEL_CPT(intel_crtc->pipe);
360 else if (intel_crtc->pipe == 1)
361 sdvox |= SDVO_PIPE_B_SELECT;
Eric Anholt7d573822009-01-02 13:33:00 -0800362
Chris Wilsonea5b2132010-08-04 13:50:23 +0100363 I915_WRITE(intel_hdmi->sdvox_reg, sdvox);
364 POSTING_READ(intel_hdmi->sdvox_reg);
David Härdeman3c17fe42010-09-24 21:44:32 +0200365
Paulo Zanonic846b612012-04-13 16:31:41 -0300366 intel_hdmi_set_avi_infoframe(encoder, adjusted_mode);
Jesse Barnesc0864cb2011-08-03 09:22:56 -0700367 intel_hdmi_set_spd_infoframe(encoder);
Eric Anholt7d573822009-01-02 13:33:00 -0800368}
369
370static void intel_hdmi_dpms(struct drm_encoder *encoder, int mode)
371{
372 struct drm_device *dev = encoder->dev;
373 struct drm_i915_private *dev_priv = dev->dev_private;
Chris Wilsonea5b2132010-08-04 13:50:23 +0100374 struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder);
Eric Anholt7d573822009-01-02 13:33:00 -0800375 u32 temp;
Wu Fengguang2deed762011-12-09 20:42:20 +0800376 u32 enable_bits = SDVO_ENABLE;
377
378 if (intel_hdmi->has_audio)
379 enable_bits |= SDVO_AUDIO_ENABLE;
Eric Anholt7d573822009-01-02 13:33:00 -0800380
Chris Wilsonea5b2132010-08-04 13:50:23 +0100381 temp = I915_READ(intel_hdmi->sdvox_reg);
Zhenyu Wangd8a2d0e2009-11-02 07:52:30 +0000382
383 /* HW workaround, need to toggle enable bit off and on for 12bpc, but
384 * we do this anyway which shows more stable in testing.
385 */
Eric Anholtc619eed2010-01-28 16:45:52 -0800386 if (HAS_PCH_SPLIT(dev)) {
Chris Wilsonea5b2132010-08-04 13:50:23 +0100387 I915_WRITE(intel_hdmi->sdvox_reg, temp & ~SDVO_ENABLE);
388 POSTING_READ(intel_hdmi->sdvox_reg);
Eric Anholt7d573822009-01-02 13:33:00 -0800389 }
Zhenyu Wangd8a2d0e2009-11-02 07:52:30 +0000390
391 if (mode != DRM_MODE_DPMS_ON) {
Wu Fengguang2deed762011-12-09 20:42:20 +0800392 temp &= ~enable_bits;
Zhenyu Wangd8a2d0e2009-11-02 07:52:30 +0000393 } else {
Wu Fengguang2deed762011-12-09 20:42:20 +0800394 temp |= enable_bits;
Zhenyu Wangd8a2d0e2009-11-02 07:52:30 +0000395 }
396
Chris Wilsonea5b2132010-08-04 13:50:23 +0100397 I915_WRITE(intel_hdmi->sdvox_reg, temp);
398 POSTING_READ(intel_hdmi->sdvox_reg);
Zhenyu Wangd8a2d0e2009-11-02 07:52:30 +0000399
400 /* HW workaround, need to write this twice for issue that may result
401 * in first write getting masked.
402 */
Eric Anholtc619eed2010-01-28 16:45:52 -0800403 if (HAS_PCH_SPLIT(dev)) {
Chris Wilsonea5b2132010-08-04 13:50:23 +0100404 I915_WRITE(intel_hdmi->sdvox_reg, temp);
405 POSTING_READ(intel_hdmi->sdvox_reg);
Zhenyu Wangd8a2d0e2009-11-02 07:52:30 +0000406 }
Eric Anholt7d573822009-01-02 13:33:00 -0800407}
408
Eric Anholt7d573822009-01-02 13:33:00 -0800409static int intel_hdmi_mode_valid(struct drm_connector *connector,
410 struct drm_display_mode *mode)
411{
412 if (mode->clock > 165000)
413 return MODE_CLOCK_HIGH;
414 if (mode->clock < 20000)
Nicolas Kaiser5cbba412011-05-30 12:48:26 +0200415 return MODE_CLOCK_LOW;
Eric Anholt7d573822009-01-02 13:33:00 -0800416
417 if (mode->flags & DRM_MODE_FLAG_DBLSCAN)
418 return MODE_NO_DBLESCAN;
419
420 return MODE_OK;
421}
422
423static bool intel_hdmi_mode_fixup(struct drm_encoder *encoder,
424 struct drm_display_mode *mode,
425 struct drm_display_mode *adjusted_mode)
426{
427 return true;
428}
429
Keith Packardaa93d632009-05-05 09:52:46 -0700430static enum drm_connector_status
Chris Wilson930a9e22010-09-14 11:07:23 +0100431intel_hdmi_detect(struct drm_connector *connector, bool force)
Ma Ling9dff6af2009-04-02 13:13:26 +0800432{
Chris Wilsondf0e9242010-09-09 16:20:55 +0100433 struct intel_hdmi *intel_hdmi = intel_attached_hdmi(connector);
Chris Wilsonf899fc62010-07-20 15:44:45 -0700434 struct drm_i915_private *dev_priv = connector->dev->dev_private;
435 struct edid *edid;
Keith Packardaa93d632009-05-05 09:52:46 -0700436 enum drm_connector_status status = connector_status_disconnected;
Ma Ling9dff6af2009-04-02 13:13:26 +0800437
Chris Wilsonea5b2132010-08-04 13:50:23 +0100438 intel_hdmi->has_hdmi_sink = false;
Zhenyu Wang2e3d6002010-09-10 10:39:40 +0800439 intel_hdmi->has_audio = false;
Chris Wilsonf899fc62010-07-20 15:44:45 -0700440 edid = drm_get_edid(connector,
Daniel Kurtz3bd7d902012-03-28 02:36:14 +0800441 intel_gmbus_get_adapter(dev_priv,
442 intel_hdmi->ddc_bus));
ling.ma@intel.com2ded9e22009-07-16 17:23:09 +0800443
Keith Packardaa93d632009-05-05 09:52:46 -0700444 if (edid) {
Eric Anholtbe9f1c42009-06-21 22:14:55 -0700445 if (edid->input & DRM_EDID_INPUT_DIGITAL) {
Keith Packardaa93d632009-05-05 09:52:46 -0700446 status = connector_status_connected;
Wu Fengguangb1d7e4b2012-02-14 11:45:36 +0800447 if (intel_hdmi->force_audio != HDMI_AUDIO_OFF_DVI)
448 intel_hdmi->has_hdmi_sink =
449 drm_detect_hdmi_monitor(edid);
Zhenyu Wang2e3d6002010-09-10 10:39:40 +0800450 intel_hdmi->has_audio = drm_detect_monitor_audio(edid);
Keith Packardaa93d632009-05-05 09:52:46 -0700451 }
Zhenyu Wang674e2d02010-03-29 15:57:42 +0800452 connector->display_info.raw_edid = NULL;
Keith Packardaa93d632009-05-05 09:52:46 -0700453 kfree(edid);
Ma Ling9dff6af2009-04-02 13:13:26 +0800454 }
ling.ma@intel.com2ded9e22009-07-16 17:23:09 +0800455
Chris Wilson55b7d6e82010-09-19 09:29:33 +0100456 if (status == connector_status_connected) {
Wu Fengguangb1d7e4b2012-02-14 11:45:36 +0800457 if (intel_hdmi->force_audio != HDMI_AUDIO_AUTO)
458 intel_hdmi->has_audio =
459 (intel_hdmi->force_audio == HDMI_AUDIO_ON);
Chris Wilson55b7d6e82010-09-19 09:29:33 +0100460 }
461
Keith Packardaa93d632009-05-05 09:52:46 -0700462 return status;
Ma Ling9dff6af2009-04-02 13:13:26 +0800463}
464
Eric Anholt7d573822009-01-02 13:33:00 -0800465static int intel_hdmi_get_modes(struct drm_connector *connector)
466{
Chris Wilsondf0e9242010-09-09 16:20:55 +0100467 struct intel_hdmi *intel_hdmi = intel_attached_hdmi(connector);
Chris Wilsonf899fc62010-07-20 15:44:45 -0700468 struct drm_i915_private *dev_priv = connector->dev->dev_private;
Eric Anholt7d573822009-01-02 13:33:00 -0800469
470 /* We should parse the EDID data and find out if it's an HDMI sink so
471 * we can send audio to it.
472 */
473
Chris Wilsonf899fc62010-07-20 15:44:45 -0700474 return intel_ddc_get_modes(connector,
Daniel Kurtz3bd7d902012-03-28 02:36:14 +0800475 intel_gmbus_get_adapter(dev_priv,
476 intel_hdmi->ddc_bus));
Eric Anholt7d573822009-01-02 13:33:00 -0800477}
478
Chris Wilson1aad7ac2011-02-09 18:46:58 +0000479static bool
480intel_hdmi_detect_audio(struct drm_connector *connector)
481{
482 struct intel_hdmi *intel_hdmi = intel_attached_hdmi(connector);
483 struct drm_i915_private *dev_priv = connector->dev->dev_private;
484 struct edid *edid;
485 bool has_audio = false;
486
487 edid = drm_get_edid(connector,
Daniel Kurtz3bd7d902012-03-28 02:36:14 +0800488 intel_gmbus_get_adapter(dev_priv,
489 intel_hdmi->ddc_bus));
Chris Wilson1aad7ac2011-02-09 18:46:58 +0000490 if (edid) {
491 if (edid->input & DRM_EDID_INPUT_DIGITAL)
492 has_audio = drm_detect_monitor_audio(edid);
493
494 connector->display_info.raw_edid = NULL;
495 kfree(edid);
496 }
497
498 return has_audio;
499}
500
Chris Wilson55b7d6e82010-09-19 09:29:33 +0100501static int
502intel_hdmi_set_property(struct drm_connector *connector,
503 struct drm_property *property,
504 uint64_t val)
505{
506 struct intel_hdmi *intel_hdmi = intel_attached_hdmi(connector);
Chris Wilsone953fd72011-02-21 22:23:52 +0000507 struct drm_i915_private *dev_priv = connector->dev->dev_private;
Chris Wilson55b7d6e82010-09-19 09:29:33 +0100508 int ret;
509
510 ret = drm_connector_property_set_value(connector, property, val);
511 if (ret)
512 return ret;
513
Chris Wilson3f43c482011-05-12 22:17:24 +0100514 if (property == dev_priv->force_audio_property) {
Wu Fengguangb1d7e4b2012-02-14 11:45:36 +0800515 enum hdmi_force_audio i = val;
Chris Wilson1aad7ac2011-02-09 18:46:58 +0000516 bool has_audio;
517
518 if (i == intel_hdmi->force_audio)
Chris Wilson55b7d6e82010-09-19 09:29:33 +0100519 return 0;
520
Chris Wilson1aad7ac2011-02-09 18:46:58 +0000521 intel_hdmi->force_audio = i;
Chris Wilson55b7d6e82010-09-19 09:29:33 +0100522
Wu Fengguangb1d7e4b2012-02-14 11:45:36 +0800523 if (i == HDMI_AUDIO_AUTO)
Chris Wilson1aad7ac2011-02-09 18:46:58 +0000524 has_audio = intel_hdmi_detect_audio(connector);
525 else
Wu Fengguangb1d7e4b2012-02-14 11:45:36 +0800526 has_audio = (i == HDMI_AUDIO_ON);
Chris Wilson1aad7ac2011-02-09 18:46:58 +0000527
Wu Fengguangb1d7e4b2012-02-14 11:45:36 +0800528 if (i == HDMI_AUDIO_OFF_DVI)
529 intel_hdmi->has_hdmi_sink = 0;
Chris Wilson55b7d6e82010-09-19 09:29:33 +0100530
Chris Wilson1aad7ac2011-02-09 18:46:58 +0000531 intel_hdmi->has_audio = has_audio;
Chris Wilson55b7d6e82010-09-19 09:29:33 +0100532 goto done;
533 }
534
Chris Wilsone953fd72011-02-21 22:23:52 +0000535 if (property == dev_priv->broadcast_rgb_property) {
536 if (val == !!intel_hdmi->color_range)
537 return 0;
538
539 intel_hdmi->color_range = val ? SDVO_COLOR_RANGE_16_235 : 0;
540 goto done;
541 }
542
Chris Wilson55b7d6e82010-09-19 09:29:33 +0100543 return -EINVAL;
544
545done:
546 if (intel_hdmi->base.base.crtc) {
547 struct drm_crtc *crtc = intel_hdmi->base.base.crtc;
548 drm_crtc_helper_set_mode(crtc, &crtc->mode,
549 crtc->x, crtc->y,
550 crtc->fb);
551 }
552
553 return 0;
554}
555
Eric Anholt7d573822009-01-02 13:33:00 -0800556static void intel_hdmi_destroy(struct drm_connector *connector)
557{
Eric Anholt7d573822009-01-02 13:33:00 -0800558 drm_sysfs_connector_remove(connector);
559 drm_connector_cleanup(connector);
Zhenyu Wang674e2d02010-03-29 15:57:42 +0800560 kfree(connector);
Eric Anholt7d573822009-01-02 13:33:00 -0800561}
562
563static const struct drm_encoder_helper_funcs intel_hdmi_helper_funcs = {
564 .dpms = intel_hdmi_dpms,
565 .mode_fixup = intel_hdmi_mode_fixup,
566 .prepare = intel_encoder_prepare,
567 .mode_set = intel_hdmi_mode_set,
568 .commit = intel_encoder_commit,
569};
570
571static const struct drm_connector_funcs intel_hdmi_connector_funcs = {
Keith Packardc9fb15f2009-05-30 20:42:28 -0700572 .dpms = drm_helper_connector_dpms,
Eric Anholt7d573822009-01-02 13:33:00 -0800573 .detect = intel_hdmi_detect,
574 .fill_modes = drm_helper_probe_single_connector_modes,
Chris Wilson55b7d6e82010-09-19 09:29:33 +0100575 .set_property = intel_hdmi_set_property,
Eric Anholt7d573822009-01-02 13:33:00 -0800576 .destroy = intel_hdmi_destroy,
577};
578
579static const struct drm_connector_helper_funcs intel_hdmi_connector_helper_funcs = {
580 .get_modes = intel_hdmi_get_modes,
581 .mode_valid = intel_hdmi_mode_valid,
Chris Wilsondf0e9242010-09-09 16:20:55 +0100582 .best_encoder = intel_best_encoder,
Eric Anholt7d573822009-01-02 13:33:00 -0800583};
584
Eric Anholt7d573822009-01-02 13:33:00 -0800585static const struct drm_encoder_funcs intel_hdmi_enc_funcs = {
Chris Wilsonea5b2132010-08-04 13:50:23 +0100586 .destroy = intel_encoder_destroy,
Eric Anholt7d573822009-01-02 13:33:00 -0800587};
588
Chris Wilson55b7d6e82010-09-19 09:29:33 +0100589static void
590intel_hdmi_add_properties(struct intel_hdmi *intel_hdmi, struct drm_connector *connector)
591{
Chris Wilson3f43c482011-05-12 22:17:24 +0100592 intel_attach_force_audio_property(connector);
Chris Wilsone953fd72011-02-21 22:23:52 +0000593 intel_attach_broadcast_rgb_property(connector);
Chris Wilson55b7d6e82010-09-19 09:29:33 +0100594}
595
Eric Anholt7d573822009-01-02 13:33:00 -0800596void intel_hdmi_init(struct drm_device *dev, int sdvox_reg)
597{
598 struct drm_i915_private *dev_priv = dev->dev_private;
599 struct drm_connector *connector;
Eric Anholt21d40d32010-03-25 11:11:14 -0700600 struct intel_encoder *intel_encoder;
Zhenyu Wang674e2d02010-03-29 15:57:42 +0800601 struct intel_connector *intel_connector;
Chris Wilsonea5b2132010-08-04 13:50:23 +0100602 struct intel_hdmi *intel_hdmi;
Jesse Barnes64a8fc02011-09-22 11:16:00 +0530603 int i;
Eric Anholt7d573822009-01-02 13:33:00 -0800604
Chris Wilsonea5b2132010-08-04 13:50:23 +0100605 intel_hdmi = kzalloc(sizeof(struct intel_hdmi), GFP_KERNEL);
606 if (!intel_hdmi)
Eric Anholt7d573822009-01-02 13:33:00 -0800607 return;
Zhenyu Wang674e2d02010-03-29 15:57:42 +0800608
609 intel_connector = kzalloc(sizeof(struct intel_connector), GFP_KERNEL);
610 if (!intel_connector) {
Chris Wilsonea5b2132010-08-04 13:50:23 +0100611 kfree(intel_hdmi);
Zhenyu Wang674e2d02010-03-29 15:57:42 +0800612 return;
613 }
614
Chris Wilsonea5b2132010-08-04 13:50:23 +0100615 intel_encoder = &intel_hdmi->base;
Chris Wilson373a3cf2010-09-15 12:03:59 +0100616 drm_encoder_init(dev, &intel_encoder->base, &intel_hdmi_enc_funcs,
617 DRM_MODE_ENCODER_TMDS);
618
Zhenyu Wang674e2d02010-03-29 15:57:42 +0800619 connector = &intel_connector->base;
Eric Anholt7d573822009-01-02 13:33:00 -0800620 drm_connector_init(dev, connector, &intel_hdmi_connector_funcs,
Adam Jackson8d911042009-09-23 15:08:29 -0400621 DRM_MODE_CONNECTOR_HDMIA);
Eric Anholt7d573822009-01-02 13:33:00 -0800622 drm_connector_helper_add(connector, &intel_hdmi_connector_helper_funcs);
623
Eric Anholt21d40d32010-03-25 11:11:14 -0700624 intel_encoder->type = INTEL_OUTPUT_HDMI;
Eric Anholt7d573822009-01-02 13:33:00 -0800625
Dave Airlieeb1f8e42010-05-07 06:42:51 +0000626 connector->polled = DRM_CONNECTOR_POLL_HPD;
Peter Rossc3febcc2012-01-28 14:49:26 +0100627 connector->interlace_allowed = 1;
Eric Anholt7d573822009-01-02 13:33:00 -0800628 connector->doublescan_allowed = 0;
Jesse Barnes27f82272011-09-02 12:54:37 -0700629 intel_encoder->crtc_mask = (1 << 0) | (1 << 1) | (1 << 2);
Eric Anholt7d573822009-01-02 13:33:00 -0800630
631 /* Set up the DDC bus. */
Ma Lingf8aed702009-08-24 13:50:24 +0800632 if (sdvox_reg == SDVOB) {
Eric Anholt21d40d32010-03-25 11:11:14 -0700633 intel_encoder->clone_mask = (1 << INTEL_HDMIB_CLONE_BIT);
Chris Wilsonf899fc62010-07-20 15:44:45 -0700634 intel_hdmi->ddc_bus = GMBUS_PORT_DPB;
Jesse Barnesb01f2c32009-12-11 11:07:17 -0800635 dev_priv->hotplug_supported_mask |= HDMIB_HOTPLUG_INT_STATUS;
Ma Lingf8aed702009-08-24 13:50:24 +0800636 } else if (sdvox_reg == SDVOC) {
Eric Anholt21d40d32010-03-25 11:11:14 -0700637 intel_encoder->clone_mask = (1 << INTEL_HDMIC_CLONE_BIT);
Chris Wilsonf899fc62010-07-20 15:44:45 -0700638 intel_hdmi->ddc_bus = GMBUS_PORT_DPC;
Jesse Barnesb01f2c32009-12-11 11:07:17 -0800639 dev_priv->hotplug_supported_mask |= HDMIC_HOTPLUG_INT_STATUS;
Ma Lingf8aed702009-08-24 13:50:24 +0800640 } else if (sdvox_reg == HDMIB) {
Eric Anholt21d40d32010-03-25 11:11:14 -0700641 intel_encoder->clone_mask = (1 << INTEL_HDMID_CLONE_BIT);
Chris Wilsonf899fc62010-07-20 15:44:45 -0700642 intel_hdmi->ddc_bus = GMBUS_PORT_DPB;
Jesse Barnesb01f2c32009-12-11 11:07:17 -0800643 dev_priv->hotplug_supported_mask |= HDMIB_HOTPLUG_INT_STATUS;
Ma Lingf8aed702009-08-24 13:50:24 +0800644 } else if (sdvox_reg == HDMIC) {
Eric Anholt21d40d32010-03-25 11:11:14 -0700645 intel_encoder->clone_mask = (1 << INTEL_HDMIE_CLONE_BIT);
Chris Wilsonf899fc62010-07-20 15:44:45 -0700646 intel_hdmi->ddc_bus = GMBUS_PORT_DPC;
Jesse Barnesb01f2c32009-12-11 11:07:17 -0800647 dev_priv->hotplug_supported_mask |= HDMIC_HOTPLUG_INT_STATUS;
Ma Lingf8aed702009-08-24 13:50:24 +0800648 } else if (sdvox_reg == HDMID) {
Eric Anholt21d40d32010-03-25 11:11:14 -0700649 intel_encoder->clone_mask = (1 << INTEL_HDMIF_CLONE_BIT);
Chris Wilsonf899fc62010-07-20 15:44:45 -0700650 intel_hdmi->ddc_bus = GMBUS_PORT_DPD;
Jesse Barnesb01f2c32009-12-11 11:07:17 -0800651 dev_priv->hotplug_supported_mask |= HDMID_HOTPLUG_INT_STATUS;
Eugeni Dodonov7ceae0a2012-05-09 15:37:28 -0300652 } else if (sdvox_reg == DDI_BUF_CTL(PORT_B)) {
653 DRM_DEBUG_DRIVER("LPT: detected output on DDI B\n");
654 intel_encoder->clone_mask = (1 << INTEL_HDMIB_CLONE_BIT);
655 intel_hdmi->ddc_bus = GMBUS_PORT_DPB;
656 intel_hdmi->ddi_port = PORT_B;
657 dev_priv->hotplug_supported_mask |= HDMIB_HOTPLUG_INT_STATUS;
658 } else if (sdvox_reg == DDI_BUF_CTL(PORT_C)) {
659 DRM_DEBUG_DRIVER("LPT: detected output on DDI C\n");
660 intel_encoder->clone_mask = (1 << INTEL_HDMIC_CLONE_BIT);
661 intel_hdmi->ddc_bus = GMBUS_PORT_DPC;
662 intel_hdmi->ddi_port = PORT_C;
663 dev_priv->hotplug_supported_mask |= HDMIC_HOTPLUG_INT_STATUS;
664 } else if (sdvox_reg == DDI_BUF_CTL(PORT_D)) {
665 DRM_DEBUG_DRIVER("LPT: detected output on DDI D\n");
666 intel_encoder->clone_mask = (1 << INTEL_HDMID_CLONE_BIT);
667 intel_hdmi->ddc_bus = GMBUS_PORT_DPD;
668 intel_hdmi->ddi_port = PORT_D;
669 dev_priv->hotplug_supported_mask |= HDMID_HOTPLUG_INT_STATUS;
Eugeni Dodonov6e4c1672012-05-09 15:37:13 -0300670 } else {
671 /* If we got an unknown sdvox_reg, things are pretty much broken
672 * in a way that we should let the kernel know about it */
673 BUG();
Ma Lingf8aed702009-08-24 13:50:24 +0800674 }
Eric Anholt7d573822009-01-02 13:33:00 -0800675
Chris Wilsonea5b2132010-08-04 13:50:23 +0100676 intel_hdmi->sdvox_reg = sdvox_reg;
Eric Anholt7d573822009-01-02 13:33:00 -0800677
Jesse Barnes64a8fc02011-09-22 11:16:00 +0530678 if (!HAS_PCH_SPLIT(dev)) {
Daniel Vettera3da1df2012-05-08 15:19:06 +0200679 intel_hdmi->write_infoframe = g4x_write_infoframe;
Jesse Barnes64a8fc02011-09-22 11:16:00 +0530680 I915_WRITE(VIDEO_DIP_CTL, 0);
Shobhit Kumar90b107c2012-03-28 13:39:32 -0700681 } else if (IS_VALLEYVIEW(dev)) {
682 intel_hdmi->write_infoframe = vlv_write_infoframe;
683 for_each_pipe(i)
684 I915_WRITE(VLV_TVIDEO_DIP_CTL(i), 0);
Eugeni Dodonov8c5f5f72012-05-10 10:18:02 -0300685 } else if (IS_HASWELL(dev)) {
686 /* FIXME: Haswell has a new set of DIP frame registers, but we are
687 * just doing the minimal required for HDMI to work at this stage.
688 */
689 intel_hdmi->write_infoframe = hsw_write_infoframe;
690 for_each_pipe(i)
691 I915_WRITE(HSW_TVIDEO_DIP_CTL(i), 0);
Paulo Zanonifdf12502012-05-04 17:18:24 -0300692 } else if (HAS_PCH_IBX(dev)) {
693 intel_hdmi->write_infoframe = ibx_write_infoframe;
694 for_each_pipe(i)
695 I915_WRITE(TVIDEO_DIP_CTL(i), 0);
696 } else {
697 intel_hdmi->write_infoframe = cpt_write_infoframe;
Jesse Barnes64a8fc02011-09-22 11:16:00 +0530698 for_each_pipe(i)
699 I915_WRITE(TVIDEO_DIP_CTL(i), 0);
700 }
Jesse Barnes45187ac2011-08-03 09:22:55 -0700701
Chris Wilson4ef69c72010-09-09 15:14:28 +0100702 drm_encoder_helper_add(&intel_encoder->base, &intel_hdmi_helper_funcs);
Eric Anholt7d573822009-01-02 13:33:00 -0800703
Chris Wilson55b7d6e82010-09-19 09:29:33 +0100704 intel_hdmi_add_properties(intel_hdmi, connector);
705
Chris Wilsondf0e9242010-09-09 16:20:55 +0100706 intel_connector_attach_encoder(intel_connector, intel_encoder);
Eric Anholt7d573822009-01-02 13:33:00 -0800707 drm_sysfs_connector_add(connector);
708
709 /* For G4X desktop chip, PEG_BAND_GAP_DATA 3:0 must first be written
710 * 0xd. Failure to do so will result in spurious interrupts being
711 * generated on the port when a cable is not attached.
712 */
713 if (IS_G4X(dev) && !IS_GM45(dev)) {
714 u32 temp = I915_READ(PEG_BAND_GAP_DATA);
715 I915_WRITE(PEG_BAND_GAP_DATA, (temp & ~0xf) | 0xd);
716 }
Eric Anholt7d573822009-01-02 13:33:00 -0800717}