Package: fbset
Version: 2.1
Author: Guillem Jover <guillem@hadrons.org>
Status: not-sent
Description:
 Provide all debian changes to upstream.

diff -Naur fbset-2.1/con2fbmap.8 fbset-2.1-patched/con2fbmap.8
--- fbset-2.1/con2fbmap.8	1970-01-01 01:00:00.000000000 +0100
+++ fbset-2.1-patched/con2fbmap.8	2003-04-01 16:06:16.000000000 +0200
@@ -0,0 +1,31 @@
+.TH CON2FBMAP 8 "2003-04-1" local "Linux frame buffer utils"
+.SH NAME
+con2fbmap \- show and set mapping between consoles and framebuffer devices
+.SH SYNOPSIS
+.B con2fbmap
+.RI console
+.RI [ framebuffer ]
+.SH DESCRIPTION
+.B con2fbmap
+is a system utility to show or change the mapping of the consoles  to the
+frame buffer device. The frame buffer device provides a simple and unique
+interface to access different kinds of graphic displays.
+.PP
+Frame buffer devices are accessed via special device nodes located in the
+/dev directory. The naming scheme for these nodes is always
+.IR \fBfb < n >
+and
+.IR \fBfb/ < n >,
+where
+.I n
+is the number of the used frame buffer device.
+.PP
+.SH OPTIONS
+The first option must be there, and identify the console on which to work.
+If the second option is not set, con2fbmap shows the current mapping of
+identified console. If the second argument is given (as a number) con2fbmap
+maps the identified console to said framebuffer device.
+.SH AUTHOR
+Sven LUTHER <luther@debian.org>, some fixes by
+.br
+Guillem Jover <guillem@hadrons.org>
diff -Naur fbset-2.1/con2fbmap.c fbset-2.1-patched/con2fbmap.c
--- fbset-2.1/con2fbmap.c	1970-01-01 01:00:00.000000000 +0100
+++ fbset-2.1-patched/con2fbmap.c	2003-04-01 15:06:14.000000000 +0200
@@ -0,0 +1,66 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <string.h>
+#include <sys/ioctl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <linux/fb.h>
+
+#define DEFAULT_FRAMEBUFFER	"/dev/fb0"
+#define DEFAULT_FRAMEBUFFER_DEVFS	"/dev/fb/0"
+
+const char *programname;
+
+void Usage(void)
+{
+    fprintf(stderr, "\nUsage: %s console [framebuffer]\n\n", programname);
+    exit(1);
+}
+
+int main(int argc, char *argv[])
+{
+    int do_write = 0;
+    char *fbpath; /* any frame buffer will do */
+    int fd;
+    struct fb_con2fbmap map;
+
+    programname = argv[0];
+    switch (argc) {
+	case 3:
+	    do_write = 1;
+	    map.framebuffer = atoi(argv[2]);
+	case 2:
+	    map.console = atoi(argv[1]);
+	    break;
+	default:
+	    Usage();
+    }
+
+    if (access("/dev/.devfsd", F_OK) == 0)  /* devfs detected */
+	fbpath = DEFAULT_FRAMEBUFFER_DEVFS;
+    else
+	fbpath = DEFAULT_FRAMEBUFFER;
+
+    if ((fd = open(fbpath, O_RDONLY)) == -1) {
+	fprintf(stderr, "open %s: %s\n", fbpath, strerror(errno));
+	exit(1);
+    }
+    if (do_write) {
+	if (ioctl(fd, FBIOPUT_CON2FBMAP, &map)) {
+	    fprintf(stderr, "ioctl FBIOPUT_CON2FBMAP: %s\n", strerror(errno));
+	    exit(1);
+	}
+    } else {
+	if (ioctl(fd, FBIOGET_CON2FBMAP, &map)) {
+	    fprintf(stderr, "ioctl FBIOGET_CON2FBMAP: %s\n", strerror(errno));
+	    exit(1);
+	}
+	printf("console %d is mapped to framebuffer %d\n", map.console,
+	       map.framebuffer);
+    }
+    close(fd);
+    exit(0);
+}
diff -Naur fbset-2.1/etc/fb.modes.ATI fbset-2.1-patched/etc/fb.modes.ATI
--- fbset-2.1/etc/fb.modes.ATI	1999-01-17 20:15:47.000000000 +0100
+++ fbset-2.1-patched/etc/fb.modes.ATI	2003-04-01 14:56:53.000000000 +0200
@@ -430,7 +430,7 @@
 #	1024x768, 72 Hz, Non-Interlaced (75.00 MHz dotclock)
 #	
 #				Horizontal	Vertical
-#	Resolution		10224		768
+#	Resolution		1024		768
 #	Scan Frequency		58.230 kHz	72.245 Hz
 #	Sync Width		1.813 us	0.103 ms
 #				17 chars	6 lines
@@ -447,7 +447,7 @@
 
 mode "1024x768-72"
     # D: 75.00 MHz, H: 58.230 kHz, V: 72.245 Hz
-    geometry 10224 768 10224 768 8
+    geometry 1024 768 1024 768 8
     timings 13334 104 24 29 3 136 6
 endmode
  
