~ubuntu-branches/debian/lenny/xserver-xorg-video-nv/lenny

« back to all changes in this revision

Viewing changes to src/nv_driver.c

  • Committer: Bazaar Package Importer
  • Author(s): Kyle McMartin
  • Date: 2007-03-19 14:08:02 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070319140802-llr8iovnl7jihfk1
Tags: 1:2.0.0-0ubuntu1
* New upstream version,
  - GeForce8800 support (8800GTX/GTS)

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
 
38
38
const   OptionInfoRec * RivaAvailableOptions(int chipid, int busid);
39
39
Bool    RivaGetScrnInfoRec(PciChipsets *chips, int chip);
 
40
Bool    G80GetScrnInfoRec(PciChipsets *chips, int chip);
40
41
 
41
42
/*
42
43
 * Forward definitions for the functions that make up the driver.
332
333
  { 0x10DE0244, "GeForce Go 6150" },
333
334
  { 0x10DE0247, "GeForce Go 6100" },
334
335
 
 
336
#if SUPPORT_G80
 
337
  { 0x10DE0191, "GeForce 8800 GTX" },
 
338
  { 0x10DE0193, "GeForce 8800 GTS" },
 
339
  { 0x10DE019D, "Quadro FX 5600" },
 
340
  { 0x10DE019E, "Quadro FX 4600" },
 
341
#endif
 
342
 
335
343
  {-1, NULL}
336
344
};
337
345
 
440
448
    NULL
441
449
};
442
450
 
443
 
static const char *rivaSymbols[] = {
444
 
   "RivaGetScrnInfoRec",
445
 
   "RivaAvailableOptions",
446
 
    NULL
447
 
};
448
 
 
449
451
 
450
452
#ifdef XFree86LOADER
451
453
 
558
560
         * might refer to.
559
561
         */
560
562
        LoaderRefSymLists(vgahwSymbols, xaaSymbols, fbSymbols,
561
 
                          ramdacSymbols, shadowSymbols, rivaSymbols,
 
563
                          ramdacSymbols, shadowSymbols,
562
564
                          i2cSymbols, ddcSymbols, vbeSymbols,
563
565
                          fbdevHWSymbols, int10Symbols, NULL);
564
566
 
580
582
NVAvailableOptions(int chipid, int busid)
581
583
{
582
584
    if(chipid == 0x12D20018) {
583
 
        if (!xf86LoadOneModule("riva128", NULL)) {
584
 
            return NULL;
585
 
        } else
586
 
            return RivaAvailableOptions(chipid, busid);
 
585
        return RivaAvailableOptions(chipid, busid);
587
586
    }
588
587
    
589
588
    return NVOptions;
656
655
    return pciid;
657
656
}
658
657
 
 
658
#if SUPPORT_G80
 
659
static Bool
 
660
NVIsG80(int chipType)
 
661
{
 
662
    switch(chipType & 0xfff0) {
 
663
        case 0x0190:
 
664
        case 0x0400:
 
665
        case 0x0420:
 
666
            return TRUE;
 
667
    }
 
668
 
 
669
    return FALSE;
 
670
}
 
671
#endif
659
672
 
660
673
/* Mandatory */
661
674
static Bool
709
722
               NVPciChipsets[numUsed].resList = RES_SHARED_VGA;
710
723
               numUsed++;
711
724
            } else if ((*ppPci)->vendor == PCI_VENDOR_NVIDIA) {
 
725
               Bool canHandle = FALSE;
 
726
 
712
727
               /* look for a compatible devices which may be newer than 
713
728
                  the NVKnownChipsets list above.  */
714
729
               switch(token & 0xfff0) {
734
749
               case 0x0290:
735
750
               case 0x0390:
736
751
               case 0x03D0:
 
752
                   canHandle = TRUE;
 
753
                   break;
 
754
               default:  break;  /* we don't recognize it */
 
755
               }
 
756
 
 
757
#if SUPPORT_G80
 
758
               if(NVIsG80((*ppPci)->chipType))
 
759
                   canHandle = TRUE;
 
760
#endif
 
761
 
 
762
               if(canHandle) {
737
763
                   NVChipsets[numUsed].token = pciid;
738
764
                   NVChipsets[numUsed].name = "Unknown NVIDIA chip";
739
765
                   NVPciChipsets[numUsed].numChipset = pciid;
740
766
                   NVPciChipsets[numUsed].PCIid = pciid;
741
767
                   NVPciChipsets[numUsed].resList = RES_SHARED_VGA;
742
768
                   numUsed++;
743
 
                   break;
744
 
               default:  break;  /* we don't recognize it */
745
769
               }
746
770
            }
747
771
        }
769
793
 
770
794
        pPci = xf86GetPciInfoForEntity(usedChips[i]);
771
795
        if(pPci->vendor == PCI_VENDOR_NVIDIA_SGS) {
772
 
            if (!xf86LoadDrvSubModule(drv, "riva128")) {
773
 
                  continue;
774
 
            }
775
 
            xf86LoaderReqSymLists(rivaSymbols, NULL);
776
796
            if(RivaGetScrnInfoRec(NVPciChipsets, usedChips[i]))
777
797
                foundScreen = TRUE;
 
798
#if SUPPORT_G80
 
799
        } else if (NVIsG80(pPci->chipType)) {
 
800
            if(G80GetScrnInfoRec(NVPciChipsets, usedChips[i]))
 
801
                foundScreen = TRUE;
 
802
#endif
778
803
        } else {
779
804
            if(NVGetScrnInfoRec(NVPciChipsets, usedChips[i])) 
780
805
                foundScreen = TRUE;
1711
1736
    NVPtr pNv = NVPTR(pScrn);
1712
1737
    NVRegPtr nvReg;
1713
1738
 
 
1739
    NVSync(pScrn);
 
1740
 
1714
1741
    /* Initialise the ModeReg values */
1715
1742
    if (!vgaHWInit(pScrn, mode))
1716
1743
        return FALSE;
1766
1793
    NVPtr pNv = NVPTR(pScrn);
1767
1794
    NVRegPtr nvReg = &pNv->SavedReg;
1768
1795
 
 
1796
    if(pNv->HWCursor)
 
1797
        NVShowHideCursor(pNv, 0);
1769
1798
    NVLockUnlock(pNv, 0);
1770
1799
 
1771
1800
    if(pNv->twoHeads) {