I've implemented parameters into aty128fb.c when compiled as a module.
All seems to work except for the mode parameter. Since this is because
modedb.c is not usable for modules, I can't go further. So I'm releasing
my patch now in the hope it will just work when modedb.c is usable. It
is against a plain 2.4.5 kernel.
O. Wyss
PS. What happens with the patch when I use line wrapping at 72 chars?
--- aty128fb.c.orig Fri Feb 9 20:30:23 2001
+++ aty128fb.c Wed Jun 27 20:45:22 2001
@@ -111,7 +111,6 @@
};
#endif /* CONFIG_PPC */
-#ifndef MODULE
/* default modedb mode */
/* 640x480, 60 Hz, Non-Interlaced (25.172 MHz dotclock) */
static struct fb_videomode defaultmode __initdata = {
@@ -128,7 +127,6 @@
sync: 0,
vmode: FB_VMODE_NONINTERLACED
};
-#endif /* MODULE */
/* struct to hold chip description information */
struct aty128_chip_info {
@@ -212,12 +210,14 @@
{ 4, 4, 3, 3, 2, 3, 1, 16, 31, 16, "64-bit DDR SGRAM" };
static const char *aty128fb_name = "ATY Rage128";
+
static int noaccel __initdata = 0;
+static char *font __initdata = NULL;
+static char *mode __initdata = NULL;
+static int nomtrr __initdata = 0;
-#ifndef MODULE
static const char *mode_option __initdata = NULL;
-#endif
#ifdef CONFIG_PPC
static int default_vmode __initdata = VMODE_1024_768_60;
@@ -528,7 +528,7 @@
}
if (reset) /* reset engine?? */
- printk(KERN_DEBUG "aty128fb: PLL write timeout!");
+ printk(KERN_DEBUG "aty128fb: PLL write timeout!\n");
}
@@ -1605,7 +1605,6 @@
}
-#ifndef MODULE
int __init
aty128fb_setup(char *options)
{
@@ -1663,7 +1662,6 @@
}
return 0;
}
-#endif /* !MODULE */
/*
@@ -1691,7 +1689,7 @@
video_card = (char *)aci->name;
info->chip_gen = aci->chip_gen;
- printk(KERN_INFO "aty128fb: %s [chip rev 0x%x] ", video_card, chip_rev);
+ printk(KERN_INFO "aty128fb: %s [chip rev 0x%x]\n", video_card, chip_rev);
if (info->vram_size % (1024 * 1024) == 0)
printk("%dM %s\n", info->vram_size / (1024*1024), info->mem->name);
@@ -1710,10 +1708,7 @@
info->fb_info.blank = &aty128fbcon_blank;
info->fb_info.flags = FBINFO_FLAG_DEFAULT;
-#ifdef MODULE
var = default_var;
-#else
- memset(&var, 0, sizeof(var));
#ifdef CONFIG_PPC
if (_machine == _MACH_Pmac) {
if (mode_option) {
@@ -1736,7 +1731,6 @@
&defaultmode, 8) == 0)
var = default_var;
}
-#endif /* MODULE */
if (noaccel)
var.accel_flags &= ~FB_ACCELF_TEXT;
@@ -2595,13 +2589,43 @@
};
#endif
MODULE_AUTHOR("(c)1999-2000 Brad Douglas <br...@ne...>");
MODULE_DESCRIPTION("FBDev driver for ATI Rage128 / Pro cards");
+MODULE_PARM(noaccel, "i");
+MODULE_PARM_DESC(noaccel, "Disable hardware acceleration (0 or 1=disabled) (default=0)");
+MODULE_PARM(font, "s");
+MODULE_PARM_DESC(font, "Specify one of the compiled-in fonts (default=none)");
+MODULE_PARM(mode, "s");
+MODULE_PARM_DESC(mode, "Specify resolution as \"<xres>x<yres>[-<bpp>][@<refresh>]\" ");
+#ifdef CONFIG_MTRR
+MODULE_PARM(nomtrr, "i");
+MODULE_PARM_DESC(nomtrr, "Disable MTRR support (0 or 1=disabled) (default=0)");
+#endif
+#endif /* MODULE */
int __init
init_module(void)
{
+ if (noaccel) {
+ noaccel = 1;
+ printk(KERN_INFO "aty128fb: Parameter NOACCEL set\n");
+ }
+ if (font) {
+ strncpy(fontname, font, sizeof(fontname)-1);
+ printk(KERN_INFO "aty128fb: Parameter FONT set to %s\n", font);
+ }
+ if (mode) {
+ mode_option = mode;
+ printk(KERN_INFO "aty128fb: Parameter MODE set to %s\n", mode);
+ }
+#ifdef CONFIG_MTRR
+ if (nomtrr) {
+ mtrr = 0;
+ printk(KERN_INFO "aty128fb: Parameter NOMTRR set\n");
+ }
+#endif
+
aty128fb_init();
return 0;
}
@@ -2634,4 +2658,3 @@
kfree(info);
}
}
-#endif /* MODULE */
|