linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH]: vesafb - vram option
@ 2003-03-27 20:20 Antonino Daplas
  0 siblings, 0 replies; only message in thread
From: Antonino Daplas @ 2003-03-27 20:20 UTC (permalink / raw)
  To: Linux Fbdev development list

Attached is a diff against linux-2.5.66.

- Added vesafb option to specify amount of video RAM to remap.  This is
perhaps useful for people with machines with large amounts of system and
graphics RAM and vesafb fails to load due to failure to ioremap.

To use:  to remap only 1MiB of ram, add the ff. in your boot option:

video=vesafb:vram:1,<your other options>

Tony

diff -Naur linux-2.5.66-orig/Documentation/fb/vesafb.txt linux-2.5.66/Documentation/fb/vesafb.txt
--- linux-2.5.66-orig/Documentation/fb/vesafb.txt	2003-03-26 02:24:54.000000000 +0000
+++ linux-2.5.66/Documentation/fb/vesafb.txt	2003-03-27 20:10:01.000000000 +0000
@@ -146,7 +146,9 @@
 
 mtrr	setup memory type range registers for the vesafb framebuffer.
 
-
+vram:n  remap 'n' MiB of video RAM. If 0 or not specified, remap all
+	available video RAM. 
+  
 Have fun!
 
   Gerd
diff -Naur linux-2.5.66-orig/drivers/video/vesafb.c linux-2.5.66/drivers/video/vesafb.c
--- linux-2.5.66-orig/drivers/video/vesafb.c	2003-02-16 00:49:23.000000000 +0000
+++ linux-2.5.66/drivers/video/vesafb.c	2003-03-27 20:01:11.000000000 +0000
@@ -50,7 +50,7 @@
 
 static int             inverse   = 0;
 static int             mtrr      = 0;
-
+static int        vram __initdata = 0;
 static int             pmi_setpal = 0;	/* pmi for palette changes ??? */
 static int             ypan       = 0;  /* 0..nothing, 1..ypan, 2..ywrap */
 static unsigned short  *pmi_base  = 0;
@@ -206,6 +206,8 @@
 			pmi_setpal=1;
 		else if (! strcmp(this_opt, "mtrr"))
 			mtrr=1;
+		else if (! strncmp(this_opt, "vram:", 5))
+			vram = simple_strtoul(this_opt+5, NULL, 0);
 	}
 	return 0;
 }
@@ -226,6 +228,8 @@
 	vesafb_defined.yres = screen_info.lfb_height;
 	vesafb_fix.line_length = screen_info.lfb_linelength;
 	vesafb_fix.smem_len = screen_info.lfb_size * 65536;
+	if (vram && vram * 1024 * 1024 < vesafb_fix.smem_len)
+		vesafb_fix.smem_len = vram * 1024 * 1024;
 	vesafb_fix.visual   = (vesafb_defined.bits_per_pixel == 8) ?
 		FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_TRUECOLOR;
 



-------------------------------------------------------
This SF.net email is sponsored by:
The Definitive IT and Networking Event. Be There!
NetWorld+Interop Las Vegas 2003 -- Register today!
http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-03-27 20:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-27 20:20 [PATCH]: vesafb - vram option Antonino Daplas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).