diff -Naur fbset-2.1/fb.h fbset-2.1-patched/fb.h
--- fbset-2.1/fb.h	1999-06-23 16:09:48.000000000 +0200
+++ fbset-2.1-patched/fb.h	2003-04-01 15:06:14.000000000 +0200
@@ -1,16 +1,13 @@
 #ifndef _LINUX_FB_H
 #define _LINUX_FB_H
 
+#include <linux/tty.h>
 #include <asm/types.h>
 
 /* Definitions of frame buffers						*/
 
-#define FB_MAJOR	29
-
-#define FB_MODES_SHIFT		5	/* 32 modes per framebuffer */
-#define FB_NUM_MINORS		256	/* 256 Minors               */
-#define FB_MAX			(FB_NUM_MINORS / (1 << FB_MODES_SHIFT))
-#define GET_FB_IDX(node)	(MINOR(node) >> FB_MODES_SHIFT)
+#define FB_MAJOR		29
+#define FB_MAX			32	/* sufficient for now */
 
 /* ioctls
    0x46 is 'F'								*/
@@ -26,6 +23,15 @@
 /* #define FBIOSWITCH_MONIBIT	0x460E */
 #define FBIOGET_CON2FBMAP	0x460F
 #define FBIOPUT_CON2FBMAP	0x4610
+#define FBIOBLANK		0x4611		/* arg: 0 or vesa level + 1 */
+#define FBIOGET_VBLANK		_IOR('F', 0x12, struct fb_vblank)
+#define FBIO_ALLOC              0x4613
+#define FBIO_FREE               0x4614
+#define FBIOGET_GLYPH           0x4615
+#define FBIOGET_HWCINFO         0x4616
+#define FBIOPUT_MODEINFO        0x4617
+#define FBIOGET_DISPINFO        0x4618
+
 
 #define FB_TYPE_PACKED_PIXELS		0	/* Packed Pixels	*/
 #define FB_TYPE_PLANES			1	/* Non interleaved planes */
@@ -73,14 +79,38 @@
 #define FB_ACCEL_MATROX_MGAG100	20	/* Matrox G100 (Productiva G100) */
 #define FB_ACCEL_MATROX_MGAG200	21	/* Matrox G200 (Myst, Mill, ...) */
 #define FB_ACCEL_SUN_CG14	22	/* Sun cgfourteen		 */
-#define FB_ACCEL_SUN_BWTWO	23	/* Sun bwtwo			 */
-#define FB_ACCEL_SUN_CGTHREE	24	/* Sun cgthree			 */
-#define FB_ACCEL_SUN_TCX	25	/* Sun tcx			 */
-#define FB_ACCEL_MATROX_MGAG400	26	/* Matrox G400			 */
+#define FB_ACCEL_SUN_BWTWO	23	/* Sun bwtwo			*/
+#define FB_ACCEL_SUN_CGTHREE	24	/* Sun cgthree			*/
+#define FB_ACCEL_SUN_TCX	25	/* Sun tcx			*/
+#define FB_ACCEL_MATROX_MGAG400	26	/* Matrox G400			*/
+#define FB_ACCEL_NV3		27	/* nVidia RIVA 128              */
+#define FB_ACCEL_NV4		28	/* nVidia RIVA TNT		*/
+#define FB_ACCEL_NV5		29	/* nVidia RIVA TNT2		*/
+#define FB_ACCEL_CT_6555x	30	/* C&T 6555x			*/
+#define FB_ACCEL_3DFX_BANSHEE	31	/* 3Dfx Banshee			*/
+#define FB_ACCEL_ATI_RAGE128	32	/* ATI Rage128 family		*/
+#define FB_ACCEL_IGS_CYBER2000	33	/* CyberPro 2000		*/
+#define FB_ACCEL_IGS_CYBER2010	34	/* CyberPro 2010		*/
+#define FB_ACCEL_IGS_CYBER5000	35	/* CyberPro 5000		*/
+#define FB_ACCEL_SIS_GLAMOUR    36	/* SiS 300/630/540              */
+#define FB_ACCEL_3DLABS_PERMEDIA3 37	/* 3Dlabs Permedia 3		*/
+#define FB_ACCEL_ATI_RADEON	38	/* ATI Radeon family		*/
+
+
+#define FB_ACCEL_NEOMAGIC_NM2070 90	/* NeoMagic NM2070              */
+#define FB_ACCEL_NEOMAGIC_NM2090 91	/* NeoMagic NM2090              */
+#define FB_ACCEL_NEOMAGIC_NM2093 92	/* NeoMagic NM2093              */
+#define FB_ACCEL_NEOMAGIC_NM2097 93	/* NeoMagic NM2097              */
+#define FB_ACCEL_NEOMAGIC_NM2160 94	/* NeoMagic NM2160              */
+#define FB_ACCEL_NEOMAGIC_NM2200 95	/* NeoMagic NM2200              */
+#define FB_ACCEL_NEOMAGIC_NM2230 96	/* NeoMagic NM2230              */
+#define FB_ACCEL_NEOMAGIC_NM2360 97	/* NeoMagic NM2360              */
+#define FB_ACCEL_NEOMAGIC_NM2380 98	/* NeoMagic NM2380              */
+
 
 struct fb_fix_screeninfo {
 	char id[16];			/* identification string eg "TT Builtin" */
-	char *smem_start;		/* Start of frame buffer mem */
+	unsigned long smem_start;	/* Start of frame buffer mem */
 					/* (physical address) */
 	__u32 smem_len;			/* Length of frame buffer mem */
 	__u32 type;			/* see FB_TYPE_*		*/
@@ -90,7 +120,7 @@
 	__u16 ypanstep;			/* zero if no hardware panning  */
 	__u16 ywrapstep;		/* zero if no hardware ywrap    */
 	__u32 line_length;		/* length of a line in bytes    */
-	char *mmio_start;		/* Start of Memory Mapped I/O   */
+	unsigned long mmio_start;	/* Start of Memory Mapped I/O   */
 					/* (physical address) */
 	__u32 mmio_len;			/* Length of Memory Mapped I/O  */
 	__u32 accel;			/* Type of acceleration available */
@@ -193,6 +223,12 @@
 	__u32 framebuffer;
 };
 
