From: Petr V. <van...@vc...> - 2001-06-18 17:10:10
|
Hi Alan, this patch for 2.4.5-ac15 adds following features/bugfixes to matroxfb driver: (1) add support for G100 with SGRAM. It was needed to disable acceleration before. (2) clears SRCORG and DSTORG accelerator registers on G200/G400/G450. Symptom was that after running XF4 with matrox's mga_drv console cannot use acceleration as nothing is paint by accelerator to visible screen. I can only hope that after XF exits DSTORG points somewhere to framebuffer and not to main memory, otherwise it could cause couple of memory corruptions in the past... (3) updated documentation, added matroxfb into MAINTAINERS and into CREDIT, so people know where to ask... Thanks for applying this, Petr Vandrovec van...@vc... diff -urdN linux/CREDITS linux/CREDITS --- linux/CREDITS Mon Jun 18 12:23:11 2001 +++ linux/CREDITS Mon Jun 18 15:41:10 2001 @@ -2869,6 +2869,7 @@ N: Petr Vandrovec E: van...@vc... D: Small contributions to ncpfs +D: Matrox framebuffer driver S: Chudenicka 8 S: 10200 Prague 10, Hostivar S: Czech Republic diff -urdN linux/Documentation/fb/matroxfb.txt linux/Documentation/fb/matroxfb.txt --- linux/Documentation/fb/matroxfb.txt Sun Nov 12 02:47:40 2000 +++ linux/Documentation/fb/matroxfb.txt Mon Jun 18 15:48:01 2001 @@ -173,9 +173,9 @@ mtrr - enables write combining on frame buffer. It speeds up video accesses much. It is default. You must have MTRR support enabled in kernel and your CPU must have MTRR (f.e. Pentium II have them). -sgram - tells to driver that you have G200 with SGRAM memory. It has no +sgram - tells to driver that you have Gxx0 with SGRAM memory. It has no effect without `init'. -sdram - tells to driver that you have G200 with SDRAM memory. +sdram - tells to driver that you have Gxx0 with SDRAM memory. It is a default. inv24 - change timings parameters for 24bpp modes on Millenium and Millenium II. Specify this if you see strange color shadows around @@ -279,7 +279,7 @@ + 24bpp does not support correctly XF-FBDev on big-endian architectures. + interlaced text mode is not supported; it looks like hardware limitation, but I'm not sure. - + G200 SGRAM/SDRAM is not autodetected. + + Gxx0 SGRAM/SDRAM is not autodetected. + maybe more... And following misfeatures: + SVGALib does not restore screen on exit. @@ -336,7 +336,7 @@ ACCEL, nofastfont 8x16 12x22 6x11 - Millennium I G200 Millennium I G200 Millennium I G200 + Millennium I G200 Millennium I G200 Millennium I G200 8bpp 7.79 7.24 13.55 7.78 30.00 21.01 16bpp 9.13 7.78 16.16 7.78 30.00 21.01 24bpp 14.17 10.72 18.69 10.24 34.99 21.01 @@ -344,7 +344,7 @@ ACCEL, fastfont 8x16 12x22 6x11 - Millennium I G200 Millennium I G200 Millennium I G200 + Millennium I G200 Millennium I G200 Millennium I G200 8bpp 8.41 6.01 6.54 4.37 16.00 10.51 16bpp 9.54 9.12 8.76 6.17 17.52 14.01 24bpp 15.00 12.36 11.67 10.00 22.01 18.32 @@ -355,6 +355,8 @@ Millennium I G200 TEXT 3.29 1.50 +* Yes, it is slower than Millennium I. + Dualhead G400 ============= @@ -376,7 +378,22 @@ + if you compiled it as module, you must insert i2c-matroxfb, matroxfb_maven and matroxfb_crtc2 into kernel. + +Dualhead G450 +============= +Driver supports dualhead G450 with some limitations: + + secondary head shares videomemory with primary head. It is not problem + if you have 32MB of videoram, but if you have only 16MB, you may have + to think twice before choosing videomode. + + due to hardware limitation, secondary head can use only 16 and 32bpp + videomodes. + + secondary head is not accelerated. + + secondary head always powerups in 640x480@60-32 videomode. You have to use + fbset to change this mode. + + TV output is not supported + + kernel is not fully multihead ready, so some things are impossible to do. + + if you compiled it as module, you must insert matroxfb_g450 and matroxfb_crtc2 + into kernel. -* Yes, it is slower than Millennium I. -- Petr Vandrovec <van...@vc...> diff -urdN linux/MAINTAINERS linux/MAINTAINERS --- linux/MAINTAINERS Mon Jun 18 12:23:12 2001 +++ linux/MAINTAINERS Mon Jun 18 15:40:38 2001 @@ -895,6 +895,12 @@ M: za...@za... S: Odd Fixes +MATROX FRAMEBUFFER DRIVER +P: Petr Vandrovec +M: van...@vc... +L: lin...@li... +S: Maintained + MEMORY TECHNOLOGY DEVICES P: David Woodhouse M: dw...@re... diff -urdN linux/drivers/video/matrox/matroxfb_DAC1064.c linux/drivers/video/matrox/matroxfb_DAC1064.c --- linux/drivers/video/matrox/matroxfb_DAC1064.c Mon Jun 18 12:23:29 2001 +++ linux/drivers/video/matrox/matroxfb_DAC1064.c Mon Jun 18 12:33:42 2001 @@ -4,7 +4,7 @@ * * (c) 1998-2001 Petr Vandrovec <van...@vc...> * - * Version: 1.52 2001/02/02 + * Version: 1.53 2001/06/18 * * See matroxfb_base.c for contributors. * @@ -721,7 +721,8 @@ ACCESS_FBINFO(capable.vxres) = vxres_g100; ACCESS_FBINFO(features.accel.has_cacheflush) = 1; ACCESS_FBINFO(cursor.timer.function) = matroxfb_DAC1064_flashcursor; - ACCESS_FBINFO(capable.plnwt) = ACCESS_FBINFO(devflags.accelerator) != FB_ACCEL_MATROX_MGAG100; + ACCESS_FBINFO(capable.plnwt) = ACCESS_FBINFO(devflags.accelerator) == FB_ACCEL_MATROX_MGAG100 + ? ACCESS_FBINFO(devflags.sgram) : 1; ACCESS_FBINFO(primout) = &m1064; diff -urdN linux/drivers/video/matrox/matroxfb_accel.c linux/drivers/video/matrox/matroxfb_accel.c --- linux/drivers/video/matrox/matroxfb_accel.c Thu Aug 10 19:34:31 2000 +++ linux/drivers/video/matrox/matroxfb_accel.c Mon Jun 18 15:52:55 2001 @@ -2,9 +2,9 @@ * * Hardware accelerated Matrox Millennium I, II, Mystique, G100, G200 and G400 * - * (c) 1998,1999,2000 Petr Vandrovec <van...@vc...> + * (c) 1998-2001 Petr Vandrovec <van...@vc...> * - * Version: 1.50 2000/08/10 + * Version: 1.51 2001/06/18 * * MTRR stuff: 1998 Tom Rini <tr...@ke...> * @@ -129,6 +129,10 @@ mga_outl(M_YDSTORG, curr_ydstorg(MINFO)); if (ACCESS_FBINFO(capable.plnwt)) mga_outl(M_PLNWT, -1); + if (ACCESS_FBINFO(capable.srcorg)) { + mga_outl(M_SRCORG, 0); + mga_outl(M_DSTORG, 0); + } mga_outl(M_OPMODE, mopmode); mga_outl(M_CXBNDRY, 0xFFFF0000); mga_outl(M_YTOP, 0); diff -urdN linux/drivers/video/matrox/matroxfb_base.c linux/drivers/video/matrox/matroxfb_base.c --- linux/drivers/video/matrox/matroxfb_base.c Mon Jun 18 12:23:29 2001 +++ linux/drivers/video/matrox/matroxfb_base.c Mon Jun 18 12:35:08 2001 @@ -4,7 +4,7 @@ * * (c) 1998-2001 Petr Vandrovec <van...@vc...> * - * Version: 1.52 2001/02/02 + * Version: 1.53 2001/06/18 * * MTRR stuff: 1998 Tom Rini <tr...@ke...> * @@ -72,6 +72,9 @@ * "Ken Aaker" <kd...@rc...> * memtype extension (needed for GXT130P RS/6000 adapter) * + * "Uns Lider" <uns...@mi...> + * G100 PLNWT fixes + * * (following author is not in any relation with this code, but his code * is included in this driver) * @@ -1409,7 +1412,7 @@ #define DEVF_VIDEO64BIT 0x0001 #define DEVF_SWAPS 0x0002 -/* #define DEVF_recycled 0x0004 */ +#define DEVF_SRCORG 0x0004 /* #define DEVF_recycled 0x0008 */ #define DEVF_CROSS4MB 0x0010 #define DEVF_TEXT4B 0x0020 @@ -1424,12 +1427,12 @@ #define DEVF_G450DAC 0x4000 #define DEVF_GCORE (DEVF_VIDEO64BIT | DEVF_SWAPS | DEVF_CROSS4MB | DEVF_DDC_8_2) -#define DEVF_G2CORE (DEVF_GCORE | DEVF_ANY_VXRES | DEVF_MAVEN_CAPABLE | DEVF_PANELLINK_CAPABLE) +#define DEVF_G2CORE (DEVF_GCORE | DEVF_ANY_VXRES | DEVF_MAVEN_CAPABLE | DEVF_PANELLINK_CAPABLE | DEVF_SRCORG) #define DEVF_G100 (DEVF_GCORE) /* no doc, no vxres... */ #define DEVF_G200 (DEVF_G2CORE) #define DEVF_G400 (DEVF_G2CORE | DEVF_SUPPORT32MB | DEVF_TEXT16B | DEVF_CRTC2) /* if you'll find how to drive DFP... */ -#define DEVF_G450 (DEVF_GCORE | DEVF_ANY_VXRES | DEVF_SUPPORT32MB | DEVF_TEXT16B | DEVF_CRTC2 | DEVF_G450DAC) +#define DEVF_G450 (DEVF_GCORE | DEVF_ANY_VXRES | DEVF_SUPPORT32MB | DEVF_TEXT16B | DEVF_CRTC2 | DEVF_G450DAC | DEVF_SRCORG) static struct board { unsigned short vendor, device, rev, svid, sid; @@ -1556,7 +1559,7 @@ DEVF_G200, 230000, &vbG200, - "unknown G200 (AGP)"}, + "G200 (AGP)"}, {PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_G400_AGP, 0x80, PCI_SS_VENDOR_ID_MATROX, PCI_SS_ID_MATROX_MILLENNIUM_G400_MAX_AGP, DEVF_G400, @@ -1568,13 +1571,13 @@ DEVF_G400, 300000, &vbG400, - "unknown G400 (AGP)"}, + "G400 (AGP)"}, {PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_G400_AGP, 0xFF, 0, 0, DEVF_G450, 500000, /* ??? vco goes up to 900MHz... */ &vbG400, - "unknown G450 (AGP)"}, + "G450 (AGP)"}, #endif {0, 0, 0xFF, 0, 0, @@ -1611,6 +1614,7 @@ printk(KERN_INFO "matroxfb: Matrox %s detected\n", b->name); ACCESS_FBINFO(capable.plnwt) = 1; + ACCESS_FBINFO(capable.srcorg) = b->flags & DEVF_SRCORG; ACCESS_FBINFO(devflags.video64bits) = b->flags & DEVF_VIDEO64BIT; if (b->flags & DEVF_TEXT4B) { ACCESS_FBINFO(devflags.vgastep) = 4; @@ -2527,7 +2531,7 @@ MODULE_PARM(mtrr, "i"); MODULE_PARM_DESC(mtrr, "This speeds up video memory accesses (0=disabled or 1) (default=1)"); MODULE_PARM(sgram, "i"); -MODULE_PARM_DESC(sgram, "Indicates that G200/G400 has SGRAM memory (0=SDRAM, 1=SGRAM) (default=0)"); +MODULE_PARM_DESC(sgram, "Indicates that G100/G200/G400 has SGRAM memory (0=SDRAM, 1=SGRAM) (default=0)"); MODULE_PARM(inv24, "i"); MODULE_PARM_DESC(inv24, "Inverts clock polarity for 24bpp and loop frequency > 100MHz (default=do not invert polarity)"); MODULE_PARM(inverse, "i"); diff -urdN linux/drivers/video/matrox/matroxfb_base.h linux/drivers/video/matrox/matroxfb_base.h --- linux/drivers/video/matrox/matroxfb_base.h Fri Feb 9 19:30:23 2001 +++ linux/drivers/video/matrox/matroxfb_base.h Mon Jun 18 12:50:08 2001 @@ -492,6 +492,7 @@ int cross4MB; int text; int plnwt; + int srcorg; } capable; struct { unsigned int size; @@ -738,6 +739,7 @@ /* G200 only */ #define M_SRCORG 0x2CB4 +#define M_DSTORG 0x2CB8 #define M_RAMDAC_BASE 0x3C00 |