changeset 64:62ec382fd6aa

new RAMSIZE detection code... test it\!
author arpi_esp
date Fri, 09 Mar 2001 00:49:37 +0000
parents 6bdaa0626a9b
children dfbca71ee05e
files drivers/mga_vid.c
diffstat 1 files changed, 15 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/drivers/mga_vid.c	Fri Mar 09 00:43:02 2001 +0000
+++ b/drivers/mga_vid.c	Fri Mar 09 00:49:37 2001 +0000
@@ -715,11 +715,22 @@
 
 #else
 	if (is_g400){
-		mga_ram_size = 16;
+		switch((card_option>>10)&7){
+		    case 0:  mga_ram_size = ((card_option>>14)&1)? 32:16; break;
+		    case 1:
+		    case 2:  mga_ram_size = 16; break;	// SGRAM
+		    case 3:
+		    case 5:  mga_ram_size = 64; break;	// SDRAM
+		    case 4:  mga_ram_size = 32; break;	// SGRAM
+		    default: mga_ram_size = 16;
+		}
 	}else{
-		mga_ram_size = 8;
+		switch((card_option>>11)&3){
+		    case 0:  mga_ram_size = 8; break;
+		    default: mga_ram_size = 16;
+		}
 	}
-
+#if 0
 //	printk("List resources -----------\n");
 	for(temp=0;temp<DEVICE_COUNT_RESOURCE;temp++){
 	    struct resource *res=&pci_dev->resource[temp];
@@ -731,6 +742,7 @@
 	      }
 	    }
 	}
+#endif
 
 	printk(KERN_INFO "mga_vid: detected RAMSIZE is %d MB\n", (unsigned int) mga_ram_size);
 #endif