+/* VESA Blanking Levels */
+#define VESA_NO_BLANKING        0
+#define VESA_VSYNC_SUSPEND      1
+#define VESA_HSYNC_SUSPEND      2
+#define VESA_POWERDOWN          3
+
 struct fb_monspecs {
 	__u32 hfmin;			/* hfreq lower limit (Hz) */
 	__u32 hfmax; 			/* hfreq upper limit (Hz) */
@@ -201,9 +237,35 @@
 	unsigned dpms : 1;		/* supports DPMS */
 };
 
+#define FB_VBLANK_VBLANKING	0x001	/* currently in a vertical blank */
+#define FB_VBLANK_HBLANKING	0x002	/* currently in a horizontal blank */
+#define FB_VBLANK_HAVE_VBLANK	0x004	/* vertical blanks can be detected */
+#define FB_VBLANK_HAVE_HBLANK	0x008	/* horizontal blanks can be detected */
+#define FB_VBLANK_HAVE_COUNT	0x010	/* global retrace counter is available */
+#define FB_VBLANK_HAVE_VCOUNT	0x020	/* the vcount field is valid */
+#define FB_VBLANK_HAVE_HCOUNT	0x040	/* the hcount field is valid */
+#define FB_VBLANK_VSYNCING	0x080	/* currently in a vsync */
+#define FB_VBLANK_HAVE_VSYNC	0x100	/* verical syncs can be detected */
+
+struct fb_vblank {
+	__u32 flags;			/* FB_VBLANK flags */
+	__u32 count;			/* counter of retraces since boot */
+	__u32 vcount;			/* current scanline position */
+	__u32 hcount;			/* current scandot position */
+	__u32 reserved[4];		/* reserved for future compatibility */
+};
+
 #ifdef __KERNEL__
 
+#if 1 /* to go away in 2.5.0 */
+extern int GET_FB_IDX(kdev_t rdev);
+#else
+#define GET_FB_IDX(node)	(MINOR(node))
+#endif
+
 #include <linux/fs.h>
+#include <linux/init.h>
+#include <linux/devfs_fs_kernel.h>
 
 
 struct fb_info;
@@ -217,6 +279,7 @@
 
 struct fb_ops {
     /* open/release and usage marking */
+    struct module *owner;
     int (*fb_open)(struct fb_info *info, int user);
     int (*fb_release)(struct fb_info *info, int user);
     /* get non settable parameters */
@@ -234,10 +297,10 @@
     /* set colormap */
     int (*fb_set_cmap)(struct fb_cmap *cmap, int kspc, int con,
 		       struct fb_info *info);
-    /* pan display */
+    /* pan display (optional) */
     int (*fb_pan_display)(struct fb_var_screeninfo *var, int con,
 			  struct fb_info *info);
-    /* perform fb specific ioctl */
+    /* perform fb specific ioctl (optional) */
     int (*fb_ioctl)(struct inode *inode, struct file *file, unsigned int cmd,
 		    unsigned long arg, int con, struct fb_info *info);
     /* perform fb specific mmap */
@@ -246,71 +309,23 @@
     int (*fb_rasterimg)(struct fb_info *info, int start);
 };
 
