workaround wrong detected memory sizes on G400 cards.

patch by ilmari@ping.uio.no (Dagfinn Ilmari Mannsåker)


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9519 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
attila 2003-03-02 21:21:56 +00:00
parent 6514fbb076
commit 97f08af457
1 changed files with 21 additions and 0 deletions

View File

@ -88,6 +88,18 @@
#define PCI_DEVICE_ID_MATROX_G550 0x2527
#endif
#ifndef PCI_SUBSYSTEM_ID_MATROX_G400_DH_16MB
#define PCI_SUBSYSTEM_ID_MATROX_G400_DH_16MB 0x2159
#endif
#ifndef PCI_SUBSYSTEM_ID_MATROX_G400_16MB_SGRAM
#define PCI_SUBSYSTEM_ID_MATROX_G400_16MB_SGRAM 0x19d8
#endif
#ifndef PCI_SUBSYSTEM_ID_MATROX_G400_16MB_SDRAM
#define PCI_SUBSYSTEM_ID_MATROX_G400_16MB_SDRAM 0x0328
#endif
MODULE_AUTHOR("Aaron Holtzman <aholtzma@engr.uvic.ca>");
#ifdef MODULE_LICENSE
MODULE_LICENSE("GPL");
@ -1366,6 +1378,15 @@ static int mga_vid_find_card(void)
mga_ram_size = 16;
printk(KERN_INFO "mga_vid: Couldn't detect RAMSIZE, assuming 16MB!");
}
/* Check for buggy 16MB cards reporting 32 MB */
if(mga_ram_size != 16 &&
(pci_dev->subsystem_device == PCI_SUBSYSTEM_ID_MATROX_G400_16MB_SDRAM ||
pci_dev->subsystem_device == PCI_SUBSYSTEM_ID_MATROX_G400_16MB_SGRAM ||
pci_dev->subsystem_device == PCI_SUBSYSTEM_ID_MATROX_G400_DH_16MB))
{
printk(KERN_INFO "mga_vid: Detected 16MB card reporting %d MB RAMSIZE, overriding\n", mga_ram_size);
mga_ram_size = 16;
}
}else{
switch((card_option>>10)&0x17){
// case 0x10: