changeset 90:b97d1e5fddea

mga_force_memsize parameter added
author szabii
date Sun, 11 Mar 2001 22:24:03 +0000
parents e3cfc26b8c6b
children 315979891f2d
files drivers/mga_vid.c
diffstat 1 files changed, 20 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/drivers/mga_vid.c	Sun Mar 11 22:21:49 2001 +0000
+++ b/drivers/mga_vid.c	Sun Mar 11 22:24:03 2001 +0000
@@ -153,6 +153,11 @@
 
 static uint32_t mga_ram_size = 0;	// how much megabytes videoram we have
 
+static int mga_force_memsize = 0;
+
+MODULE_PARM(mga_force_memsize, "i");
+
+
 static struct pci_dev *pci_dev;
 
 static mga_vid_config_t mga_config; 
@@ -733,6 +738,12 @@
 	printk(KERN_INFO "mga_vid: hard-coded RAMSIZE is %d MB\n", (unsigned int) mga_ram_size);
 
 #else
+	if (mga_force_memsize) {
+		printk(KERN_INFO "mga_vid: memsize forced to %d MB\n", mga_force_memsize);
+		/* we need the size in bytes */
+		mga_ram_size = ((unsigned long) mga_force_memsize) << 20;
+	}
+
 	if (is_g400){
 		switch((card_option>>10)&0x17){
 		    // SDRAM:
@@ -896,13 +907,21 @@
  * Main Initialization Function 
  */
 
-
 static int mga_vid_initialize(void)
 {
 	mga_vid_in_use = 0;
 
 //	printk(KERN_INFO "Matrox MGA G200/G400 YUV Video interface v0.01 (c) Aaron Holtzman \n");
 	printk(KERN_INFO "Matrox MGA G200/G400/G450 YUV Video interface v2.01 (c) Aaron Holtzman & A'rpi\n");
+
+	if (mga_force_memsize) {
+		if (mga_force_memsize != 16 || mga_force_memsize != 32 ||
+				mga_force_memsize != 64) {
+			printk(KERN_ERR "mga_vid: invalid memsize: %dMB\n", mga_force_memsize);
+			return -EINVAL;
+		}
+	}
+
 	if(register_chrdev(MGA_VID_MAJOR, "mga_vid", &mga_vid_fops))
 	{
 		printk(KERN_ERR "mga_vid: unable to get major: %d\n", MGA_VID_MAJOR);