aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVille Syrjälä <syrjala@sci.fi>2005-11-07 04:00:58 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-07 10:53:54 -0500
commit6c12f30554f29069afd485ecd05a1d54c8aece9f (patch)
treeebacc1baaf4689494e4124efb9a4a8206679fc3f
parent63921fbfbd87ec745e65d2e9aecdfdc9a4ce73f2 (diff)
[PATCH] matroxfb: Use CACHEFLUSH on all chips
Use the CACHEFLUSH register on all chip types. The register is listed in all other specs except 2064W. However I have verified that the register does work on a 2064W despite being marked reserved in the specs. There were no noticeable side effects after writing to the register. Signed-off-by: Ville Syrjälä <syrjala@sci.fi> Signed-off-by: Petr Vandrovec <petr@vandrovec.name> Cc: "Antonino A. Daplas" <adaplas@pol.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--drivers/video/matrox/matroxfb_DAC1064.c2
-rw-r--r--drivers/video/matrox/matroxfb_base.c9
-rw-r--r--drivers/video/matrox/matroxfb_base.h5
3 files changed, 2 insertions, 14 deletions
diff --git a/drivers/video/matrox/matroxfb_DAC1064.c b/drivers/video/matrox/matroxfb_DAC1064.c
index 149680f8bcf0..94ba81543cd2 100644
--- a/drivers/video/matrox/matroxfb_DAC1064.c
+++ b/drivers/video/matrox/matroxfb_DAC1064.c
@@ -657,7 +657,6 @@ static int MGA1064_preinit(WPMINFO2) {
657 /* ACCESS_FBINFO(capable.cfb4) = 0; ... preinitialized by 0 */ 657 /* ACCESS_FBINFO(capable.cfb4) = 0; ... preinitialized by 0 */
658 ACCESS_FBINFO(capable.text) = 1; 658 ACCESS_FBINFO(capable.text) = 1;
659 ACCESS_FBINFO(capable.vxres) = vxres_mystique; 659 ACCESS_FBINFO(capable.vxres) = vxres_mystique;
660 ACCESS_FBINFO(features.accel.has_cacheflush) = 1;
661 660
662 ACCESS_FBINFO(outputs[0]).output = &m1064; 661 ACCESS_FBINFO(outputs[0]).output = &m1064;
663 ACCESS_FBINFO(outputs[0]).src = ACCESS_FBINFO(outputs[0]).default_src; 662 ACCESS_FBINFO(outputs[0]).src = ACCESS_FBINFO(outputs[0]).default_src;
@@ -842,7 +841,6 @@ static int MGAG100_preinit(WPMINFO2) {
842 /* ACCESS_FBINFO(capable.cfb4) = 0; ... preinitialized by 0 */ 841 /* ACCESS_FBINFO(capable.cfb4) = 0; ... preinitialized by 0 */
843 ACCESS_FBINFO(capable.text) = 1; 842 ACCESS_FBINFO(capable.text) = 1;
844 ACCESS_FBINFO(capable.vxres) = vxres_g100; 843 ACCESS_FBINFO(capable.vxres) = vxres_g100;
845 ACCESS_FBINFO(features.accel.has_cacheflush) = 1;
846 ACCESS_FBINFO(capable.plnwt) = ACCESS_FBINFO(devflags.accelerator) == FB_ACCEL_MATROX_MGAG100 844 ACCESS_FBINFO(capable.plnwt) = ACCESS_FBINFO(devflags.accelerator) == FB_ACCEL_MATROX_MGAG100
847 ? ACCESS_FBINFO(devflags.sgram) : 1; 845 ? ACCESS_FBINFO(devflags.sgram) : 1;
848 846
diff --git a/drivers/video/matrox/matroxfb_base.c b/drivers/video/matrox/matroxfb_base.c
index 1734438f7d7c..a780bb30ffc0 100644
--- a/drivers/video/matrox/matroxfb_base.c
+++ b/drivers/video/matrox/matroxfb_base.c
@@ -1283,7 +1283,7 @@ static int matroxfb_getmemory(WPMINFO unsigned int maxSize, unsigned int *realSi
1283 vaddr_t vm; 1283 vaddr_t vm;
1284 unsigned int offs; 1284 unsigned int offs;
1285 unsigned int offs2; 1285 unsigned int offs2;
1286 unsigned char store, orig; 1286 unsigned char orig;
1287 unsigned char bytes[32]; 1287 unsigned char bytes[32];
1288 unsigned char* tmp; 1288 unsigned char* tmp;
1289 1289
@@ -1299,16 +1299,12 @@ static int matroxfb_getmemory(WPMINFO unsigned int maxSize, unsigned int *realSi
1299 orig = mga_inb(M_EXTVGA_DATA); 1299 orig = mga_inb(M_EXTVGA_DATA);
1300 mga_outb(M_EXTVGA_DATA, orig | 0x80); 1300 mga_outb(M_EXTVGA_DATA, orig | 0x80);
1301 1301
1302 store = mga_readb(vm, 0x1234);
1303 tmp = bytes; 1302 tmp = bytes;
1304 for (offs = 0x100000; offs < maxSize; offs += 0x200000) 1303 for (offs = 0x100000; offs < maxSize; offs += 0x200000)
1305 *tmp++ = mga_readb(vm, offs); 1304 *tmp++ = mga_readb(vm, offs);
1306 for (offs = 0x100000; offs < maxSize; offs += 0x200000) 1305 for (offs = 0x100000; offs < maxSize; offs += 0x200000)
1307 mga_writeb(vm, offs, 0x02); 1306 mga_writeb(vm, offs, 0x02);
1308 if (ACCESS_FBINFO(features.accel.has_cacheflush)) 1307 mga_outb(M_CACHEFLUSH, 0x00);
1309 mga_outb(M_CACHEFLUSH, 0x00);
1310 else
1311 mga_writeb(vm, 0x1234, 0x99);
1312 for (offs = 0x100000; offs < maxSize; offs += 0x200000) { 1308 for (offs = 0x100000; offs < maxSize; offs += 0x200000) {
1313 if (mga_readb(vm, offs) != 0x02) 1309 if (mga_readb(vm, offs) != 0x02)
1314 break; 1310 break;
@@ -1319,7 +1315,6 @@ static int matroxfb_getmemory(WPMINFO unsigned int maxSize, unsigned int *realSi
1319 tmp = bytes; 1315 tmp = bytes;
1320 for (offs2 = 0x100000; offs2 < maxSize; offs2 += 0x200000) 1316 for (offs2 = 0x100000; offs2 < maxSize; offs2 += 0x200000)
1321 mga_writeb(vm, offs2, *tmp++); 1317 mga_writeb(vm, offs2, *tmp++);
1322 mga_writeb(vm, 0x1234, store);
1323 1318
1324 mga_outb(M_EXTVGA_INDEX, 0x03); 1319 mga_outb(M_EXTVGA_INDEX, 0x03);
1325 mga_outb(M_EXTVGA_DATA, orig); 1320 mga_outb(M_EXTVGA_DATA, orig);
diff --git a/drivers/video/matrox/matroxfb_base.h b/drivers/video/matrox/matroxfb_base.h
index 85a0b2558452..a8c47ad2cdb6 100644
--- a/drivers/video/matrox/matroxfb_base.h
+++ b/drivers/video/matrox/matroxfb_base.h
@@ -272,10 +272,6 @@ struct matrox_DAC1064_features {
272 u_int8_t xmiscctrl; 272 u_int8_t xmiscctrl;
273}; 273};
274 274
275struct matrox_accel_features {
276 int has_cacheflush;
277};
278
279/* current hardware status */ 275/* current hardware status */
280struct mavenregs { 276struct mavenregs {
281 u_int8_t regs[256]; 277 u_int8_t regs[256];
@@ -440,7 +436,6 @@ struct matrox_fb_info {
440 struct { 436 struct {
441 struct matrox_pll_features pll; 437 struct matrox_pll_features pll;
442 struct matrox_DAC1064_features DAC1064; 438 struct matrox_DAC1064_features DAC1064;
443 struct matrox_accel_features accel;
444 } features; 439 } features;
445 struct { 440 struct {
446 spinlock_t DAC; 441 spinlock_t DAC;