Skip to contentSkip to conversation

Add module parameter support to tdfxfb

PATCH New Steven Walter 1 participant 1 message Jul 30, 2001

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add module parameter support to tdfxfb

The attached patch adds support for module parameters to the tdfxfb driver. As it stands, these options can only be changed if the driver is compiled into the kernel.

This patch is incremental to Paul Mundt's patch. Its very straightforward to apply to 2.4.7, but I'll gladly make such a patch if there is demand. All comments are welcome.

Signature · 59 lines
-Steven
In a time of universal deceit, telling the truth is a revolutionary act.
			-- George Orwell

--- clean-2.4.7/drivers/video/tdfxfb.c	Sun Jul 29 21:14:45 2001
+++ linux/drivers/video/tdfxfb.c	Sun Jul 29 21:19:33 2001
@@ -500,6 +500,17 @@
 
 MODULE_DEVICE_TABLE(pci, tdfxfb_id_table);
 
+MODULE_PARM(inverse, "i");
+MODULE_PARM(noaccel, "i");
+MODULE_PARM(nopan, "i");
+MODULE_PARM(nowrap, "i");
+MODULE_PARM(nohwcursor,  "i");
+#ifdef CONFIG_MTRR
+MODULE_PARM(nomtrr, "i");
+#endif
+MODULE_PARM(font, "s");
+MODULE_PARM(mode_option, "s");
+
 struct mode {
   char* name;
   struct fb_var_screeninfo var;
@@ -529,7 +540,8 @@
 #endif
 static int  nohwcursor = 0;
 static char __initdata fontname[40] = { 0 };
-static const char *mode_option __initdata = NULL;
+static char *font __initdata = NULL;
+static char *mode_option __initdata = NULL;
 
 /* ------------------------------------------------------------------------- 
  *                      Hardware-specific funcions
@@ -2059,6 +2071,13 @@
 
 int __init tdfxfb_init(void)
 {
+	if (inverse)
+		fb_invert_cmaps();
+	if (noaccel)
+		nopan = nowrap = nohwcursor = 1;
+	if (font)
+		strncpy(fontname, font, 40);
+
	return pci_module_init(&tdfxfb_driver);
 }
 
@@ -2089,9 +2108,8 @@
       this_opt = strtok(NULL, ",")) {
     if(!strcmp(this_opt, "inverse")) {
       inverse = 1;
-      fb_invert_cmaps();
     } else if(!strcmp(this_opt, "noaccel")) {
-      noaccel = nopan = nowrap = nohwcursor = 1; 
+      noaccel = 1; 
     } else if(!strcmp(this_opt, "nopan")) {
       nopan = 1;
     } else if(!strcmp(this_opt, "nowrap")) {