-
-   /*
-    *    This is the interface between the low-level console driver and the
-    *    low-level frame buffer device
-    */
-
-struct display {
-    /* Filled in by the frame buffer device */
-
-    struct fb_var_screeninfo var;   /* variable infos. yoffset and vmode */
-				    /* are updated by fbcon.c */
-    struct fb_cmap cmap;            /* colormap */
-    char *screen_base;              /* pointer to top of virtual screen */    
-				    /* (virtual address) */
-    int visual;
-    int type;                       /* see FB_TYPE_* */
-    int type_aux;                   /* Interleave for interleaved Planes */
-    u_short ypanstep;               /* zero if no hardware ypan */
-    u_short ywrapstep;              /* zero if no hardware ywrap */
-    u_long line_length;             /* length of a line in bytes */
-    u_short can_soft_blank;         /* zero if no hardware blanking */
-    u_short inverse;                /* != 0 text black on white as default */
-    struct display_switch *dispsw;  /* low level operations */
-    void *dispsw_data;		    /* optional dispsw helper data */
-
-#if 0
-    struct fb_fix_cursorinfo fcrsr;
-    struct fb_var_cursorinfo *vcrsr;
-    struct fb_cursorstate crsrstate;
-#endif
-
-    /* Filled in by the low-level console driver */
-
-    struct vc_data *conp;           /* pointer to console data */
-    struct fb_info *fb_info;        /* frame buffer for this console */
-    int vrows;                      /* number of virtual rows */
-    unsigned short cursor_x;	    /* current cursor position */
-    unsigned short cursor_y;
-    int fgcol;                      /* text colors */
-    int bgcol;
-    u_long next_line;               /* offset to one line below */
-    u_long next_plane;              /* offset to next plane */
-    u_char *fontdata;               /* Font associated to this display */
-    unsigned short _fontheightlog;
-    unsigned short _fontwidthlog;
-    unsigned short _fontheight;
-    unsigned short _fontwidth;
-    int userfont;                   /* != 0 if fontdata kmalloc()ed */
-    u_short scrollmode;             /* Scroll Method */
-    short yscroll;                  /* Hardware scrolling */
-    unsigned char fgshift, bgshift;
-    unsigned short charmask;	    /* 0xff or 0x1ff */
-};
-
-
 struct fb_info {
    char modename[40];			/* default video mode */
    kdev_t node;
    int flags;
+   int open;                            /* Has this been open already ? */
 #define FBINFO_FLAG_MODULE	1	/* Low-level driver is a module */
+   struct fb_var_screeninfo var;        /* Current var */
+   struct fb_fix_screeninfo fix;        /* Current fix */
+   struct fb_monspecs monspecs;         /* Current Monitor specs */
+   struct fb_cmap cmap;                 /* Current cmap */
    struct fb_ops *fbops;
-   struct fb_monspecs monspecs;
+   char *screen_base;                   /* Virtual address */
    struct display *disp;		/* initial display variable */
    struct vc_data *display_fg;		/* Console visible on this display */
    char fontname[40];			/* default font name */
+   devfs_handle_t devfs_handle;         /* Devfs handle for new name         */
+   devfs_handle_t devfs_lhandle;        /* Devfs handle for compat. symlink  */
    int (*changevar)(int);		/* tell console var has changed */
    int (*switch_con)(int, struct fb_info*);
 					/* tell fb to switch consoles */
@@ -319,8 +334,11 @@
    void (*blank)(int, struct fb_info*);	/* tell fb to (un)blank the screen */
 					/* arg = 0: unblank */
 					/* arg > 0: VESA level (arg-1) */
-
+   void *pseudo_palette;                /* Fake palette of 16 colors and 
+					   the cursor's color for non
+                                           palette mode */
    /* From here on everything is device dependent */
+   void *par;	
 };
 
 #ifdef MODULE
@@ -383,9 +401,6 @@
 			  struct fb_info *info);
 extern int fbgen_pan_display(struct fb_var_screeninfo *var, int con,
 			     struct fb_info *info);
-extern int fbgen_ioctl(struct inode *inode, struct file *file,
-		       unsigned int cmd, unsigned long arg, int con,
-		       struct fb_info *info);
 
     /*
      *  Helper functions
@@ -400,26 +415,17 @@
 extern void fbgen_blank(int blank, struct fb_info *info);
 
 
-struct fb_videomode {
-    const char *name;
-    struct fb_var_screeninfo var;
-};
-
-
-/* drivers/char/fbmem.c */
+/* drivers/video/fbmem.c */
 extern int register_framebuffer(struct fb_info *fb_info);
-extern int unregister_framebuffer(const struct fb_info *fb_info);
-extern int fbmon_valid_timings(u_int pixclock, u_int htotal, u_int vtotal,
-			       const struct fb_info *fb_info);
-extern int fbmon_dpms(const struct fb_info *fb_info);
-
+extern int unregister_framebuffer(struct fb_info *fb_info);
 
 extern int num_registered_fb;
 extern struct fb_info *registered_fb[FB_MAX];
-extern char con2fb_map[MAX_NR_CONSOLES];
 
-/* drivers/video/fbcon.c */
-extern struct display fb_display[MAX_NR_CONSOLES];
+/* drivers/video/fbmon.c */
+extern int fbmon_valid_timings(u_int pixclock, u_int htotal, u_int vtotal,
+			       const struct fb_info *fb_info);
+extern int fbmon_dpms(const struct fb_info *fb_info);
 
 /* drivers/video/fbcmap.c */
 extern int fb_alloc_cmap(struct fb_cmap *cmap, int len, int transp);
@@ -436,11 +442,57 @@
 extern struct fb_cmap *fb_default_cmap(int len);
 extern void fb_invert_cmaps(void);
 
