aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndres Salomon <dilinger@queued.net>2008-04-28 05:14:57 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-28 11:58:36 -0400
commitfa20c8a6e520d9ccd68c8101155ffdbc19c977c3 (patch)
treea5ffc4f1ae08f7be8a2cb0cdbea7bbf9d64c945f
parent0a5e79098799a4bead070a9bd7f1a2213ba5eef5 (diff)
gxfb: replace FBSIZE config option with a module parameter
Use a command line option (vram) rather than hardcoding the vram size. LxFB already does this; it's useful for machines that can't query the BIOS for fb size. This patch originated from David Woodhouse, was modified by Jordan Crouse, and was then modified further by me. This also adds some gxfb documentation in Documentation/fb. Signed-off-by: Andres Salomon <dilinger@debian.org> Cc: Jordan Crouse <jordan.crouse@amd.com> Cc: "Antonino A. Daplas" <adaplas@pol.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--Documentation/fb/gxfb.txt51
-rw-r--r--drivers/video/geode/Kconfig20
-rw-r--r--drivers/video/geode/display_gx.c7
-rw-r--r--drivers/video/geode/gxfb_core.c14
4 files changed, 59 insertions, 33 deletions
diff --git a/Documentation/fb/gxfb.txt b/Documentation/fb/gxfb.txt
new file mode 100644
index 000000000000..b56096142017
--- /dev/null
+++ b/Documentation/fb/gxfb.txt
@@ -0,0 +1,51 @@
1[This file is cloned from VesaFB/aty128fb]
2
3What is gxfb?
4=================
5
6This is a graphics framebuffer driver for AMD Geode GX2 based processors.
7
8Advantages:
9
10 * No need to use AMD's VSA code (or other VESA emulation layer) in the
11 BIOS.
12 * It provides a nice large console (128 cols + 48 lines with 1024x768)
13 without using tiny, unreadable fonts.
14 * You can run XF68_FBDev on top of /dev/fb0
15 * Most important: boot logo :-)
16
17Disadvantages:
18
19 * graphic mode is slower than text mode...
20
21
22How to use it?
23==============
24
25Switching modes is done using gxfb.mode_option=<resolution>... boot
26parameter or using `fbset' program.
27
28See Documentation/fb/modedb.txt for more information on modedb
29resolutions.
30
31
32X11
33===
34
35XF68_FBDev should generally work fine, but it is non-accelerated.
36
37
38Configuration
39=============
40
41You can pass kernel command line options to gxfb with gxfb.<option>.
42For example, gxfb.mode_option=800x600@75.
43Accepted options:
44
45mode_option - specify the video mode. Of the form
46 <x>x<y>[-<bpp>][@<refresh>]
47vram - size of video ram (normally auto-detected)
48
49
50--
51Andres Salomon <dilinger@debian.org>
diff --git a/drivers/video/geode/Kconfig b/drivers/video/geode/Kconfig
index 7608429b3943..c5d8ba4b9fc3 100644
--- a/drivers/video/geode/Kconfig
+++ b/drivers/video/geode/Kconfig
@@ -38,26 +38,6 @@ config FB_GEODE_GX
38 38
39 If unsure, say N. 39 If unsure, say N.
40 40
41config FB_GEODE_GX_SET_FBSIZE
42 bool "Manually specify the Geode GX framebuffer size"
43 depends on FB_GEODE_GX
44 default n
45 ---help---
46 If you want to manually specify the size of your GX framebuffer,
47 say Y here, otherwise say N to dynamically probe it.
48
49 Say N unless you know what you are doing.
50
51config FB_GEODE_GX_FBSIZE
52 hex "Size of the GX framebuffer, in bytes"
53 depends on FB_GEODE_GX_SET_FBSIZE
54 default "0x1600000"
55 ---help---
56 Specify the size of the GX framebuffer. Normally, you will
57 want this to be MB aligned. Common values are 0x80000 (8MB)
58 and 0x1600000 (16MB). Don't change this unless you know what
59 you are doing
60
61config FB_GEODE_GX1 41config FB_GEODE_GX1
62 tristate "AMD Geode GX1 framebuffer support (EXPERIMENTAL)" 42 tristate "AMD Geode GX1 framebuffer support (EXPERIMENTAL)"
63 depends on FB && FB_GEODE && EXPERIMENTAL 43 depends on FB && FB_GEODE && EXPERIMENTAL
diff --git a/drivers/video/geode/display_gx.c b/drivers/video/geode/display_gx.c
index 0f16e4bffc6c..8cd75725a31b 100644
--- a/drivers/video/geode/display_gx.c
+++ b/drivers/video/geode/display_gx.c
@@ -21,12 +21,6 @@
21#include "geodefb.h" 21#include "geodefb.h"
22#include "display_gx.h" 22#include "display_gx.h"
23 23
24#ifdef CONFIG_FB_GEODE_GX_SET_FBSIZE
25unsigned int gx_frame_buffer_size(void)
26{
27 return CONFIG_FB_GEODE_GX_FBSIZE;
28}
29#else
30unsigned int gx_frame_buffer_size(void) 24unsigned int gx_frame_buffer_size(void)
31{ 25{
32 unsigned int val; 26 unsigned int val;
@@ -41,7 +35,6 @@ unsigned int gx_frame_buffer_size(void)
41 val = (unsigned int)(inw(0xAC1E)) & 0xFFl; 35 val = (unsigned int)(inw(0xAC1E)) & 0xFFl;
42 return (val << 19); 36 return (val << 19);
43} 37}
44#endif
45 38
46int gx_line_delta(int xres, int bpp) 39int gx_line_delta(int xres, int bpp)
47{ 40{
diff --git a/drivers/video/geode/gxfb_core.c b/drivers/video/geode/gxfb_core.c
index 546e53038faf..8021bcb9ab6a 100644
--- a/drivers/video/geode/gxfb_core.c
+++ b/drivers/video/geode/gxfb_core.c
@@ -37,6 +37,7 @@
37#include "video_gx.h" 37#include "video_gx.h"
38 38
39static char *mode_option; 39static char *mode_option;
40static int vram;
40 41
41/* Modes relevant to the GX (taken from modedb.c) */ 42/* Modes relevant to the GX (taken from modedb.c) */
42static const struct fb_videomode gx_modedb[] __initdata = { 43static const struct fb_videomode gx_modedb[] __initdata = {
@@ -208,7 +209,6 @@ static int gxfb_blank(int blank_mode, struct fb_info *info)
208static int __init gxfb_map_video_memory(struct fb_info *info, struct pci_dev *dev) 209static int __init gxfb_map_video_memory(struct fb_info *info, struct pci_dev *dev)
209{ 210{
210 struct geodefb_par *par = info->par; 211 struct geodefb_par *par = info->par;
211 int fb_len;
212 int ret; 212 int ret;
213 213
214 ret = pci_enable_device(dev); 214 ret = pci_enable_device(dev);
@@ -233,21 +233,20 @@ static int __init gxfb_map_video_memory(struct fb_info *info, struct pci_dev *de
233 ret = pci_request_region(dev, 0, "gxfb (framebuffer)"); 233 ret = pci_request_region(dev, 0, "gxfb (framebuffer)");
234 if (ret < 0) 234 if (ret < 0)
235 return ret; 235 return ret;
236 if ((fb_len = gx_frame_buffer_size()) < 0) 236
237 return -ENOMEM;
238 info->fix.smem_start = pci_resource_start(dev, 0); 237 info->fix.smem_start = pci_resource_start(dev, 0);
239 info->fix.smem_len = fb_len; 238 info->fix.smem_len = vram ? vram : gx_frame_buffer_size();
240 info->screen_base = ioremap(info->fix.smem_start, info->fix.smem_len); 239 info->screen_base = ioremap(info->fix.smem_start, info->fix.smem_len);
241 if (!info->screen_base) 240 if (!info->screen_base)
242 return -ENOMEM; 241 return -ENOMEM;
243 242
244 /* Set the 16MB aligned base address of the graphics memory region 243 /* Set the 16MiB aligned base address of the graphics memory region
245 * in the display controller */ 244 * in the display controller */
246 245
247 writel(info->fix.smem_start & 0xFF000000, 246 writel(info->fix.smem_start & 0xFF000000,
248 par->dc_regs + DC_GLIU0_MEM_OFFSET); 247 par->dc_regs + DC_GLIU0_MEM_OFFSET);
249 248
250 dev_info(&dev->dev, "%d Kibyte of video memory at 0x%lx\n", 249 dev_info(&dev->dev, "%d KiB of video memory at 0x%lx\n",
251 info->fix.smem_len / 1024, info->fix.smem_start); 250 info->fix.smem_len / 1024, info->fix.smem_start);
252 251
253 return 0; 252 return 0;
@@ -455,5 +454,8 @@ module_exit(gxfb_cleanup);
455module_param(mode_option, charp, 0); 454module_param(mode_option, charp, 0);
456MODULE_PARM_DESC(mode_option, "video mode (<x>x<y>[-<bpp>][@<refr>])"); 455MODULE_PARM_DESC(mode_option, "video mode (<x>x<y>[-<bpp>][@<refr>])");
457 456
457module_param(vram, int, 0);
458MODULE_PARM_DESC(vram, "video memory size");
459
458MODULE_DESCRIPTION("Framebuffer driver for the AMD Geode GX"); 460MODULE_DESCRIPTION("Framebuffer driver for the AMD Geode GX");
459MODULE_LICENSE("GPL"); 461MODULE_LICENSE("GPL");