Skip to contentSkip to conversation

vesafb fixes...

PATCH In review Thomas Backlund 1 participant 2 messages Jun 1, 2003 – Jun 2, 2003

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vesafb fixes...

Here are 2 patches...

The "vesafb.txt.diff" removes duplicate text in the documentation...

The "vesafb.c.diff" changes the following:
- it adds "* 2" to the video_size calculation to remap enough memory to do double buffering

- to make sure that our double buffering calculation does not remap more memory than old cards actually have it uses the "old" code:

if video_size > (screen_info.lfb_size * 65536)

		video_size = screen_info.lfb_size * 65536;

- and last but not least it changes my override to work both ways, so that the user can specify less or more memory to be remapped

I earlier got a comment that this double buffering thing is not needed, but IMHO there will always be cards out there that are to new, so they dont have driver support (yet), or they are too "weird" so the only thing the user has to rely on is the vesafb driver, and I like the idea to get atleast this support "out of the box"...

Best Regards

Thomas

drivers/video/vesafb.c +8 -2
diff -Naru ac1/drivers/video/vesafb.c tmb1/drivers/video/vesafb.c
@@ -525,12 +525,18 @@
 	video_width         = screen_info.lfb_width;
 	video_height        = screen_info.lfb_height;
 	video_linelength    = screen_info.lfb_linelength;
-	video_size          = screen_info.lfb_width *	screen_info.lfb_height * video_bpp / 8;
+
+	/* remap memory according to videomode, multiply by 2 to get space for doublebuffering */
+	video_size          = screen_info.lfb_width *	screen_info.lfb_height * video_bpp / 8 * 2;
+
+	/* check that we don't remap more memory than old cards have */
+	if video_size > (screen_info.lfb_size * 65536)
+		video_size = screen_info.lfb_size * 65536;
 	
 	/* FIXME: Should we clip against declared size for banked devices ? */
 	
 	/* sets video_size according to vram boot option */
-	if (vram && vram * 1024 * 1024 > video_size)
+	if (vram && vram * 1024 * 1024 != video_size)
 		video_size = vram * 1024 * 1024;
 		
 	video_visual = (video_bpp == 8) ?
Documentation/fb/vesafb.txt +0 -6
diff -Naru ac1/Documentation/fb/vesafb.txt tmb1/Documentation/fb/vesafb.txt
@@ -139,12 +139,6 @@
 redraw	scroll by redrawing the affected part of the screen, this
 	is the safe (and slow) default.
 
-vram:n  remap 'n' MiB of video RAM. If 0 or not specified, remap memory
-        according to video mode. (2.5.66 patch/idea by Antonino Daplas
-	reversed to give override possibility (allocate more fb memory
-	than the kernel would) to 2.4 by [email protected])
-
-
 vgapal	Use the standard vga registers for palette changes.
 	This is the default.
 pmipal	Use the protected mode interface for palette changes.
#1 lore raw

AARGH...
I forgot to rediff...,
but since it seems to break the bootsplash,
the vesafb.c.diff needs more work...

but the vesafb.txt.diff should be applied...

"Thomas Backlund" <[email protected]> wrote in message
news:[email protected]...

Quoted 8 lines

Here are 2 patches...

The "vesafb.txt.diff" removes duplicate text in the documentation...

The "vesafb.c.diff" changes the following:
- it adds "* 2" to the video_size calculation to remap enough memory to do double buffering

Quoted 6 lines

- to make sure that our double buffering calculation does not remap more memory than old cards actually have it uses the "old" code:

if video_size > (screen_info.lfb_size * 65536)
video_size = screen_info.lfb_size * 65536;

Stupid typos... :-(

I am using:
if (video_size > (screen_info.lfb_size * 65536))

        video_size = screen_info.lfb_size * 65536;
Quoted 10 lines

- and last but not least it changes my override to work both ways, so that the user can specify less or more memory to be remapped

I earlier got a comment that this double buffering thing is not needed, but IMHO there will always be cards out there that are to new, so they dont have driver support (yet), or they are too "weird" so the only thing the user has to rely on is the vesafb driver, and I like the idea to get atleast this support "out of the box"...

Best Regards

Thomas