-/* VESA Blanking Levels */
-#define VESA_NO_BLANKING	0
-#define VESA_VSYNC_SUSPEND	1
-#define VESA_HSYNC_SUSPEND	2
-#define VESA_POWERDOWN		3
+struct fb_videomode {
+    const char *name;	/* optional */
+    u32 refresh;	/* optional */
+    u32 xres;
+    u32 yres;
+    u32 pixclock;
+    u32 left_margin;
+    u32 right_margin;
+    u32 upper_margin;
+    u32 lower_margin;
+    u32 hsync_len;
+    u32 vsync_len;
+    u32 sync;
+    u32 vmode;
+};
+
+#ifdef MODULE
+static inline int fb_find_mode(struct fb_var_screeninfo *var,
+			       struct fb_info *info, const char *mode_option,
+			       const struct fb_videomode *db,
+			       unsigned int dbsize,
+			       const struct fb_videomode *default_mode,
+			       unsigned int default_bpp)
+{
+    extern int __fb_try_mode(struct fb_var_screeninfo *var,
+	    		     struct fb_info *info,
+			     const struct fb_videomode *mode,
+			     unsigned int bpp);
+    /*
+     *  FIXME: How to make the compiler optimize vga640x400 away if
+     *         default_mode is non-NULL?
+     */
+    static const struct fb_videomode vga640x400 = {
+	/* 640x400 @ 70 Hz, 31.5 kHz hsync */
+	NULL, 70, 640, 400, 39721, 40, 24, 39, 9, 96, 2,
+	0, FB_VMODE_NONINTERLACED
+    };
+    if (!default_mode)
+	default_mode = &vga640x400;
+    if (!default_bpp)
+	default_bpp = 8;
+    return __fb_try_mode(var, info, default_mode, default_bpp);
+}
+#else
+extern int __init fb_find_mode(struct fb_var_screeninfo *var,
+			       struct fb_info *info, const char *mode_option,
+			       const struct fb_videomode *db,
+			       unsigned int dbsize,
+			       const struct fb_videomode *default_mode,
+			       unsigned int default_bpp);
+#endif
 
 #endif /* __KERNEL__ */
 
diff -Naur fbset-2.1/fb.modes.5 fbset-2.1-patched/fb.modes.5
--- fbset-2.1/fb.modes.5	1999-01-17 20:15:47.000000000 +0100
+++ fbset-2.1-patched/fb.modes.5	2003-04-01 15:24:35.000000000 +0200
@@ -1,4 +1,4 @@
-.TH fb.modes 8 "Aug 1996" local "Linux frame buffer utils"
+.TH fb.modes 8 "2003-01-22" local "Linux frame buffer utils"
 .SH NAME
 fb.modes \- frame buffer modes file
 .SH DESCRIPTION
@@ -27,6 +27,9 @@
 .br
 .B options
 .RI < value >
+.br
+.B rgba
+.RI < red , green , blue , alpha >
 .RE
 endmode
 .SH OPTIONS
@@ -74,6 +77,22 @@
 vertical sync length (in pixel lines)
 .RE
 .PP
+rgba options (only valid with truecolor):
+.RS
+.TP
+.I red
+red color bitfields (in length or length/offset)
+.TP
+.I green
+green color bitfields (in length or length/offset)
+.TP
+.I blue
+blue color bitfields (in length or length/offset)
+.TP
+.I alpha
+alpha color bitfields (in length or length/offset)
+.RE
+.PP
 other options:
 .RS
 the first value of this options is the default
@@ -87,6 +106,14 @@
 .IR \fBcsync "\ {" low | high }
 the composite sync polarity
 .TP
+.IR \fBgsync "\ {" low | high }
+the sync on green polarity
+.TP
+.IR \fBbcast "\ {" false | true }
+enable or disable broadcast modes. If enabled the frame buffer generates
+the exact timings fot several broadcast modes (e.g. PAL or NTSC). Note that
+this option may not be supported by every frame buffer
+.TP
 .IR \fBextsync "\ {" false | true }
 enable or disable external resync. If enabled the sync timings are not
 generated by the frame buffer device and must be provided externally
@@ -106,6 +133,15 @@
 same resolution can be displayed on different monitors, even if the
 horizontal frequency specification differs. Note that this option may not be
 supported by every frame buffer device
+.TP
+.IR \fBnostd "\ <" number >
+select nonstandard video mode
+.TP
+.IR \fBaccel "\ {" false | true }
+enable or disable hardware text acceleration
+.TP
+.IR \fBgrayscale "\ {" false | true }
+enable or disable graylevels instead of colors
 .RE
 .SH INTERNALS
 Generally a frame buffer display is organized as follows:
diff -Naur fbset-2.1/fbset.8 fbset-2.1-patched/fbset.8
--- fbset-2.1/fbset.8	1999-06-23 16:09:48.000000000 +0200
+++ fbset-2.1-patched/fbset.8	2003-04-01 16:16:56.000000000 +0200
@@ -1,4 +1,4 @@
-.TH fbset 8 "July 1998" local "Linux frame buffer utils"
+.TH FBSET 8 "2003-01-22" local "Linux frame buffer utils"
 .SH NAME
 fbset \- show and modify frame buffer device settings
 .SH SYNOPSIS
@@ -6,8 +6,6 @@
 .RI [ options ]
 .RI [ mode ]
 .SH DESCRIPTION
-.B This documentation is out of date!!
-.PP
 .B fbset
 is a system utility to show or change the settings of the frame buffer
 device. The frame buffer device provides a simple and unique interface to
@@ -15,6 +13,8 @@
 .PP
 Frame buffer devices are accessed via special device nodes located in the
 /dev directory. The naming scheme for these nodes is always
+.IR \fBfb/ < n >
+or
 .IR \fBfb < n >,
 where
 .I n
@@ -36,10 +36,8 @@
 .BR \-\-help ",\ " \-h
 display an usage information
 .TP
-.BR \-\-now ",\ " \-n
-change the video mode immediately. If no frame buffer device is given via
-.B \-fb
-, then this option is activated by default
+.BR \-\-test
+don't change, just test whether the mode is valid
 .TP
 .BR \-\-show ",\ " \-s
 display the video mode settings. This is default if no further option or
