The Matrox Frame Buffer still has problems

David Odin (David.Odin@bigfoot.com)
Thu, 26 Aug 1999 13:49:09 +0200


Hi,

The Matrox Frame Buffer doesn't compile with 2.3.15:
gcc -D__KERNEL__ -I/usr/src/linux-2.3.15/include -Wall -Wstrict-prototypes -O2
-fomit-frame-pointer -pipe -fno-strength-reduce -DCPU=586 -c -o matroxfb.o
matroxfb.c
matroxfb.c: In function `initMatrox2':
matroxfb.c:5881: section attribute cannot be specified for local variables
make[3]: *** [matroxfb.o] Error 1
make[3]: Leaving directory `/usr/src/linux-2.3.15/drivers/video'
make[2]: *** [first_rule] Error 2
make[2]: Leaving directory `/usr/src/linux-2.3.15/drivers/video'
make[1]: *** [_subdir_video] Error 2
make[1]: Leaving directory `/usr/src/linux-2.3.15/drivers'
make: *** [_dir_drivers] Error 2

I use gcc 2.7.2.3 and it doesn't seem to like a section attribute for
non-global variable, which I perfectly understand, since local variable are
to be taken on the stack

This patch fixes this and, AFAIK, doesn't introduce any bug:
-----------------------------------------------------------------------

--- matroxfb.c.orig Thu Aug 26 13:32:24 1999
+++ matroxfb.c Thu Aug 26 13:33:57 1999
@@ -5635,6 +5635,16 @@
NULL,
NULL}};

+#ifndef MODULE
+ /* it cannot be static const struct due to __initdata
+ marker */
+ static struct fb_videomode defaultmode __initdata = {
+ /* 640x480 @ 60Hz, 31.5 kHz */
+ NULL, 60, 640, 480, 39721, 40, 24, 32, 11, 96, 2,
+ 0, FB_VMODE_NONINTERLACED
+ };
+#endif /* !MODULE */
+
static int __init initMatrox2(WPMINFO struct display* d, struct board* b){
unsigned long ctrlptr_phys = 0;
unsigned long video_base_phys = 0;
@@ -5876,14 +5886,6 @@
#ifndef MODULE
/* mode database is marked __init ... */
{
- /* it cannot be static const struct due to __initdata
- marker */
- static struct fb_videomode defaultmode __initdata = {
- /* 640x480 @ 60Hz, 31.5 kHz */
- NULL, 60, 640, 480, 39721, 40, 24, 32, 11, 96, 2,
- 0, FB_VMODE_NONINTERLACED
- };
-
fb_find_mode(&vesafb_defined, &ACCESS_FBINFO(fbcon), videomode[0]?videomode:NULL,
NULL, 0, &defaultmode, vesafb_defined.bits_per_pixel);
}
-----------------------------------------------------------------------

So, please include it in the next releases of the linux kernel.

Regards,

DindinX

-- 
David.Odin@bigfoot.com

Angelica: Chanukah is the time of year between Christmas and Misgiving when all the bestest holiday shows are on.

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