Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Andres Salomon and committed by
Linus Torvalds
fa20c8a6 0a5e7909

+59 -33
+51
Documentation/fb/gxfb.txt
··· 1 + [This file is cloned from VesaFB/aty128fb] 2 + 3 + What is gxfb? 4 + ================= 5 + 6 + This is a graphics framebuffer driver for AMD Geode GX2 based processors. 7 + 8 + Advantages: 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 + 17 + Disadvantages: 18 + 19 + * graphic mode is slower than text mode... 20 + 21 + 22 + How to use it? 23 + ============== 24 + 25 + Switching modes is done using gxfb.mode_option=<resolution>... boot 26 + parameter or using `fbset' program. 27 + 28 + See Documentation/fb/modedb.txt for more information on modedb 29 + resolutions. 30 + 31 + 32 + X11 33 + === 34 + 35 + XF68_FBDev should generally work fine, but it is non-accelerated. 36 + 37 + 38 + Configuration 39 + ============= 40 + 41 + You can pass kernel command line options to gxfb with gxfb.<option>. 42 + For example, gxfb.mode_option=800x600@75. 43 + Accepted options: 44 + 45 + mode_option - specify the video mode. Of the form 46 + <x>x<y>[-<bpp>][@<refresh>] 47 + vram - size of video ram (normally auto-detected) 48 + 49 + 50 + -- 51 + Andres Salomon <dilinger@debian.org>
-20
drivers/video/geode/Kconfig
··· 38 38 39 39 If unsure, say N. 40 40 41 - config 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 - 51 - config 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 - 61 41 config FB_GEODE_GX1 62 42 tristate "AMD Geode GX1 framebuffer support (EXPERIMENTAL)" 63 43 depends on FB && FB_GEODE && EXPERIMENTAL
-7
drivers/video/geode/display_gx.c
··· 21 21 #include "geodefb.h" 22 22 #include "display_gx.h" 23 23 24 - #ifdef CONFIG_FB_GEODE_GX_SET_FBSIZE 25 - unsigned int gx_frame_buffer_size(void) 26 - { 27 - return CONFIG_FB_GEODE_GX_FBSIZE; 28 - } 29 - #else 30 24 unsigned int gx_frame_buffer_size(void) 31 25 { 32 26 unsigned int val; ··· 35 41 val = (unsigned int)(inw(0xAC1E)) & 0xFFl; 36 42 return (val << 19); 37 43 } 38 - #endif 39 44 40 45 int gx_line_delta(int xres, int bpp) 41 46 {
+8 -6
drivers/video/geode/gxfb_core.c
··· 37 37 #include "video_gx.h" 38 38 39 39 static char *mode_option; 40 + static int vram; 40 41 41 42 /* Modes relevant to the GX (taken from modedb.c) */ 42 43 static const struct fb_videomode gx_modedb[] __initdata = { ··· 209 208 static int __init gxfb_map_video_memory(struct fb_info *info, struct pci_dev *dev) 210 209 { 211 210 struct geodefb_par *par = info->par; 212 - int fb_len; 213 211 int ret; 214 212 215 213 ret = pci_enable_device(dev); ··· 233 233 ret = pci_request_region(dev, 0, "gxfb (framebuffer)"); 234 234 if (ret < 0) 235 235 return ret; 236 - if ((fb_len = gx_frame_buffer_size()) < 0) 237 - return -ENOMEM; 236 + 238 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 239 info->screen_base = ioremap(info->fix.smem_start, info->fix.smem_len); 241 240 if (!info->screen_base) 242 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 244 * in the display controller */ 246 245 247 246 writel(info->fix.smem_start & 0xFF000000, 248 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 250 info->fix.smem_len / 1024, info->fix.smem_start); 252 251 253 252 return 0; ··· 453 454 454 455 module_param(mode_option, charp, 0); 455 456 MODULE_PARM_DESC(mode_option, "video mode (<x>x<y>[-<bpp>][@<refr>])"); 457 + 458 + module_param(vram, int, 0); 459 + MODULE_PARM_DESC(vram, "video memory size"); 456 460 457 461 MODULE_DESCRIPTION("Framebuffer driver for the AMD Geode GX"); 458 462 MODULE_LICENSE("GPL");