@@ -66,14 +64,18 @@
 Frame buffer device nodes:
 .RS
 .TP
+.BR \-\-all ",\ "  \-a
+change all virtual consoles on this device
+.TP
 .BR \-fb "\ <" \fIdevice >
 .I device
 gives the frame buffer device node. If no device via
 .B \-fb
 is given, 
+.I /dev/fb/0
+or
 .I /dev/fb0
 is used
-.TP
 .RE
 .PP
 Video mode database:
@@ -86,6 +88,13 @@
 .BR fb.modes (5)
 .RE
 .PP
+Display bitfield colors:
+.RS
+.TP
+.BR \-rgba "\ <" \fIred , \fIgreen , \fIblue , \fIalpha >
+each in length or length/offset color format
+.RE
+.PP
 Display geometry:
 .RS
 .TP
@@ -104,6 +113,10 @@
 .BR \-depth "\ <" \fIvalue >
 set display depth (in bits per pixel)
 .TP
+.TP
+.BR \-nonstd "\ <" \fIvalue >
+select nonstandard video mode
+.TP
 .BR \-\-geometry ",\ " \-g "\ ..."
 set all geometry parameters at once in the order
 .RI < xres >
@@ -161,6 +174,9 @@
 Display flags:
 .RS
 .TP
+.IR \fB\-accel "\ {" false | true }
+set hardware text acceleration enable
+.TP
 .IR \fB\-hsync "\ {" low | high }
 set the horizontal sync polarity
 .TP
@@ -170,6 +186,9 @@
 .IR \fB\-csync "\ {" low | high }
 set the composite sync polarity
 .TP
+.IR \fB\-gsync "\ {" false | true }
+set synch on green
+.TP
 .IR \fB\-extsync "\ {" false | true }
 enable or disable external resync. If enabled the sync timings are not
 generated by the frame buffer device and must be provided externally
@@ -239,4 +258,10 @@
 .TP
 Roman Zippel <zippel@fh-brandenburg.de>
 .br
-man files
+Wrote this man page.
+.TP
+Osamu Aoki <debian@aokiconsulting.com> and
+.TP
+Guillem Jover <guillem@hadrons.org>
+.br
+Extended and updated it.
diff -Naur fbset-2.1/fbset.c fbset-2.1-patched/fbset.c
--- fbset-2.1/fbset.c	1999-06-23 16:11:46.000000000 +0200
+++ fbset-2.1-patched/fbset.c	2003-04-01 16:18:37.000000000 +0200
@@ -16,6 +16,13 @@
  *  Brad Midgley <brad@exodus.pht.com>:
  *           -match
  *
+ *  Bas Zoetekouw <bas@debian.org>:
+ *           Added devfs support
+ *
+ *  Guillem Jover <guillem@hadrons.org>:
+ *           Show devfs device also as a default
+ *           Added missing accelerator names from linux kernel 2.4.20
+ *
  */
 
 
@@ -42,6 +49,7 @@
      */
 
 #define DEFAULT_FRAMEBUFFER	"/dev/fb0"
