1 /***************************************************************************\
3 |* Copyright 2003 NVIDIA, Corporation. All rights reserved. *|
5 |* NOTICE TO USER: The source code is copyrighted under U.S. and *|
6 |* international laws. Users and possessors of this source code are *|
7 |* hereby granted a nonexclusive, royalty-free copyright license to *|
8 |* use this code in individual and commercial software. *|
10 |* Any use of this source code must include, in the user documenta- *|
11 |* tion and internal comments to the code, notices to the end user *|
14 |* Copyright 2003 NVIDIA, Corporation. All rights reserved. *|
16 |* NVIDIA, CORPORATION MAKES NO REPRESENTATION ABOUT THE SUITABILITY *|
17 |* OF THIS SOURCE CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" *|
18 |* WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. NVIDIA, CORPOR- *|
19 |* ATION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOURCE CODE, *|
20 |* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGE- *|
21 |* MENT, AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL *|
22 |* NVIDIA, CORPORATION BE LIABLE FOR ANY SPECIAL, INDIRECT, INCI- *|
23 |* DENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RE- *|
24 |* SULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION *|
25 |* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF *|
26 |* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE CODE. *|
28 |* U.S. Government End Users. This source code is a "commercial *|
29 |* item," as that term is defined at 48 C.F.R. 2.101 (OCT 1995), *|
30 |* consisting of "commercial computer software" and "commercial *|
31 |* computer software documentation," as such terms are used in *|
32 |* 48 C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Govern- *|
33 |* ment only as a commercial end item. Consistent with 48 C.F.R. *|
34 |* 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), *|
35 |* all U.S. Government End Users acquire the source code with only *|
36 |* those rights set forth herein. *|
38 \***************************************************************************/
40 /* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_setup.c,v 1.48 2005/09/14 02:28:03 mvojkovi Exp $ */
42 #include "nv_include.h"
45 * Override VGA I/O routines.
47 static void NVWriteCrtc(vgaHWPtr pVga, CARD8 index, CARD8 value)
49 NVPtr pNv = (NVPtr)pVga->MMIOBase;
50 VGA_WR08(pNv->PCIO, pVga->IOBase + VGA_CRTC_INDEX_OFFSET, index);
51 VGA_WR08(pNv->PCIO, pVga->IOBase + VGA_CRTC_DATA_OFFSET, value);
53 static CARD8 NVReadCrtc(vgaHWPtr pVga, CARD8 index)
55 NVPtr pNv = (NVPtr)pVga->MMIOBase;
56 VGA_WR08(pNv->PCIO, pVga->IOBase + VGA_CRTC_INDEX_OFFSET, index);
57 return (VGA_RD08(pNv->PCIO, pVga->IOBase + VGA_CRTC_DATA_OFFSET));
59 static void NVWriteGr(vgaHWPtr pVga, CARD8 index, CARD8 value)
61 NVPtr pNv = (NVPtr)pVga->MMIOBase;
62 VGA_WR08(pNv->PVIO, VGA_GRAPH_INDEX, index);
63 VGA_WR08(pNv->PVIO, VGA_GRAPH_DATA, value);
65 static CARD8 NVReadGr(vgaHWPtr pVga, CARD8 index)
67 NVPtr pNv = (NVPtr)pVga->MMIOBase;
68 VGA_WR08(pNv->PVIO, VGA_GRAPH_INDEX, index);
69 return (VGA_RD08(pNv->PVIO, VGA_GRAPH_DATA));
71 static void NVWriteSeq(vgaHWPtr pVga, CARD8 index, CARD8 value)
73 NVPtr pNv = (NVPtr)pVga->MMIOBase;
74 VGA_WR08(pNv->PVIO, VGA_SEQ_INDEX, index);
75 VGA_WR08(pNv->PVIO, VGA_SEQ_DATA, value);
77 static CARD8 NVReadSeq(vgaHWPtr pVga, CARD8 index)
79 NVPtr pNv = (NVPtr)pVga->MMIOBase;
80 VGA_WR08(pNv->PVIO, VGA_SEQ_INDEX, index);
81 return (VGA_RD08(pNv->PVIO, VGA_SEQ_DATA));
83 static void NVWriteAttr(vgaHWPtr pVga, CARD8 index, CARD8 value)
85 NVPtr pNv = (NVPtr)pVga->MMIOBase;
88 tmp = VGA_RD08(pNv->PCIO, pVga->IOBase + VGA_IN_STAT_1_OFFSET);
89 if (pVga->paletteEnabled)
93 VGA_WR08(pNv->PCIO, VGA_ATTR_INDEX, index);
94 VGA_WR08(pNv->PCIO, VGA_ATTR_DATA_W, value);
96 static CARD8 NVReadAttr(vgaHWPtr pVga, CARD8 index)
98 NVPtr pNv = (NVPtr)pVga->MMIOBase;
101 tmp = VGA_RD08(pNv->PCIO, pVga->IOBase + VGA_IN_STAT_1_OFFSET);
102 if (pVga->paletteEnabled)
106 VGA_WR08(pNv->PCIO, VGA_ATTR_INDEX, index);
107 return (VGA_RD08(pNv->PCIO, VGA_ATTR_DATA_R));
109 static void NVWriteMiscOut(vgaHWPtr pVga, CARD8 value)
111 NVPtr pNv = (NVPtr)pVga->MMIOBase;
112 VGA_WR08(pNv->PVIO, VGA_MISC_OUT_W, value);
114 static CARD8 NVReadMiscOut(vgaHWPtr pVga)
116 NVPtr pNv = (NVPtr)pVga->MMIOBase;
117 return (VGA_RD08(pNv->PVIO, VGA_MISC_OUT_R));
119 static void NVEnablePalette(vgaHWPtr pVga)
121 NVPtr pNv = (NVPtr)pVga->MMIOBase;
124 tmp = VGA_RD08(pNv->PCIO, pVga->IOBase + VGA_IN_STAT_1_OFFSET);
125 VGA_WR08(pNv->PCIO, VGA_ATTR_INDEX, 0x00);
126 pVga->paletteEnabled = TRUE;
128 static void NVDisablePalette(vgaHWPtr pVga)
130 NVPtr pNv = (NVPtr)pVga->MMIOBase;
133 tmp = VGA_RD08(pNv->PCIO, pVga->IOBase + VGA_IN_STAT_1_OFFSET);
134 VGA_WR08(pNv->PCIO, VGA_ATTR_INDEX, 0x20);
135 pVga->paletteEnabled = FALSE;
137 static void NVWriteDacMask(vgaHWPtr pVga, CARD8 value)
139 NVPtr pNv = (NVPtr)pVga->MMIOBase;
140 VGA_WR08(pNv->PDIO, VGA_DAC_MASK, value);
142 static CARD8 NVReadDacMask(vgaHWPtr pVga)
144 NVPtr pNv = (NVPtr)pVga->MMIOBase;
145 return (VGA_RD08(pNv->PDIO, VGA_DAC_MASK));
147 static void NVWriteDacReadAddr(vgaHWPtr pVga, CARD8 value)
149 NVPtr pNv = (NVPtr)pVga->MMIOBase;
150 VGA_WR08(pNv->PDIO, VGA_DAC_READ_ADDR, value);
152 static void NVWriteDacWriteAddr(vgaHWPtr pVga, CARD8 value)
154 NVPtr pNv = (NVPtr)pVga->MMIOBase;
155 VGA_WR08(pNv->PDIO, VGA_DAC_WRITE_ADDR, value);
157 static void NVWriteDacData(vgaHWPtr pVga, CARD8 value)
159 NVPtr pNv = (NVPtr)pVga->MMIOBase;
160 VGA_WR08(pNv->PDIO, VGA_DAC_DATA, value);
162 static CARD8 NVReadDacData(vgaHWPtr pVga)
164 NVPtr pNv = (NVPtr)pVga->MMIOBase;
165 return (VGA_RD08(pNv->PDIO, VGA_DAC_DATA));
169 NVIsConnected (ScrnInfoPtr pScrn, int output)
171 NVPtr pNv = NVPTR(pScrn);
172 volatile U032 *PRAMDAC = pNv->PRAMDAC0;
173 CARD32 reg52C, reg608;
176 xf86DrvMsg(pScrn->scrnIndex, X_INFO,
177 "Probing for analog device on output %s...\n",
180 if(output) PRAMDAC += 0x800;
182 reg52C = PRAMDAC[0x052C/4];
183 reg608 = PRAMDAC[0x0608/4];
185 PRAMDAC[0x0608/4] = reg608 & ~0x00010000;
187 PRAMDAC[0x052C/4] = reg52C & 0x0000FEEE;
189 PRAMDAC[0x052C/4] |= 1;
191 pNv->PRAMDAC0[0x0610/4] = 0x94050140;
192 pNv->PRAMDAC0[0x0608/4] |= 0x00001000;
196 present = (PRAMDAC[0x0608/4] & (1 << 28)) ? TRUE : FALSE;
199 xf86DrvMsg(pScrn->scrnIndex, X_PROBED, " ...found one\n");
201 xf86DrvMsg(pScrn->scrnIndex, X_PROBED, " ...can't find one\n");
203 pNv->PRAMDAC0[0x0608/4] &= 0x0000EFFF;
205 PRAMDAC[0x052C/4] = reg52C;
206 PRAMDAC[0x0608/4] = reg608;
212 NVSelectHeadRegisters(ScrnInfoPtr pScrn, int head)
214 NVPtr pNv = NVPTR(pScrn);
217 pNv->PCIO = pNv->PCIO0 + 0x2000;
218 pNv->PCRTC = pNv->PCRTC0 + 0x800;
219 pNv->PRAMDAC = pNv->PRAMDAC0 + 0x800;
220 pNv->PDIO = pNv->PDIO0 + 0x2000;
222 pNv->PCIO = pNv->PCIO0;
223 pNv->PCRTC = pNv->PCRTC0;
224 pNv->PRAMDAC = pNv->PRAMDAC0;
225 pNv->PDIO = pNv->PDIO0;
230 NVProbeDDC (ScrnInfoPtr pScrn, int bus)
232 NVPtr pNv = NVPTR(pScrn);
233 xf86MonPtr MonInfo = NULL;
235 if(!pNv->I2C) return NULL;
237 pNv->DDCBase = bus ? 0x36 : 0x3e;
239 xf86DrvMsg(pScrn->scrnIndex, X_INFO,
240 "Probing for EDID on I2C bus %s...\n", bus ? "B" : "A");
242 if ((MonInfo = xf86DoEDID_DDC2(pScrn->scrnIndex, pNv->I2C))) {
243 xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
244 "DDC detected a %s:\n", MonInfo->features.input_type ?
246 xf86PrintEDID( MonInfo );
248 xf86DrvMsg(pScrn->scrnIndex, X_INFO,
249 " ... none found\n");
255 static void nv4GetConfig (NVPtr pNv)
257 if (pNv->PFB[0x0000/4] & 0x00000100) {
258 pNv->RamAmountKBytes = ((pNv->PFB[0x0000/4] >> 12) & 0x0F) * 1024 * 2
261 switch (pNv->PFB[0x0000/4] & 0x00000003) {
263 pNv->RamAmountKBytes = 1024 * 32;
266 pNv->RamAmountKBytes = 1024 * 4;
269 pNv->RamAmountKBytes = 1024 * 8;
273 pNv->RamAmountKBytes = 1024 * 16;
277 pNv->CrystalFreqKHz = (pNv->PEXTDEV[0x0000/4] & 0x00000040) ? 14318 : 13500;
278 pNv->CURSOR = &(pNv->PRAMIN[0x1E00]);
279 pNv->MinVClockFreqKHz = 12000;
280 pNv->MaxVClockFreqKHz = 350000;
283 static void nv10GetConfig (NVPtr pNv)
285 CARD32 implementation = pNv->Chipset & 0x0ff0;
287 #if X_BYTE_ORDER == X_BIG_ENDIAN
288 /* turn on big endian register access */
289 if(!(pNv->PMC[0x0004/4] & 0x01000001)) {
290 pNv->PMC[0x0004/4] = 0x01000001;
295 if(implementation == CHIPSET_NFORCE) {
296 int amt = pciReadLong(pciTag(0, 0, 1), 0x7C);
297 pNv->RamAmountKBytes = (((amt >> 6) & 31) + 1) * 1024;
298 } else if(implementation == CHIPSET_NFORCE2) {
299 int amt = pciReadLong(pciTag(0, 0, 1), 0x84);
300 pNv->RamAmountKBytes = (((amt >> 4) & 127) + 1) * 1024;
302 pNv->RamAmountKBytes = (pNv->PFB[0x020C/4] & 0xFFF00000) >> 10;
305 if(pNv->RamAmountKBytes > 256*1024)
306 pNv->RamAmountKBytes = 256*1024;
308 pNv->CrystalFreqKHz = (pNv->PEXTDEV[0x0000/4] & (1 << 6)) ? 14318 : 13500;
310 if(pNv->twoHeads && (implementation != CHIPSET_NV11))
312 if(pNv->PEXTDEV[0x0000/4] & (1 << 22))
313 pNv->CrystalFreqKHz = 27000;
316 pNv->CURSOR = NULL; /* can't set this here */
317 pNv->MinVClockFreqKHz = 12000;
318 pNv->MaxVClockFreqKHz = pNv->twoStagePLL ? 400000 : 350000;
323 NVCommonSetup(ScrnInfoPtr pScrn)
325 NVPtr pNv = NVPTR(pScrn);
326 vgaHWPtr pVga = VGAHWPTR(pScrn);
327 CARD16 implementation = pNv->Chipset & 0x0ff0;
328 xf86MonPtr monitorA, monitorB;
332 int FlatPanel = -1; /* really means the CRTC is slaved */
333 Bool Television = FALSE;
336 * Override VGA I/O routines.
338 pVga->writeCrtc = NVWriteCrtc;
339 pVga->readCrtc = NVReadCrtc;
340 pVga->writeGr = NVWriteGr;
341 pVga->readGr = NVReadGr;
342 pVga->writeAttr = NVWriteAttr;
343 pVga->readAttr = NVReadAttr;
344 pVga->writeSeq = NVWriteSeq;
345 pVga->readSeq = NVReadSeq;
346 pVga->writeMiscOut = NVWriteMiscOut;
347 pVga->readMiscOut = NVReadMiscOut;
348 pVga->enablePalette = NVEnablePalette;
349 pVga->disablePalette = NVDisablePalette;
350 pVga->writeDacMask = NVWriteDacMask;
351 pVga->readDacMask = NVReadDacMask;
352 pVga->writeDacWriteAddr = NVWriteDacWriteAddr;
353 pVga->writeDacReadAddr = NVWriteDacReadAddr;
354 pVga->writeDacData = NVWriteDacData;
355 pVga->readDacData = NVReadDacData;
357 * Note: There are different pointers to the CRTC/AR and GR/SEQ registers.
358 * Bastardize the intended uses of these to make it work.
360 pVga->MMIOBase = (CARD8 *)pNv;
361 pVga->MMIOOffset = 0;
363 pNv->REGS = xf86MapPciMem(pScrn->scrnIndex,
364 VIDMEM_MMIO | VIDMEM_READSIDEEFFECT,
365 pNv->PciTag, pNv->IOAddress, 0x01000000);
367 pNv->PRAMIN = pNv->REGS + (0x00710000/4);
368 pNv->PCRTC0 = pNv->REGS + (0x00600000/4);
369 pNv->PRAMDAC0 = pNv->REGS + (0x00680000/4);
370 pNv->PFB = pNv->REGS + (0x00100000/4);
371 pNv->PFIFO = pNv->REGS + (0x00002000/4);
372 pNv->PGRAPH = pNv->REGS + (0x00400000/4);
373 pNv->PEXTDEV = pNv->REGS + (0x00101000/4);
374 pNv->PTIMER = pNv->REGS + (0x00009000/4);
375 pNv->PMC = pNv->REGS + (0x00000000/4);
376 pNv->FIFO = pNv->REGS + (0x00800000/4);
378 /* 8 bit registers */
379 pNv->PCIO0 = (U008*)pNv->REGS + 0x00601000;
380 pNv->PDIO0 = (U008*)pNv->REGS + 0x00681000;
381 pNv->PVIO = (U008*)pNv->REGS + 0x000C0000;
383 pNv->twoHeads = (pNv->Architecture >= NV_ARCH_10) &&
384 (implementation != CHIPSET_NV10) &&
385 (implementation != CHIPSET_NV15) &&
386 (implementation != CHIPSET_NFORCE) &&
387 (implementation != CHIPSET_NV20);
389 pNv->fpScaler = (pNv->FpScale && pNv->twoHeads && (implementation!=CHIPSET_NV11));
391 pNv->twoStagePLL = (implementation == CHIPSET_NV31) ||
392 (implementation == CHIPSET_NV36) ||
393 (pNv->Architecture >= NV_ARCH_40);
395 pNv->WaitVSyncPossible = (pNv->Architecture >= NV_ARCH_10) &&
396 (implementation != CHIPSET_NV10);
398 pNv->BlendingPossible = ((pNv->Chipset & 0xffff) != CHIPSET_NV04);
400 /* look for known laptop chips */
401 /* FIXME we could add some ids here (0x0167) */
402 switch(pNv->Chipset & 0xffff) {
455 if(pNv->Architecture == NV_ARCH_04)
460 NVSelectHeadRegisters(pScrn, 0);
462 NVLockUnlock(pNv, 0);
466 pNv->Television = FALSE;
470 if((monitorA = NVProbeDDC(pScrn, 0))) {
471 FlatPanel = monitorA->features.input_type ? 1 : 0;
473 /* NV4 doesn't support FlatPanels */
474 if((pNv->Chipset & 0x0fff) <= CHIPSET_NV04)
477 VGA_WR08(pNv->PCIO, 0x03D4, 0x28);
478 if(VGA_RD08(pNv->PCIO, 0x03D5) & 0x80) {
479 VGA_WR08(pNv->PCIO, 0x03D4, 0x33);
480 if(!(VGA_RD08(pNv->PCIO, 0x03D5) & 0x01))
486 xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
487 "HW is currently programmed for %s\n",
488 FlatPanel ? (Television ? "TV" : "DFP") : "CRT");
491 if(pNv->FlatPanel == -1) {
492 pNv->FlatPanel = FlatPanel;
493 pNv->Television = Television;
495 xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
496 "Forcing display type to %s as specified\n",
497 pNv->FlatPanel ? "DFP" : "CRT");
500 CARD8 outputAfromCRTC, outputBfromCRTC;
502 CARD8 slaved_on_A, slaved_on_B;
503 Bool analog_on_A, analog_on_B;
507 if(implementation != CHIPSET_NV11) {
508 if(pNv->PRAMDAC0[0x0000052C/4] & 0x100)
512 if(pNv->PRAMDAC0[0x0000252C/4] & 0x100)
516 analog_on_A = NVIsConnected(pScrn, 0);
517 analog_on_B = NVIsConnected(pScrn, 1);
525 VGA_WR08(pNv->PCIO, 0x03D4, 0x44);
526 cr44 = VGA_RD08(pNv->PCIO, 0x03D5);
528 VGA_WR08(pNv->PCIO, 0x03D5, 3);
529 NVSelectHeadRegisters(pScrn, 1);
530 NVLockUnlock(pNv, 0);
532 VGA_WR08(pNv->PCIO, 0x03D4, 0x28);
533 slaved_on_B = VGA_RD08(pNv->PCIO, 0x03D5) & 0x80;
535 VGA_WR08(pNv->PCIO, 0x03D4, 0x33);
536 tvB = !(VGA_RD08(pNv->PCIO, 0x03D5) & 0x01);
539 VGA_WR08(pNv->PCIO, 0x03D4, 0x44);
540 VGA_WR08(pNv->PCIO, 0x03D5, 0);
541 NVSelectHeadRegisters(pScrn, 0);
542 NVLockUnlock(pNv, 0);
544 VGA_WR08(pNv->PCIO, 0x03D4, 0x28);
545 slaved_on_A = VGA_RD08(pNv->PCIO, 0x03D5) & 0x80;
547 VGA_WR08(pNv->PCIO, 0x03D4, 0x33);
548 tvA = !(VGA_RD08(pNv->PCIO, 0x03D5) & 0x01);
551 oldhead = pNv->PCRTC0[0x00000860/4];
552 pNv->PCRTC0[0x00000860/4] = oldhead | 0x00000010;
554 monitorA = NVProbeDDC(pScrn, 0);
555 monitorB = NVProbeDDC(pScrn, 1);
557 if(slaved_on_A && !tvA) {
560 xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
561 "CRTC 0 is currently programmed for DFP\n");
563 if(slaved_on_B && !tvB) {
566 xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
567 "CRTC 1 is currently programmed for DFP\n");
570 CRTCnumber = outputAfromCRTC;
572 xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
573 "CRTC %i appears to have a CRT attached\n", CRTCnumber);
576 CRTCnumber = outputBfromCRTC;
578 xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
579 "CRTC %i appears to have a CRT attached\n", CRTCnumber);
585 xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
586 "CRTC 0 is currently programmed for TV\n");
592 xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
593 "CRTC 1 is currently programmed for TV\n");
596 FlatPanel = monitorA->features.input_type ? 1 : 0;
599 FlatPanel = monitorB->features.input_type ? 1 : 0;
602 if(pNv->FlatPanel == -1) {
603 if(FlatPanel != -1) {
604 pNv->FlatPanel = FlatPanel;
605 pNv->Television = Television;
607 xf86DrvMsg(pScrn->scrnIndex, X_INFO,
608 "Unable to detect display type...\n");
610 xf86DrvMsg(pScrn->scrnIndex, X_DEFAULT,
611 "...On a laptop, assuming DFP\n");
614 xf86DrvMsg(pScrn->scrnIndex, X_DEFAULT,
615 "...Using default of CRT\n");
620 xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
621 "Forcing display type to %s as specified\n",
622 pNv->FlatPanel ? "DFP" : "CRT");
625 if(pNv->CRTCnumber == -1) {
626 if(CRTCnumber != -1) pNv->CRTCnumber = CRTCnumber;
628 xf86DrvMsg(pScrn->scrnIndex, X_INFO,
629 "Unable to detect which CRTCNumber...\n");
630 if(pNv->FlatPanel) pNv->CRTCnumber = 1;
631 else pNv->CRTCnumber = 0;
632 xf86DrvMsg(pScrn->scrnIndex, X_DEFAULT,
633 "...Defaulting to CRTCNumber %i\n", pNv->CRTCnumber);
636 xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
637 "Forcing CRTCNumber %i as specified\n", pNv->CRTCnumber);
641 if((monitorA->features.input_type && pNv->FlatPanel) ||
642 (!monitorA->features.input_type && !pNv->FlatPanel))
655 if((monitorB->features.input_type && !pNv->FlatPanel) ||
656 (!monitorB->features.input_type && pNv->FlatPanel))
665 if(implementation == CHIPSET_NV11)
666 cr44 = pNv->CRTCnumber * 0x3;
668 pNv->PCRTC0[0x00000860/4] = oldhead;
670 VGA_WR08(pNv->PCIO, 0x03D4, 0x44);
671 VGA_WR08(pNv->PCIO, 0x03D5, cr44);
672 NVSelectHeadRegisters(pScrn, pNv->CRTCnumber);
675 xf86DrvMsg(pScrn->scrnIndex, X_INFO,
676 "Using %s on CRTC %i\n",
677 pNv->FlatPanel ? (pNv->Television ? "TV" : "DFP") : "CRT",
680 if(pNv->FlatPanel && !pNv->Television) {
681 pNv->fpWidth = pNv->PRAMDAC[0x0820/4] + 1;
682 pNv->fpHeight = pNv->PRAMDAC[0x0800/4] + 1;
683 pNv->fpSyncs = pNv->PRAMDAC[0x0848/4] & 0x30000033;
684 xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Panel size is %i x %i\n",
685 pNv->fpWidth, pNv->fpHeight);
689 xf86SetDDCproperties(pScrn, monitorA);
691 if(!pNv->FlatPanel || (pScrn->depth != 24) || !pNv->twoHeads)
692 pNv->FPDither = FALSE;
695 if(pNv->FlatPanel && pNv->twoHeads) {
696 pNv->PRAMDAC0[0x08B0/4] = 0x00010004;
697 if(pNv->PRAMDAC0[0x08B4/4] & 1)
699 xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Panel is %s\n",
700 pNv->LVDS ? "LVDS" : "TMDS");