37 #include <drm/i915_drm.h>
97 static const u32 filter_table[] = {
98 0xB1403000, 0x2E203500, 0x35002E20, 0x3000B140,
99 0x35A0B160, 0x2DC02E80, 0xB1403480, 0xB1603000,
100 0x2EA03640, 0x34002D80, 0x3000B120, 0x36E0B160,
101 0x2D202EF0, 0xB1203380, 0xB1603000, 0x2F303780,
102 0x33002CC0, 0x3000B100, 0x3820B160, 0x2C802F50,
103 0xB10032A0, 0xB1603000, 0x2F9038C0, 0x32202C20,
104 0x3000B0E0, 0x3980B160, 0x2BC02FC0, 0xB0E031C0,
105 0xB1603000, 0x2FF03A20, 0x31602B60, 0xB020B0C0,
106 0x3AE0B160, 0x2B001810, 0xB0C03120, 0xB140B020,
107 0x18283BA0, 0x30C02A80, 0xB020B0A0, 0x3C60B140,
108 0x2A201838, 0xB0A03080, 0xB120B020, 0x18383D20,
109 0x304029C0, 0xB040B080, 0x3DE0B100, 0x29601848,
110 0xB0803000, 0xB100B040, 0x18483EC0, 0xB0402900,
111 0xB040B060, 0x3F80B0C0, 0x28801858, 0xB060B080,
112 0xB0A0B060, 0x18602820, 0xB0A02820, 0x0000B060,
113 0xB1403000, 0x2E203500, 0x35002E20, 0x3000B140,
114 0x35A0B160, 0x2DC02E80, 0xB1403480, 0xB1603000,
115 0x2EA03640, 0x34002D80, 0x3000B120, 0x36E0B160,
116 0x2D202EF0, 0xB1203380, 0xB1603000, 0x2F303780,
117 0x33002CC0, 0x3000B100, 0x3820B160, 0x2C802F50,
118 0xB10032A0, 0xB1603000, 0x2F9038C0, 0x32202C20,
119 0x3000B0E0, 0x3980B160, 0x2BC02FC0, 0xB0E031C0,
120 0xB1603000, 0x2FF03A20, 0x31602B60, 0xB020B0C0,
121 0x3AE0B160, 0x2B001810, 0xB0C03120, 0xB140B020,
122 0x18283BA0, 0x30C02A80, 0xB020B0A0, 0x3C60B140,
123 0x2A201838, 0xB0A03080, 0xB120B020, 0x18383D20,
124 0x304029C0, 0xB040B080, 0x3DE0B100, 0x29601848,
125 0xB0803000, 0xB100B040, 0x18483EC0, 0xB0402900,
126 0xB040B060, 0x3F80B0C0, 0x28801858, 0xB060B080,
127 0xB0A0B060, 0x18602820, 0xB0A02820, 0x0000B060,
128 0x36403000, 0x2D002CC0, 0x30003640, 0x2D0036C0,
129 0x35C02CC0, 0x37403000, 0x2C802D40, 0x30003540,
130 0x2D8037C0, 0x34C02C40, 0x38403000, 0x2BC02E00,
131 0x30003440, 0x2E2038C0, 0x34002B80, 0x39803000,
132 0x2B402E40, 0x30003380, 0x2E603A00, 0x33402B00,
133 0x3A803040, 0x2A802EA0, 0x30403300, 0x2EC03B40,
134 0x32802A40, 0x3C003040, 0x2A002EC0, 0x30803240,
135 0x2EC03C80, 0x320029C0, 0x3D403080, 0x29402F00,
136 0x308031C0, 0x2F203DC0, 0x31802900, 0x3E8030C0,
137 0x28802F40, 0x30C03140, 0x2F203F40, 0x31402840,
138 0x28003100, 0x28002F00, 0x00003100, 0x36403000,
139 0x2D002CC0, 0x30003640, 0x2D0036C0,
140 0x35C02CC0, 0x37403000, 0x2C802D40, 0x30003540,
141 0x2D8037C0, 0x34C02C40, 0x38403000, 0x2BC02E00,
142 0x30003440, 0x2E2038C0, 0x34002B80, 0x39803000,
143 0x2B402E40, 0x30003380, 0x2E603A00, 0x33402B00,
144 0x3A803040, 0x2A802EA0, 0x30403300, 0x2EC03B40,
145 0x32802A40, 0x3C003040, 0x2A002EC0, 0x30803240,
146 0x2EC03C80, 0x320029C0, 0x3D403080, 0x29402F00,
147 0x308031C0, 0x2F203DC0, 0x31802900, 0x3E8030C0,
148 0x28802F40, 0x30C03140, 0x2F203F40, 0x31402840,
149 0x28003100, 0x28002F00, 0x00003100,
220 .ry = 0x0332, .gy = 0x012d, .by = 0x07d3, .ay = 0x0104,
221 .ru = 0x0733, .gu = 0x052d, .bu = 0x05c7, .au = 0x0200,
222 .rv = 0x0340, .gv = 0x030c, .bv = 0x06d0, .av = 0x0200,
225 static const struct video_levels ntsc_m_levels_composite = {
226 .blank = 225, .black = 267, .burst = 113,
230 .ry = 0x0332, .gy = 0x012d, .by = 0x07d3, .ay = 0x0133,
231 .ru = 0x076a, .gu = 0x0564, .bu = 0x030d, .au = 0x0200,
232 .rv = 0x037a, .gv = 0x033d, .bv = 0x06f6, .av = 0x0200,
235 static const struct video_levels ntsc_m_levels_svideo = {
236 .blank = 266, .black = 316, .burst = 133,
240 .ry = 0x0332, .gy = 0x012d, .by = 0x07d3, .ay = 0x0119,
241 .ru = 0x074c, .gu = 0x0546, .bu = 0x05ec, .au = 0x0200,
242 .rv = 0x035a, .gv = 0x0322, .bv = 0x06e1, .av = 0x0200,
245 static const struct video_levels ntsc_j_levels_composite = {
246 .blank = 225, .black = 225, .burst = 113,
250 .ry = 0x0332, .gy = 0x012d, .by = 0x07d3, .ay = 0x014c,
251 .ru = 0x0788, .gu = 0x0581, .bu = 0x0322, .au = 0x0200,
252 .rv = 0x0399, .gv = 0x0356, .bv = 0x070a, .av = 0x0200,
255 static const struct video_levels ntsc_j_levels_svideo = {
256 .blank = 266, .black = 266, .burst = 133,
260 .ry = 0x0332, .gy = 0x012d, .by = 0x07d3, .ay = 0x0113,
261 .ru = 0x0745, .gu = 0x053f, .bu = 0x05e1, .au = 0x0200,
262 .rv = 0x0353, .gv = 0x031c, .bv = 0x06dc, .av = 0x0200,
265 static const struct video_levels pal_levels_composite = {
266 .blank = 237, .black = 237, .burst = 118,
270 .ry = 0x0332, .gy = 0x012d, .by = 0x07d3, .ay = 0x0145,
271 .ru = 0x0780, .gu = 0x0579, .bu = 0x031c, .au = 0x0200,
272 .rv = 0x0390, .gv = 0x034f, .bv = 0x0705, .av = 0x0200,
276 .blank = 280, .black = 280, .burst = 139,
280 .ry = 0x0332, .gy = 0x012d, .by = 0x07d3, .ay = 0x0104,
281 .ru = 0x0733, .gu = 0x052d, .bu = 0x05c7, .au = 0x0200,
282 .rv = 0x0340, .gv = 0x030c, .bv = 0x06d0, .av = 0x0200,
285 static const struct video_levels pal_m_levels_composite = {
286 .blank = 225, .black = 267, .burst = 113,
290 .ry = 0x0332, .gy = 0x012d, .by = 0x07d3, .ay = 0x0133,
291 .ru = 0x076a, .gu = 0x0564, .bu = 0x030d, .au = 0x0200,
292 .rv = 0x037a, .gv = 0x033d, .bv = 0x06f6, .av = 0x0200,
295 static const struct video_levels pal_m_levels_svideo = {
296 .blank = 266, .black = 316, .burst = 133,
300 .ry = 0x0332, .gy = 0x012d, .by = 0x07d3, .ay = 0x0104,
301 .ru = 0x0733, .gu = 0x052d, .bu = 0x05c7, .au = 0x0200,
302 .rv = 0x0340, .gv = 0x030c, .bv = 0x06d0, .av = 0x0200,
305 static const struct video_levels pal_n_levels_composite = {
306 .blank = 225, .black = 267, .burst = 118,
310 .ry = 0x0332, .gy = 0x012d, .by = 0x07d3, .ay = 0x0133,
311 .ru = 0x076a, .gu = 0x0564, .bu = 0x030d, .au = 0x0200,
312 .rv = 0x037a, .gv = 0x033d, .bv = 0x06f6, .av = 0x0200,
315 static const struct video_levels pal_n_levels_svideo = {
316 .blank = 266, .black = 316, .burst = 139,
323 .ry = 0x0332, .gy = 0x012d, .by = 0x07d3, .ay = 0x0145,
324 .ru = 0x0559, .gu = 0x0353, .bu = 0x0100, .au = 0x0200,
325 .rv = 0x0100, .gv = 0x03ad, .bv = 0x074d, .av = 0x0200,
329 .ry = 0x0000, .gy = 0x0f00, .by = 0x0000, .ay = 0x0166,
330 .ru = 0x0000, .gu = 0x0000, .bu = 0x0f00, .au = 0x0166,
331 .rv = 0x0f00, .gv = 0x0000, .bv = 0x0000, .av = 0x0166,
335 .ry = 0x05b3, .gy = 0x016e, .by = 0x0728, .ay = 0x0145,
336 .ru = 0x07d5, .gu = 0x038b, .bu = 0x0100, .au = 0x0200,
337 .rv = 0x0100, .gv = 0x03d1, .bv = 0x06bc, .av = 0x0200,
341 .ry = 0x0000, .gy = 0x0f00, .by = 0x0000, .ay = 0x0166,
342 .ru = 0x0000, .gu = 0x0000, .bu = 0x0f00, .au = 0x0166,
343 .rv = 0x0f00, .gv = 0x0000, .bv = 0x0000, .av = 0x0166,
347 .blank = 279, .black = 279, .burst = 0,
415 static const struct tv_mode tv_modes[] = {
424 .hsync_end = 64, .hblank_end = 124,
425 .hblank_start = 836, .htotal = 857,
427 .progressive =
false, .trilevel_sync =
false,
429 .vsync_start_f1 = 6, .vsync_start_f2 = 7,
432 .veq_ena =
true, .veq_start_f1 = 0,
433 .veq_start_f2 = 1, .veq_len = 18,
435 .vi_end_f1 = 20, .vi_end_f2 = 21,
439 .hburst_start = 72, .hburst_len = 34,
440 .vburst_start_f1 = 9, .vburst_end_f1 = 240,
441 .vburst_start_f2 = 10, .vburst_end_f2 = 240,
442 .vburst_start_f3 = 9, .vburst_end_f3 = 240,
443 .vburst_start_f4 = 10, .vburst_end_f4 = 240,
447 .dda2_inc = 20800, .dda2_size = 27456,
448 .dda3_inc = 0, .dda3_size = 0,
452 .composite_levels = &ntsc_m_levels_composite,
453 .composite_color = &ntsc_m_csc_composite,
454 .svideo_levels = &ntsc_m_levels_svideo,
455 .svideo_color = &ntsc_m_csc_svideo,
466 .hsync_end = 64, .hblank_end = 124,
467 .hblank_start = 836, .htotal = 857,
469 .progressive =
false, .trilevel_sync =
false,
471 .vsync_start_f1 = 6, .vsync_start_f2 = 7,
474 .veq_ena =
true, .veq_start_f1 = 0,
475 .veq_start_f2 = 1, .veq_len = 18,
477 .vi_end_f1 = 20, .vi_end_f2 = 21,
481 .hburst_start = 72, .hburst_len = 34,
482 .vburst_start_f1 = 9, .vburst_end_f1 = 240,
483 .vburst_start_f2 = 10, .vburst_end_f2 = 240,
484 .vburst_start_f3 = 9, .vburst_end_f3 = 240,
485 .vburst_start_f4 = 10, .vburst_end_f4 = 240,
489 .dda2_inc = 4093, .dda2_size = 27456,
490 .dda3_inc = 310, .dda3_size = 525,
494 .composite_levels = &ntsc_m_levels_composite,
495 .composite_color = &ntsc_m_csc_composite,
496 .svideo_levels = &ntsc_m_levels_svideo,
497 .svideo_color = &ntsc_m_csc_svideo,
509 .hsync_end = 64, .hblank_end = 124,
510 .hblank_start = 836, .htotal = 857,
512 .progressive =
false, .trilevel_sync =
false,
514 .vsync_start_f1 = 6, .vsync_start_f2 = 7,
517 .veq_ena =
true, .veq_start_f1 = 0,
518 .veq_start_f2 = 1, .veq_len = 18,
520 .vi_end_f1 = 20, .vi_end_f2 = 21,
524 .hburst_start = 72, .hburst_len = 34,
525 .vburst_start_f1 = 9, .vburst_end_f1 = 240,
526 .vburst_start_f2 = 10, .vburst_end_f2 = 240,
527 .vburst_start_f3 = 9, .vburst_end_f3 = 240,
528 .vburst_start_f4 = 10, .vburst_end_f4 = 240,
532 .dda2_inc = 20800, .dda2_size = 27456,
533 .dda3_inc = 0, .dda3_size = 0,
537 .composite_levels = &ntsc_j_levels_composite,
538 .composite_color = &ntsc_j_csc_composite,
539 .svideo_levels = &ntsc_j_levels_svideo,
540 .svideo_color = &ntsc_j_csc_svideo,
552 .hsync_end = 64, .hblank_end = 124,
553 .hblank_start = 836, .htotal = 857,
555 .progressive =
false, .trilevel_sync =
false,
557 .vsync_start_f1 = 6, .vsync_start_f2 = 7,
560 .veq_ena =
true, .veq_start_f1 = 0,
561 .veq_start_f2 = 1, .veq_len = 18,
563 .vi_end_f1 = 20, .vi_end_f2 = 21,
567 .hburst_start = 72, .hburst_len = 34,
568 .vburst_start_f1 = 9, .vburst_end_f1 = 240,
569 .vburst_start_f2 = 10, .vburst_end_f2 = 240,
570 .vburst_start_f3 = 9, .vburst_end_f3 = 240,
571 .vburst_start_f4 = 10, .vburst_end_f4 = 240,
575 .dda2_inc = 16704, .dda2_size = 27456,
576 .dda3_inc = 0, .dda3_size = 0,
580 .composite_levels = &pal_m_levels_composite,
581 .composite_color = &pal_m_csc_composite,
582 .svideo_levels = &pal_m_levels_svideo,
583 .svideo_color = &pal_m_csc_svideo,
595 .hsync_end = 64, .hblank_end = 128,
596 .hblank_start = 844, .htotal = 863,
598 .progressive =
false, .trilevel_sync =
false,
601 .vsync_start_f1 = 6, .vsync_start_f2 = 7,
604 .veq_ena =
true, .veq_start_f1 = 0,
605 .veq_start_f2 = 1, .veq_len = 18,
607 .vi_end_f1 = 24, .vi_end_f2 = 25,
611 .hburst_start = 73, .hburst_len = 34,
612 .vburst_start_f1 = 8, .vburst_end_f1 = 285,
613 .vburst_start_f2 = 8, .vburst_end_f2 = 286,
614 .vburst_start_f3 = 9, .vburst_end_f3 = 286,
615 .vburst_start_f4 = 9, .vburst_end_f4 = 285,
620 .dda2_inc = 23578, .dda2_size = 27648,
621 .dda3_inc = 134, .dda3_size = 625,
625 .composite_levels = &pal_n_levels_composite,
626 .composite_color = &pal_n_csc_composite,
627 .svideo_levels = &pal_n_levels_svideo,
628 .svideo_color = &pal_n_csc_svideo,
640 .hsync_end = 64, .hblank_end = 142,
641 .hblank_start = 844, .htotal = 863,
643 .progressive =
false, .trilevel_sync =
false,
645 .vsync_start_f1 = 5, .vsync_start_f2 = 6,
648 .veq_ena =
true, .veq_start_f1 = 0,
649 .veq_start_f2 = 1, .veq_len = 15,
651 .vi_end_f1 = 24, .vi_end_f2 = 25,
655 .hburst_start = 73, .hburst_len = 32,
656 .vburst_start_f1 = 8, .vburst_end_f1 = 285,
657 .vburst_start_f2 = 8, .vburst_end_f2 = 286,
658 .vburst_start_f3 = 9, .vburst_end_f3 = 286,
659 .vburst_start_f4 = 9, .vburst_end_f4 = 285,
663 .dda2_inc = 4122, .dda2_size = 27648,
664 .dda3_inc = 67, .dda3_size = 625,
668 .composite_levels = &pal_levels_composite,
669 .composite_color = &pal_csc_composite,
670 .svideo_levels = &pal_levels_svideo,
671 .svideo_color = &pal_csc_svideo,
682 .hsync_end = 64, .hblank_end = 122,
683 .hblank_start = 842, .htotal = 857,
685 .progressive =
true, .trilevel_sync =
false,
687 .vsync_start_f1 = 12, .vsync_start_f2 = 12,
692 .vi_end_f1 = 44, .vi_end_f2 = 44,
706 .hsync_end = 64, .hblank_end = 139,
707 .hblank_start = 859, .htotal = 863,
709 .progressive =
true, .trilevel_sync =
false,
711 .vsync_start_f1 = 10, .vsync_start_f2 = 10,
716 .vi_end_f1 = 48, .vi_end_f2 = 48,
730 .hsync_end = 80, .hblank_end = 300,
731 .hblank_start = 1580, .htotal = 1649,
733 .progressive =
true, .trilevel_sync =
true,
735 .vsync_start_f1 = 10, .vsync_start_f2 = 10,
740 .vi_end_f1 = 29, .vi_end_f2 = 29,
754 .hsync_end = 80, .hblank_end = 300,
755 .hblank_start = 1580, .htotal = 1979,
757 .progressive =
true, .trilevel_sync =
true,
759 .vsync_start_f1 = 10, .vsync_start_f2 = 10,
764 .vi_end_f1 = 29, .vi_end_f2 = 29,
773 .name =
"1080i@50Hz",
779 .hsync_end = 88, .hblank_end = 235,
780 .hblank_start = 2155, .htotal = 2639,
782 .progressive =
false, .trilevel_sync =
true,
784 .vsync_start_f1 = 4, .vsync_start_f2 = 5,
787 .veq_ena =
true, .veq_start_f1 = 4,
788 .veq_start_f2 = 4, .veq_len = 10,
791 .vi_end_f1 = 21, .vi_end_f2 = 22,
799 .name =
"1080i@60Hz",
805 .hsync_end = 88, .hblank_end = 235,
806 .hblank_start = 2155, .htotal = 2199,
808 .progressive =
false, .trilevel_sync =
true,
810 .vsync_start_f1 = 4, .vsync_start_f2 = 5,
813 .veq_ena =
true, .veq_start_f1 = 4,
814 .veq_start_f2 = 4, .veq_len = 10,
817 .vi_end_f1 = 21, .vi_end_f2 = 22,
872 intel_tv_mode_lookup(
const char *tv_format)
885 static const struct tv_mode *
888 return intel_tv_mode_lookup(intel_tv->
tv_format);
896 const struct tv_mode *tv_mode = intel_tv_mode_find(intel_tv);
912 struct intel_tv *intel_tv = enc_to_intel_tv(encoder);
913 const struct tv_mode *tv_mode = intel_tv_mode_find(intel_tv);
933 struct intel_tv *intel_tv = enc_to_intel_tv(encoder);
934 const struct tv_mode *tv_mode = intel_tv_mode_find(intel_tv);
936 u32 hctl1, hctl2, hctl3;
937 u32 vctl1, vctl2, vctl3, vctl4, vctl5, vctl6, vctl7;
938 u32 scctl1, scctl2, scctl3;
943 int pipe = intel_crtc->
pipe;
951 switch (intel_tv->
type) {
962 video_levels = &component_levels;
964 color_conversion = &sdtv_csc_yprpb;
966 color_conversion = &hdtv_csc_yprpb;
1015 if (intel_crtc->
pipe == 1)
1045 if (dev->pci_device < 0x2772)
1062 if (color_conversion) {
1064 color_conversion->
gy);
1066 color_conversion->
ay);
1068 color_conversion->
gu);
1070 color_conversion->
au);
1072 color_conversion->
gv);
1074 color_conversion->
av);
1092 int xpos = 0x0, ypos = 0x0;
1093 unsigned int xsize, ysize;
1113 ysize = 2*tv_mode->
nbr_end + 1;
1131 for (i = 0; i < 60; i++)
1133 for (i = 0; i < 60; i++)
1135 for (i = 0; i < 43; i++)
1137 for (i = 0; i < 43; i++)
1145 .name =
"NTSC 480i",
1148 .hsync_start = 1368,
1153 .vsync_start = 1027,
1169 intel_tv_detect_type(
struct intel_tv *intel_tv,
1177 unsigned long irqflags;
1178 u32 tv_ctl, save_tv_ctl;
1179 u32 tv_dac, save_tv_dac;
1188 spin_unlock_irqrestore(&dev_priv->
irq_lock, irqflags);
1197 if (intel_crtc->
pipe == 1)
1230 DRM_DEBUG_KMS(
"TV detected: %x, %x\n", tv_ctl, tv_dac);
1238 DRM_DEBUG_KMS(
"Detected Composite TV connection\n");
1241 DRM_DEBUG_KMS(
"Detected S-Video TV connection\n");
1243 }
else if ((tv_dac & TVDAC_SENSE_MASK) == 0) {
1244 DRM_DEBUG_KMS(
"Detected Component TV connection\n");
1247 DRM_DEBUG_KMS(
"Unrecognised TV connection\n");
1265 spin_unlock_irqrestore(&dev_priv->
irq_lock, irqflags);
1275 static void intel_tv_find_better_format(
struct drm_connector *connector)
1277 struct intel_tv *intel_tv = intel_attached_tv(connector);
1278 const struct tv_mode *tv_mode = intel_tv_mode_find(intel_tv);
1286 for (i = 0; i <
sizeof(tv_modes) /
sizeof(*tv_modes); i++) {
1287 tv_mode = tv_modes +
i;
1296 connector->
dev->mode_config.tv_mode_property, i);
1309 struct intel_tv *intel_tv = intel_attached_tv(connector);
1312 mode = reported_modes[0];
1318 type = intel_tv_detect_type(intel_tv, connector);
1323 return connector->
status;
1329 intel_tv_find_better_format(connector);
1334 static const struct input_res {
1337 } input_res_table[] = {
1338 {
"640x480", 640, 480},
1339 {
"800x600", 800, 600},
1340 {
"1024x768", 1024, 768},
1341 {
"1280x1024", 1280, 1024},
1342 {
"848x480", 848, 480},
1343 {
"1280x720", 1280, 720},
1344 {
"1920x1080", 1920, 1080},
1351 intel_tv_chose_preferred_modes(
struct drm_connector *connector,
1354 struct intel_tv *intel_tv = intel_attached_tv(connector);
1355 const struct tv_mode *tv_mode = intel_tv_mode_find(intel_tv);
1359 else if (tv_mode->
nbr_end > 480) {
1363 }
else if (mode_ptr->
vdisplay == 1080)
1379 struct intel_tv *intel_tv = intel_attached_tv(connector);
1380 const struct tv_mode *tv_mode = intel_tv_mode_find(intel_tv);
1386 const struct input_res *
input = &input_res_table[
j];
1387 unsigned int hactive_s = input->w;
1388 unsigned int vactive_s = input->h;
1407 mode_ptr->
htotal = hactive_s + 96;
1414 mode_ptr->
vtotal = vactive_s + 33;
1418 tmp = div_u64(tmp, 1000000);
1422 intel_tv_chose_preferred_modes(connector, mode_ptr);
1444 struct intel_tv *intel_tv = intel_attached_tv(connector);
1453 if (property == dev->mode_config.tv_left_margin_property &&
1457 }
else if (property == dev->mode_config.tv_right_margin_property &&
1461 }
else if (property == dev->mode_config.tv_top_margin_property &&
1465 }
else if (property == dev->mode_config.tv_bottom_margin_property &&
1469 }
else if (property == dev->mode_config.tv_mode_property) {
1484 if (changed && crtc)
1486 crtc->
x, crtc->
y, crtc->
fb);
1492 .mode_fixup = intel_tv_mode_fixup,
1493 .mode_set = intel_tv_mode_set,
1499 .detect = intel_tv_detect,
1500 .destroy = intel_tv_destroy,
1501 .set_property = intel_tv_set_property,
1506 .mode_valid = intel_tv_mode_valid,
1507 .get_modes = intel_tv_get_modes,
1522 static int tv_is_present_in_vbt(
struct drm_device *dev)
1556 struct intel_tv *intel_tv;
1559 u32 tv_dac_on, tv_dac_off, save_tv_dac;
1561 int i, initial_mode = 0;
1566 if (!tv_is_present_in_vbt(dev)) {
1567 DRM_DEBUG_KMS(
"Integrated TV is not present.\n");
1594 (tv_dac_off & TVDAC_STATE_CHG_EN) != 0)
1597 intel_tv = kzalloc(
sizeof(
struct intel_tv),
GFP_KERNEL);
1602 intel_connector = kzalloc(
sizeof(
struct intel_connector),
GFP_KERNEL);
1603 if (!intel_connector) {
1608 intel_encoder = &intel_tv->
base;
1609 connector = &intel_connector->
base;
1628 intel_encoder->
enable = intel_enable_tv;
1629 intel_encoder->
disable = intel_disable_tv;
1635 intel_encoder->
crtc_mask = (1 << 0) | (1 << 1);
1637 intel_encoder->
base.possible_crtcs = ((1 << 0) | (1 << 1));
1649 drm_encoder_helper_add(&intel_encoder->
base, &intel_tv_helper_funcs);
1650 drm_connector_helper_add(connector, &intel_tv_connector_helper_funcs);
1656 tv_format_names[i] = (
char *)tv_modes[
i].
name;
1664 dev->mode_config.tv_left_margin_property,
1667 dev->mode_config.tv_top_margin_property,
1670 dev->mode_config.tv_right_margin_property,
1673 dev->mode_config.tv_bottom_margin_property,