diff options
Diffstat (limited to 'drivers/video/matrox')
-rw-r--r-- | drivers/video/matrox/matroxfb_DAC1064.c | 82 | ||||
-rw-r--r-- | drivers/video/matrox/matroxfb_base.c | 43 | ||||
-rw-r--r-- | drivers/video/matrox/matroxfb_base.h | 7 |
3 files changed, 32 insertions, 100 deletions
diff --git a/drivers/video/matrox/matroxfb_DAC1064.c b/drivers/video/matrox/matroxfb_DAC1064.c index c080de89a..92ab4e4df 100644 --- a/drivers/video/matrox/matroxfb_DAC1064.c +++ b/drivers/video/matrox/matroxfb_DAC1064.c @@ -1,81 +1,12 @@ /* * - * Hardware accelerated Matrox Millennium I, II, Mystique, G100, G200 and G400 + * Hardware accelerated Matrox Millennium I, II, Mystique, G100, G200, G400 and G450. * - * (c) 1998,1999,2000 Petr Vandrovec <vandrove@vc.cvut.cz> + * (c) 1998-2001 Petr Vandrovec <vandrove@vc.cvut.cz> * - * Version: 1.50 2000/08/10 + * Version: 1.52 2001/02/02 * - * MTRR stuff: 1998 Tom Rini <trini@kernel.crashing.org> - * - * Contributors: "menion?" <menion@mindless.com> - * Betatesting, fixes, ideas - * - * "Kurt Garloff" <garloff@suse.de> - * Betatesting, fixes, ideas, videomodes, videomodes timmings - * - * "Tom Rini" <trini@kernel.crashing.org> - * MTRR stuff, PPC cleanups, betatesting, fixes, ideas - * - * "Bibek Sahu" <scorpio@dodds.net> - * Access device through readb|w|l and write b|w|l - * Extensive debugging stuff - * - * "Daniel Haun" <haund@usa.net> - * Testing, hardware cursor fixes - * - * "Scott Wood" <sawst46+@pitt.edu> - * Fixes - * - * "Gerd Knorr" <kraxel@goldbach.isdn.cs.tu-berlin.de> - * Betatesting - * - * "Kelly French" <targon@hazmat.com> - * "Fernando Herrera" <fherrera@eurielec.etsit.upm.es> - * Betatesting, bug reporting - * - * "Pablo Bianucci" <pbian@pccp.com.ar> - * Fixes, ideas, betatesting - * - * "Inaky Perez Gonzalez" <inaky@peloncho.fis.ucm.es> - * Fixes, enhandcements, ideas, betatesting - * - * "Ryuichi Oikawa" <roikawa@rr.iiij4u.or.jp> - * PPC betatesting, PPC support, backward compatibility - * - * "Paul Womar" <Paul@pwomar.demon.co.uk> - * "Owen Waller" <O.Waller@ee.qub.ac.uk> - * PPC betatesting - * - * "Thomas Pornin" <pornin@bolet.ens.fr> - * Alpha betatesting - * - * "Pieter van Leuven" <pvl@iae.nl> - * "Ulf Jaenicke-Roessler" <ujr@physik.phy.tu-dresden.de> - * G100 testing - * - * "H. Peter Arvin" <hpa@transmeta.com> - * Ideas - * - * "Cort Dougan" <cort@cs.nmt.edu> - * CHRP fixes and PReP cleanup - * - * "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) - * - * Based on framebuffer driver for VBE 2.0 compliant graphic boards - * (c) 1998 Gerd Knorr <kraxel@cs.tu-berlin.de> - * - * (following author is not in any relation with this code, but his ideas - * were used when writting this driver) - * - * FreeVBE/AF (Matrox), "Shawn Hargreaves" <shawn@talula.demon.co.uk> + * See matroxfb_base.c for contributors. * */ @@ -787,6 +718,11 @@ static int MGAG100_preinit(WPMINFO struct matrox_hw_state* hw){ ACCESS_FBINFO(primout) = &m1064; + if (ACCESS_FBINFO(devflags.g450dac)) { + /* we must do this always, BIOS does not do it for us + and accelerator dies without it */ + mga_outl(0x1C0C, 0); + } if (ACCESS_FBINFO(devflags.noinit)) return 0; hw->MXoptionReg &= 0xC0000100; diff --git a/drivers/video/matrox/matroxfb_base.c b/drivers/video/matrox/matroxfb_base.c index 090895204..e07db7235 100644 --- a/drivers/video/matrox/matroxfb_base.c +++ b/drivers/video/matrox/matroxfb_base.c @@ -2,9 +2,9 @@ * * Hardware accelerated Matrox Millennium I, II, Mystique, G100, G200 and G400 * - * (c) 1998,1999,2000 Petr Vandrovec <vandrove@vc.cvut.cz> + * (c) 1998-2001 Petr Vandrovec <vandrove@vc.cvut.cz> * - * Version: 1.50 2000/08/10 + * Version: 1.52 2001/02/02 * * MTRR stuff: 1998 Tom Rini <trini@kernel.crashing.org> * @@ -1409,12 +1409,12 @@ static struct video_board vbG400 = {0x2000000, 0x1000000, FB_ACCEL_MATROX_MGAG4 #define DEVF_VIDEO64BIT 0x0001 #define DEVF_SWAPS 0x0002 -#define DEVF_MILLENNIUM 0x0004 -#define DEVF_MILLENNIUM2 0x0008 +/* #define DEVF_recycled 0x0004 */ +/* #define DEVF_recycled 0x0008 */ #define DEVF_CROSS4MB 0x0010 #define DEVF_TEXT4B 0x0020 #define DEVF_DDC_8_2 0x0040 -#define DEVF_DMA 0x0080 +/* #define DEVF_recycled 0x0080 */ #define DEVF_SUPPORT32MB 0x0100 #define DEVF_ANY_VXRES 0x0200 #define DEVF_TEXT16B 0x0400 @@ -1441,19 +1441,19 @@ static struct board { #ifdef CONFIG_FB_MATROX_MILLENIUM {PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_MIL, 0xFF, 0, 0, - DEVF_MILLENNIUM | DEVF_TEXT4B, + DEVF_TEXT4B, 230000, &vbMillennium, "Millennium (PCI)"}, {PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_MIL_2, 0xFF, 0, 0, - DEVF_MILLENNIUM | DEVF_MILLENNIUM2 | DEVF_SWAPS, + DEVF_SWAPS, 220000, &vbMillennium2, "Millennium II (PCI)"}, {PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_MIL_2_AGP, 0xFF, 0, 0, - DEVF_MILLENNIUM | DEVF_MILLENNIUM2 | DEVF_SWAPS, + DEVF_SWAPS, 250000, &vbMillennium2A, "Millennium II (AGP)"}, @@ -1461,13 +1461,13 @@ static struct board { #ifdef CONFIG_FB_MATROX_MYSTIQUE {PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_MYS, 0x02, 0, 0, - DEVF_VIDEO64BIT, + DEVF_VIDEO64BIT | DEVF_CROSS4MB, 180000, &vbMystique, "Mystique (PCI)"}, {PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_MYS, 0xFF, 0, 0, - DEVF_VIDEO64BIT | DEVF_SWAPS, + DEVF_VIDEO64BIT | DEVF_SWAPS | DEVF_CROSS4MB, 220000, &vbMystique, "Mystique 220 (PCI)"}, @@ -1842,33 +1842,33 @@ static int initMatrox2(WPMINFO struct display* d, struct board* b){ } /* FIXME: Where to move this?! */ -#if defined(CONFIG_PPC) +#if defined(CONFIG_ALL_PPC) #if defined(CONFIG_FB_COMPAT_XPMAC) strcpy(ACCESS_FBINFO(matrox_name), "MTRX,"); /* OpenFirmware naming convension */ strncat(ACCESS_FBINFO(matrox_name), b->name, 26); if (!console_fb_info) console_fb_info = &ACCESS_FBINFO(fbcon); #endif - if ((xres <= 640) && (yres <= 480)) { +#ifndef MODULE + if (_machine == _MACH_Pmac) { struct fb_var_screeninfo var; - if (default_vmode == VMODE_NVRAM) { - default_vmode = nvram_read_byte(NV_VMODE); - if (default_vmode <= 0 || default_vmode > VMODE_MAX) - default_vmode = VMODE_CHOOSE; - } if (default_vmode <= 0 || default_vmode > VMODE_MAX) default_vmode = VMODE_640_480_60; +#ifdef CONFIG_NVRAM if (default_cmode == CMODE_NVRAM) default_cmode = nvram_read_byte(NV_CMODE); +#endif if (default_cmode < CMODE_8 || default_cmode > CMODE_32) default_cmode = CMODE_8; if (!mac_vmode_to_var(default_vmode, default_cmode, &var)) { var.accel_flags = vesafb_defined.accel_flags; var.xoffset = var.yoffset = 0; - vesafb_defined = var; /* Note: mac_vmode_to_var() doesnot set all parameters */ + /* Note: mac_vmode_to_var() does not set all parameters */ + vesafb_defined = var; } } -#endif /* CONFIG_PPC */ +#endif /* !MODULE */ +#endif /* CONFIG_ALL_PPC */ vesafb_defined.xres_virtual = vesafb_defined.xres; if (nopan) { vesafb_defined.yres_virtual = vesafb_defined.yres; @@ -2005,6 +2005,7 @@ static int matroxfb_probe(struct pci_dev* pdev, const struct pci_device_id* dumm u_int32_t cmd; #ifndef CONFIG_FB_MATROX_MULTIHEAD static int registered = 0; + static struct display global_disp; #endif DBG("matroxfb_probe") @@ -2502,8 +2503,8 @@ int __init matroxfb_init(void) /* *************************** init module code **************************** */ -MODULE_AUTHOR("(c) 1998,1999 Petr Vandrovec <vandrove@vc.cvut.cz>"); -MODULE_DESCRIPTION("Accelerated FBDev driver for Matrox Millennium/Mystique/G100/G200/G400"); +MODULE_AUTHOR("(c) 1998-2001 Petr Vandrovec <vandrove@vc.cvut.cz>"); +MODULE_DESCRIPTION("Accelerated FBDev driver for Matrox Millennium/Mystique/G100/G200/G400/G450"); MODULE_PARM(mem, "i"); MODULE_PARM_DESC(mem, "Size of available memory in MB, KB or B (2,4,8,12,16MB, default=autodetect)"); MODULE_PARM(disabled, "i"); diff --git a/drivers/video/matrox/matroxfb_base.h b/drivers/video/matrox/matroxfb_base.h index 68a8ab883..20c627905 100644 --- a/drivers/video/matrox/matroxfb_base.h +++ b/drivers/video/matrox/matroxfb_base.h @@ -32,7 +32,7 @@ #include <linux/string.h> #include <linux/mm.h> #include <linux/tty.h> -#include <linux/malloc.h> +#include <linux/slab.h> #include <linux/delay.h> #include <linux/fb.h> #include <linux/console.h> @@ -589,7 +589,6 @@ static inline struct matrox_fb_info* mxinfo(const struct display* p) { #else extern struct matrox_fb_info matroxfb_global_mxinfo; -struct display global_disp; #define ACCESS_FBINFO(x) (matroxfb_global_mxinfo.x) #define ACCESS_FBINFO2(info, x) (matroxfb_global_mxinfo.x) @@ -787,11 +786,7 @@ void matroxfb_unregister_driver(struct matroxfb_driver* drv); #define mga_setr(addr,port,val) do { mga_outb(addr, port); mga_outb((addr)+1, val); } while (0) #endif -#ifdef __LITTLE_ENDIAN -#define mga_fifo(n) do {} while (mga_inb(M_FIFOSTATUS) < (n)) -#else #define mga_fifo(n) do {} while ((mga_inl(M_FIFOSTATUS) & 0xFF) < (n)) -#endif #define WaitTillIdle() do {} while (mga_inl(M_STATUS) & 0x10000) |