+#define DEFAULT_FRAMEBUFFER_DEVFS	"/dev/fb/0"
 
 
     /*
@@ -199,6 +207,27 @@
     { FB_ACCEL_SUN_CGTHREE, "Sun cg3" },
     { FB_ACCEL_SUN_TCX, "Sun tcx" },
     { FB_ACCEL_MATROX_MGAG400, "Matrox G400" },
+    { FB_ACCEL_NV3, "nVidia RIVA 128" },
+    { FB_ACCEL_NV4, "nVidia RIVA TNT" },
+    { FB_ACCEL_NV5, "nVidia RIVA TNT2" },
+    { FB_ACCEL_CT_6555x, "C&T 6555x" },
+    { FB_ACCEL_3DFX_BANSHEE, "3Dfx Banshee" },
+    { FB_ACCEL_ATI_RAGE128, "ATI Rage128 family" },
+    { FB_ACCEL_IGS_CYBER2000, "CyberPro 2000" },
+    { FB_ACCEL_IGS_CYBER2010, "CyberPro 2010" },
+    { FB_ACCEL_IGS_CYBER5000, "CyberPro 5000" },
+    { FB_ACCEL_SIS_GLAMOUR, "SiS 300/630/540" },
+    { FB_ACCEL_3DLABS_PERMEDIA3, "3Dlabs Permedia 3" },
+    { FB_ACCEL_ATI_RADEON, "ATI Radeon family" },
+    { FB_ACCEL_NEOMAGIC_NM2070, "NeoMagic NM2070" },
+    { FB_ACCEL_NEOMAGIC_NM2090, "NeoMagic NM2090" },
+    { FB_ACCEL_NEOMAGIC_NM2093, "NeoMagic NM2093" },
+    { FB_ACCEL_NEOMAGIC_NM2097, "NeoMagic NM2097" },
+    { FB_ACCEL_NEOMAGIC_NM2160, "NeoMagic NM2160" },
+    { FB_ACCEL_NEOMAGIC_NM2200, "NeoMagic NM2200" },
+    { FB_ACCEL_NEOMAGIC_NM2230, "NeoMagic NM2230" },
+    { FB_ACCEL_NEOMAGIC_NM2360, "NeoMagic NM2360" },
+    { FB_ACCEL_NEOMAGIC_NM2380, "NeoMagic NM2380" },
 };
 
 
@@ -710,7 +739,7 @@
 
     puts("Frame buffer device information:");
     printf("    Name        : %s\n", fix->id);
-    printf("    Address     : %p\n", fix->smem_start);
+    printf("    Address     : %p\n", (void *)fix->smem_start);
     printf("    Size        : %d\n", fix->smem_len);
     printf("    Type        : ");
     switch (fix->type) {
@@ -780,7 +809,7 @@
     printf("    YWrapStep   : %d\n", fix->ywrapstep);
     printf("    LineLength  : %d\n", fix->line_length);
     if (fix->mmio_len) {
-	printf("    MMIO Address: %p\n", fix->mmio_start);
+	printf("    MMIO Address: %p\n", (void *)fix->mmio_start);
 	printf("    MMIO Size   : %d\n", fix->mmio_len);
     }
     printf("    Accelerator : ");
@@ -846,7 +875,7 @@
 	"    -a, --all          : change all virtual consoles on this device\n"
 	"  Frame buffer special device nodes:\n"
 	"    -fb <device>       : processed frame buffer device\n"
-	"                         (default is " DEFAULT_FRAMEBUFFER ")\n"
+	"                         (default is " DEFAULT_FRAMEBUFFER "; " DEFAULT_FRAMEBUFFER_DEVFS " when using devfs)\n"
 	"  Video mode database:\n"
 	"    -db <file>         : video mode database file\n"
 	"                         (default is " DEFAULT_MODEDBFILE ")\n"
@@ -977,8 +1006,12 @@
     if (Opt_version || Opt_verbose)
 	puts(VERSION);
 
-    if (!Opt_fb)
-	Opt_fb = DEFAULT_FRAMEBUFFER;
+    if (!Opt_fb) {
+        if (access("/dev/.devfsd",F_OK)==0)  /* devfs detected */
+	    Opt_fb = DEFAULT_FRAMEBUFFER_DEVFS;
+	else 
+	    Opt_fb = DEFAULT_FRAMEBUFFER;
+    }
 
     /*
      *  Open the Frame Buffer Device
diff -Naur fbset-2.1/Makefile fbset-2.1-patched/Makefile
--- fbset-2.1/Makefile	1999-01-17 20:15:46.000000000 +0100
+++ fbset-2.1-patched/Makefile	2003-04-01 15:20:36.000000000 +0200
@@ -2,14 +2,16 @@
 # Linux Frame Buffer Device Configuration
 #
 
-CC =		gcc -Wall -O2 -I.
-BISON =		bison -d
-FLEX =		flex
-INSTALL =	install
-RM =		rm -f
-
-All:		fbset
+CC = gcc
+CFLAGS = -Wall -O2
+BISON = bison -d
+FLEX = flex
+INSTALL = install
+INSTALL_PROGRAM = $(INSTALL) -m 755
+INSTALL_DATA = $(INSTALL) -m 644
+RM = rm -f
 
+all:		fbset con2fbmap
 
 fbset:		fbset.o modes.tab.o lex.yy.o
 
@@ -18,24 +20,35 @@
 lex.yy.o:	lex.yy.c fbset.h modes.tab.h
 
 lex.yy.c:	modes.l
-		$(FLEX) modes.l
+	$(FLEX) modes.l
 
 modes.tab.c:	modes.y
-		$(BISON) modes.y
+	$(BISON) modes.y
+
+con2fbmap:	con2fbmap.o
+con2fbmap.o:	con2fbmap.c
 
 install:	fbset
-		if [ -f /sbin/fbset ]; then rm /sbin/fbset; fi
-		$(INSTALL) fbset /usr/sbin
-		$(INSTALL) fbset.8 /usr/man/man8
-		$(INSTALL) fb.modes.5 /usr/man/man5
-		if [ ! -c /dev/fb0 ]; then mknod /dev/fb0 c 29 0; fi
-		if [ ! -c /dev/fb1 ]; then mknod /dev/fb1 c 29 32; fi
-		if [ ! -c /dev/fb2 ]; then mknod /dev/fb2 c 29 64; fi
-		if [ ! -c /dev/fb3 ]; then mknod /dev/fb3 c 29 96; fi
-		if [ ! -c /dev/fb4 ]; then mknod /dev/fb4 c 29 128; fi
-		if [ ! -c /dev/fb5 ]; then mknod /dev/fb5 c 29 160; fi
-		if [ ! -c /dev/fb6 ]; then mknod /dev/fb6 c 29 192; fi
-		if [ ! -c /dev/fb7 ]; then mknod /dev/fb7 c 29 224; fi
+	$(INSTALL) -d $(DESTDIR)/{etc,usr/{sbin,share/man/man{5,8}}}
+	$(INSTALL_DATA) etc/fb.modes.ATI $(DESTDIR)/etc/fb.modes
+	$(INSTALL_DATA) fb.modes.5 $(DESTDIR)/usr/share/man/man5
+	$(INSTALL_PROGRAM) fbset $(DESTDIR)/usr/sbin
+	$(INSTALL_DATA) fbset.8 $(DESTDIR)/usr/share/man/man8
+	$(INSTALL_PROGRAM) modeline2fb $(DESTDIR)/usr/sbin
+	$(INSTALL_DATA) modeline2fb.8 $(DESTDIR)/usr/share/man/man8
+	$(INSTALL_PROGRAM) con2fbmap $(DESTDIR)/usr/sbin
+	$(INSTALL_DATA) con2fbmap.8 $(DESTDIR)/usr/share/man/man8
+
+install-devices:
+	if [ ! -c /dev/fb0 ]; then mknod $(DESTDIR)/dev/fb0 c 29 0; fi
+	if [ ! -c /dev/fb1 ]; then mknod $(DESTDIR)/dev/fb1 c 29 32; fi
+	if [ ! -c /dev/fb2 ]; then mknod $(DESTDIR)/dev/fb2 c 29 64; fi
+	if [ ! -c /dev/fb3 ]; then mknod $(DESTDIR)/dev/fb3 c 29 96; fi
+	if [ ! -c /dev/fb4 ]; then mknod $(DESTDIR)/dev/fb4 c 29 128; fi
+	if [ ! -c /dev/fb5 ]; then mknod $(DESTDIR)/dev/fb5 c 29 160; fi
+	if [ ! -c /dev/fb6 ]; then mknod $(DESTDIR)/dev/fb6 c 29 192; fi
+	if [ ! -c /dev/fb7 ]; then mknod $(DESTDIR)/dev/fb7 c 29 224; fi
 
 clean:
-		$(RM) *.o fbset lex.yy.c modes.tab.c modes.tab.h
+	$(RM) *.o fbset con2fbmap lex.yy.c modes.tab.c modes.tab.h
+
diff -Naur fbset-2.1/modeline2fb.8 fbset-2.1-patched/modeline2fb.8
--- fbset-2.1/modeline2fb.8	1970-01-01 01:00:00.000000000 +0100
+++ fbset-2.1-patched/modeline2fb.8	2003-04-01 15:41:36.000000000 +0200
@@ -0,0 +1,40 @@
+.TH MODELINE2FB 8 "2003-01-22" local "Linux frame buffer utils"
+.SH NAME
+modeline2fb \- simple modeline to fb.modes translator
+.SH SYNOPSIS
+.B modeline2fb
+[\fIOPTION\fR] [\fIFILES\fR]
+.SH DESCRIPTION
+.PP
+.I modeline2fb
+is a simple Perl script that converts XF86Config-style modelines to options
+suitable for a fb.modes file.
+.PP
+Note that only one option can be successfully enabled at any particular time.
+.SH OPTIONS
+.TP
+\fB\-d\fR, \fB\-\-depth\fR \fIdepth\fR
+Use the given display depth (default is 8).
+.TP
+\fB\-h\fR \fB\-\-help\fR
+Print out a help screen and exit.
+.SH ADVANCED OPTIONS
+.TP
+\fB\-r\fR \fB\-\-rounding\fR \fIdiv\fR
+Sets the vxres divisor (default is 128).
+.TP
+\fB\-x\fR \fB\-\-vxres\fR \fIX,X,X,...\fR
+Sets extra vxres values.
+.PP
+[\fIFILES\fR] refers to one or more XF86Config files.  Note that all modelines
+must be in single-line format.  If no files are given on the command line,
+this program reads from standard in. This program will also write to
+standard out.
+.SH EXAMPLE
+/usr/sbin/modeline2fb \-d 16 /etc/X11/XF86Config
+.SH "SEE ALSO"
+.BR fb.modes(5),
+.BR XF86Config(5)
+.SH AUTHOR
+This manual page is a quick write-up for Debian done by Kevin Kreamer
+<kkreamer@etherhogz.org>.
diff -Naur fbset-2.1/modes.l fbset-2.1-patched/modes.l
--- fbset-2.1/modes.l	1999-06-23 16:09:48.000000000 +0200
+++ fbset-2.1-patched/modes.l	2003-04-01 15:06:14.000000000 +0200
@@ -99,6 +99,7 @@
 
 keyword	[a-zA-Z][a-zA-Z0-9]*
 number	[0-9]*
+colors	[0-9/,]*
 string	\"[^\"\n]*\"
 comment	\#([^\n]*)
 space	[ \t]+
@@ -115,6 +116,11 @@
 		return NUMBER;
 	    }
 
+{colors}    {
+		yylval = (unsigned long)CopyString(yytext);
+		return COLORS;
+	    }
+
 {string}    {
 		yylval = (unsigned long)CopyString(yytext);
 		return STRING;
diff -Naur fbset-2.1/modes.y fbset-2.1-patched/modes.y
--- fbset-2.1/modes.y	1999-06-23 16:09:48.000000000 +0200
+++ fbset-2.1-patched/modes.y	2003-04-01 15:06:14.000000000 +0200
@@ -42,7 +42,7 @@
 
 %token MODE GEOMETRY TIMINGS HSYNC VSYNC CSYNC GSYNC EXTSYNC BCAST LACED DOUBLE
        RGBA NONSTD ACCEL GRAYSCALE
-       ENDMODE POLARITY BOOLEAN STRING NUMBER 
+       ENDMODE POLARITY BOOLEAN STRING NUMBER COLORS
 
 %%
 
@@ -148,7 +148,7 @@
 	    }
 	  ;
 
-rgba      : RGBA STRING
+rgba      : RGBA COLORS
             {
 		makeRGBA(&VideoMode, (const char*)$2);
 	    }
