[PATCH] Add module parameter support to tdfxfb

Steven Walter (srwalter@yahoo.com)
Sun, 29 Jul 2001 21:40:16 -0500


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.

-- 
-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")) {

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/