diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-08-28 22:00:09 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-08-28 22:00:09 +0000 |
commit | 1a1d77dd589de5a567fa95e36aa6999c704ceca4 (patch) | |
tree | 141e31f89f18b9fe0831f31852e0435ceaccafc5 /drivers/video/matrox | |
parent | fb9c690a18b3d66925a65b17441c37fa14d4370b (diff) |
Merge with 2.4.0-test7.
Diffstat (limited to 'drivers/video/matrox')
-rw-r--r-- | drivers/video/matrox/matroxfb_DAC1064.c | 58 | ||||
-rw-r--r-- | drivers/video/matrox/matroxfb_Ti3026.c | 4 | ||||
-rw-r--r-- | drivers/video/matrox/matroxfb_accel.c | 4 | ||||
-rw-r--r-- | drivers/video/matrox/matroxfb_base.c | 54 | ||||
-rw-r--r-- | drivers/video/matrox/matroxfb_base.h | 4 | ||||
-rw-r--r-- | drivers/video/matrox/matroxfb_misc.c | 4 |
6 files changed, 101 insertions, 27 deletions
diff --git a/drivers/video/matrox/matroxfb_DAC1064.c b/drivers/video/matrox/matroxfb_DAC1064.c index e8a3738f8..1c611ebee 100644 --- a/drivers/video/matrox/matroxfb_DAC1064.c +++ b/drivers/video/matrox/matroxfb_DAC1064.c @@ -4,14 +4,14 @@ * * (c) 1998,1999,2000 Petr Vandrovec <vandrove@vc.cvut.cz> * - * Version: 1.21 1999/01/09 + * Version: 1.50 2000/08/10 * * MTRR stuff: 1998 Tom Rini <trini@kernel.crashing.org> * * Contributors: "menion?" <menion@mindless.com> * Betatesting, fixes, ideas * - * "Kurt Garloff" <garloff@kg1.ping.de> + * "Kurt Garloff" <garloff@suse.de> * Betatesting, fixes, ideas, videomodes, videomodes timmings * * "Tom Rini" <trini@kernel.crashing.org> @@ -63,6 +63,9 @@ * "Mark Vojkovich" <mvojkovi@ucsd.edu> * G400 support * + * "Ken Aaker" <kdaaker@rchland.vnet.ibm.com> + * memtype extension (needed for GXT130P RS/6000 adapter) + * * (following author is not in any relation with this code, but his code * is included in this driver) * @@ -755,7 +758,7 @@ static int MGAG100_preinit(WPMINFO struct matrox_hw_state* hw){ if (ACCESS_FBINFO(devflags.noinit)) return 0; hw->MXoptionReg &= 0xC0000100; - hw->MXoptionReg |= 0x00078020; + hw->MXoptionReg |= 0x00000020; if (ACCESS_FBINFO(devflags.novga)) hw->MXoptionReg &= ~0x00000100; if (ACCESS_FBINFO(devflags.nobios)) @@ -763,13 +766,13 @@ static int MGAG100_preinit(WPMINFO struct matrox_hw_state* hw){ if (ACCESS_FBINFO(devflags.nopciretry)) hw->MXoptionReg |= 0x20000000; pci_write_config_dword(ACCESS_FBINFO(pcidev), PCI_OPTION_REG, hw->MXoptionReg); - pci_read_config_dword(ACCESS_FBINFO(pcidev), 0x50, ®50); - reg50 &= ~0x3000; - pci_write_config_dword(ACCESS_FBINFO(pcidev), 0x50, reg50); - DAC1064_setmclk(PMINFO hw, DAC1064_OPT_MDIV2 | DAC1064_OPT_GDIV3 | DAC1064_OPT_SCLK_PCI, 133333); if (ACCESS_FBINFO(devflags.accelerator) == FB_ACCEL_MATROX_MGAG100) { + pci_read_config_dword(ACCESS_FBINFO(pcidev), 0x50, ®50); + reg50 &= ~0x3000; + pci_write_config_dword(ACCESS_FBINFO(pcidev), 0x50, reg50); + hw->MXoptionReg |= 0x1080; pci_write_config_dword(ACCESS_FBINFO(pcidev), PCI_OPTION_REG, hw->MXoptionReg); mga_outl(M_CTLWTST, 0x00000300); @@ -797,20 +800,45 @@ static int MGAG100_preinit(WPMINFO struct matrox_hw_state* hw){ hw->MXoptionReg &= ~0x1000; } #endif + hw->MXoptionReg |= 0x00078020; + } else if (ACCESS_FBINFO(devflags.accelerator) == FB_ACCEL_MATROX_MGAG200) { + pci_read_config_dword(ACCESS_FBINFO(pcidev), 0x50, ®50); + reg50 &= ~0x3000; + pci_write_config_dword(ACCESS_FBINFO(pcidev), 0x50, reg50); + + if (ACCESS_FBINFO(devflags.memtype) == -1) + ACCESS_FBINFO(devflags.memtype) = 3; + hw->MXoptionReg |= (ACCESS_FBINFO(devflags.memtype) & 7) << 10; + if (ACCESS_FBINFO(devflags.sgram)) + hw->MXoptionReg |= 0x4000; + mga_outl(M_CTLWTST, 0x042450A1); + mga_outl(M_MEMRDBK, 0x00000108); + udelay(200); + mga_outl(M_MACCESS, 0x00000000); + mga_outl(M_MACCESS, 0x00008000); + udelay(100); + mga_outw(M_MEMRDBK, 0x00000108); + hw->MXoptionReg |= 0x00078020; } else { - hw->MXoptionReg |= 0x00000C00; + pci_read_config_dword(ACCESS_FBINFO(pcidev), 0x50, ®50); + reg50 &= ~0x00000100; + reg50 |= 0x00000000; + pci_write_config_dword(ACCESS_FBINFO(pcidev), 0x50, reg50); + + if (ACCESS_FBINFO(devflags.memtype) == -1) + ACCESS_FBINFO(devflags.memtype) = 0; + hw->MXoptionReg |= (ACCESS_FBINFO(devflags.memtype) & 7) << 10; if (ACCESS_FBINFO(devflags.sgram)) hw->MXoptionReg |= 0x4000; mga_outl(M_CTLWTST, 0x042450A1); - mga_outb(0x1E47, 0x00); - mga_outb(0x1E46, 0x00); - udelay(10); - mga_outb(0x1C05, 0x00); - mga_outb(0x1C05, 0x80); + mga_outl(M_MEMRDBK, 0x00000108); + udelay(200); + mga_outl(M_MACCESS, 0x00000000); + mga_outl(M_MACCESS, 0x00008000); udelay(100); - mga_outw(0x1E44, 0x0108); + mga_outl(M_MEMRDBK, 0x00000108); + hw->MXoptionReg |= 0x00040020; } - hw->MXoptionReg = (hw->MXoptionReg & ~0x1F8000) | 0x78000; pci_write_config_dword(ACCESS_FBINFO(pcidev), PCI_OPTION_REG, hw->MXoptionReg); return 0; } diff --git a/drivers/video/matrox/matroxfb_Ti3026.c b/drivers/video/matrox/matroxfb_Ti3026.c index 67dc556b0..7c65eaa0f 100644 --- a/drivers/video/matrox/matroxfb_Ti3026.c +++ b/drivers/video/matrox/matroxfb_Ti3026.c @@ -4,14 +4,14 @@ * * (c) 1998,1999,2000 Petr Vandrovec <vandrove@vc.cvut.cz> * - * Version: 1.21 2000/01/09 + * Version: 1.50 2000/08/10 * * MTRR stuff: 1998 Tom Rini <trini@kernel.crashing.org> * * Contributors: "menion?" <menion@mindless.com> * Betatesting, fixes, ideas * - * "Kurt Garloff" <garloff@kg1.ping.de> + * "Kurt Garloff" <garloff@suse.de> * Betatesting, fixes, ideas, videomodes, videomodes timmings * * "Tom Rini" <trini@kernel.crashing.org> diff --git a/drivers/video/matrox/matroxfb_accel.c b/drivers/video/matrox/matroxfb_accel.c index a28388e1e..d79e5e3e4 100644 --- a/drivers/video/matrox/matroxfb_accel.c +++ b/drivers/video/matrox/matroxfb_accel.c @@ -4,14 +4,14 @@ * * (c) 1998,1999,2000 Petr Vandrovec <vandrove@vc.cvut.cz> * - * Version: 1.21 2000/01/09 + * Version: 1.50 2000/08/10 * * MTRR stuff: 1998 Tom Rini <trini@kernel.crashing.org> * * Contributors: "menion?" <menion@mindless.com> * Betatesting, fixes, ideas * - * "Kurt Garloff" <garloff@kg1.ping.de> + * "Kurt Garloff" <garloff@suse.de> * Betatesting, fixes, ideas, videomodes, videomodes timmings * * "Tom Rini" <trini@kernel.crashing.org> diff --git a/drivers/video/matrox/matroxfb_base.c b/drivers/video/matrox/matroxfb_base.c index 9ddb30140..9a21d5dc7 100644 --- a/drivers/video/matrox/matroxfb_base.c +++ b/drivers/video/matrox/matroxfb_base.c @@ -4,14 +4,14 @@ * * (c) 1998,1999,2000 Petr Vandrovec <vandrove@vc.cvut.cz> * - * Version: 1.21 1999/01/09 + * Version: 1.50 2000/08/10 * * MTRR stuff: 1998 Tom Rini <trini@kernel.crashing.org> * * Contributors: "menion?" <menion@mindless.com> * Betatesting, fixes, ideas * - * "Kurt Garloff" <garloff@kg1.ping.de> + * "Kurt Garloff" <garloff@suse.de> * Betatesting, fixes, ideas, videomodes, videomodes timmings * * "Tom Rini" <trini@kernel.crashing.org> @@ -69,6 +69,9 @@ * "Anton Altaparmakov" <AntonA@bigfoot.com> * G400 MAX/non-MAX distinction * + * "Ken Aaker" <kdaaker@rchland.vnet.ibm.com> + * memtype extension (needed for GXT130P RS/6000 adapter) + * * (following author is not in any relation with this code, but his code * is included in this driver) * @@ -1312,6 +1315,7 @@ static unsigned int fv = 0; /* "matrox:fv:xxxxx" */ static unsigned int fh = 0; /* "matrox:fh:xxxxxk" */ static unsigned int maxclk = 0; /* "matrox:maxclk:xxxxM" */ static int dfp = 0; /* "matrox:dfp */ +static int memtype = -1; /* "matrox:memtype:xxx" */ static char fontname[64]; /* "matrox:font:xxxxx" */ #ifndef MODULE @@ -2037,6 +2041,9 @@ static int matroxfb_probe(struct pci_dev* pdev, const struct pci_device_id* dumm memcpy(ACCESS_FBINFO(fbcon.fontname), fontname, sizeof(ACCESS_FBINFO(fbcon.fontname))); /* DEVFLAGS */ ACCESS_FBINFO(devflags.inverse) = inverse; + ACCESS_FBINFO(devflags.memtype) = memtype; + if (memtype != -1) + noinit = 0; if (cmd & PCI_COMMAND_MEMORY) { ACCESS_FBINFO(devflags.novga) = novga; ACCESS_FBINFO(devflags.nobios) = nobios; @@ -2050,6 +2057,7 @@ static int matroxfb_probe(struct pci_dev* pdev, const struct pci_device_id* dumm ACCESS_FBINFO(devflags.nobios) = 1; ACCESS_FBINFO(devflags.noinit) = 0; } + ACCESS_FBINFO(devflags.nopciretry) = no_pci_retry; ACCESS_FBINFO(devflags.mga_24bpp_fix) = inv24; ACCESS_FBINFO(devflags.precise_width) = option_precise_width; @@ -2094,10 +2102,42 @@ static void pci_remove_matrox(struct pci_dev* pdev) { matroxfb_remove(PMINFO 1); } +static struct pci_device_id matroxfb_devices[] __devinitdata = { +#ifdef CONFIG_FB_MATROX_MILLENIUM + {PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_MIL, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_MIL_2, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_MIL_2_AGP, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, +#endif +#ifdef CONFIG_FB_MATROX_MYSTIQUE + {PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_MYS, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, +#endif +#ifdef CONFIG_FB_MATROX_G100 + {PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_G100, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_G100_AGP, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_G200_PCI, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_G200_AGP, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_G400_AGP, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, +#endif + {0, 0, + 0, 0, 0, 0, 0} +}; + +MODULE_DEVICE_TABLE(pci, matroxfb_devices); + static struct pci_driver matroxfb_driver = { - name: "matroxfb", - probe: matroxfb_probe, - remove: pci_remove_matrox, + name: "matroxfb", + id_table: matroxfb_devices, + probe: matroxfb_probe, + remove: pci_remove_matrox, }; /* **************************** init-time only **************************** */ @@ -2378,6 +2418,8 @@ int __init matroxfb_setup(char *options) { sgram = 1; else if (!strcmp(this_opt, "sdram")) sgram = 0; + else if (!strncmp(this_opt, "memtype:", 8)) + memtype = simple_strtoul(this_opt+8, NULL, 0); else { int value = 1; @@ -2461,6 +2503,8 @@ MODULE_PARM(nobios, "i"); MODULE_PARM_DESC(nobios, "Disables ROM BIOS (0 or 1=disabled) (default=do not change BIOS state)"); MODULE_PARM(noinit, "i"); MODULE_PARM_DESC(noinit, "Disables W/SG/SD-RAM and bus interface initialization (0 or 1=do not initialize) (default=0)"); +MODULE_PARM(memtype, "i"); +MODULE_PARM_DESC(memtype, "Memory type for G200/G400 (see Documentation/fb/matroxfb.txt for explanation) (default=3 for G200, 0 for G400)"); MODULE_PARM(mtrr, "i"); MODULE_PARM_DESC(mtrr, "This speeds up video memory accesses (0=disabled or 1) (default=1)"); MODULE_PARM(sgram, "i"); diff --git a/drivers/video/matrox/matroxfb_base.h b/drivers/video/matrox/matroxfb_base.h index c8a47fe9e..125f8be4f 100644 --- a/drivers/video/matrox/matroxfb_base.h +++ b/drivers/video/matrox/matroxfb_base.h @@ -2,7 +2,7 @@ * * Hardware accelerated Matrox Millennium I, II, Mystique, G100, G200 and G400 * - * (c) 1998,1999 Petr Vandrovec <vandrove@vc.cvut.cz> + * (c) 1998,1999,2000 Petr Vandrovec <vandrove@vc.cvut.cz> * */ #ifndef __MATROXFB_H__ @@ -530,6 +530,7 @@ struct matrox_fb_info { unsigned int textvram; /* character cells */ unsigned int ydstorg; /* offset in bytes from video start to usable memory */ /* 0 except for 6MB Millenium */ + int memtype; } devflags; struct display_switch dispsw; struct { @@ -695,6 +696,7 @@ void matroxfb_unregister_driver(struct matroxfb_driver* drv); #define M_VCOUNT 0x1E20 #define M_RESET 0x1E40 +#define M_MEMRDBK 0x1E44 #define M_AGP2PLL 0x1E4C diff --git a/drivers/video/matrox/matroxfb_misc.c b/drivers/video/matrox/matroxfb_misc.c index 126ab9b66..ff9d6fb75 100644 --- a/drivers/video/matrox/matroxfb_misc.c +++ b/drivers/video/matrox/matroxfb_misc.c @@ -4,14 +4,14 @@ * * (c) 1998,1999,2000 Petr Vandrovec <vandrove@vc.cvut.cz> * - * Version: 1.21 2000/01/09 + * Version: 1.50 2000/08/10 * * MTRR stuff: 1998 Tom Rini <trini@kernel.crashing.org> * * Contributors: "menion?" <menion@mindless.com> * Betatesting, fixes, ideas * - * "Kurt Garloff" <garloff@kg1.ping.de> + * "Kurt Garloff" <garloff@suse.de> * Betatesting, fixes, ideas, videomodes, videomodes timmings * * "Tom Rini" <trini@kernel.crashing.org> |