File fbset-2.1-update.patch of Package fbset
--- fb.h
+++ fb.h
@@ -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__ */
--- fb.modes.5
+++ fb.modes.5
@@ -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:
--- etc/fb.modes.ATI
+++ etc/fb.modes.ATI
@@ -6,6 +6,8 @@
# Mach64 Programmer's Guide, Appendix C
# (C) 1998 ATI Technologies Inc.
#
+# Kop: this are very generic modes and not only for ATI cards.
+#
#
# 640x480, 60 Hz, Non-Interlaced (25.175 MHz dotclock)
@@ -132,6 +134,36 @@
timings 22272 48 32 17 22 128 12
endmode
+
+#
+# 768x576, 75 Hz, Non-Interlaced (49.188 MHz dotclock)
+#
+# Horizontal Vertical
+# Resolution 768 576
+# Scan Frequency 46.580 kHz 75.008 Hz
+# Sync Width us ms
+# chars lines
+# Front Porch us ms
+# chars lines
+# Back Porch us ms
+# chars lines
+# Active Time us ms
+# chars lines
+# Blank Time us ms
+# chars lines
+# Polarity negative negative
+#
+# This is a mode often used, because fbtv suggests this, since
+# this is the mode for "normal" TVs.
+#
+
+mode "768x576-75"
+ # D: 49.188 MHz, H: 46.580 kHz, V: 75.008 Hz
+ geometry 768 576 768 576 32
+ timings 20330 128 32 32 8 128 5
+endmode
+
+
#
# 800x600, 48 Hz, Interlaced (36.00 MHz dotclock)
#
@@ -430,7 +462,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 +479,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
@@ -691,7 +723,45 @@
hsync high
vsync high
endmode
-
+
+#
+# 1280x960, 75 Hz, Non-Interlaced (126.00 MHz dotclock)
+#
+# Horizontal Vertical
+# Resolution 1280 960
+# Scan Frequency 74.788 kHz 74.788 Hz
+# Sync Width 1.018 us 0.092 ms
+# 14 chars 7 lines
+# Front Porch 0.127 us 0.393 ms
+# 2 chars 30 lines
+# Back Porch 1.473 us 0.747 ms
+# 20 chars 57 lines
+# Active Time 10.473 us 11.311 ms
+# 144 chars 864 lines
+# Blank Time 2.618 us 1.231 ms
+# 36 chars 94 lines
+# Polarity positive positive
+#
+
+mode "1280x960-75-8"
+ # D: 125.644 MHz, H: 74.788 kHz, V: 74.788 Hz
+ geometry 1280 960 1280 960 8
+ timings 7959 224 32 36 1 144 3
+endmode
+
+mode "1280x960-75"
+ # D: 125.644 MHz, H: 74.788 kHz, V: 74.788 Hz
+ geometry 1280 960 1280 960 16
+ timings 7959 224 32 36 1 144 3
+endmode
+
+mode "1280x960-75-32"
+ # D: 125.644 MHz, H: 74.788 kHz, V: 74.788 Hz
+ geometry 1280 960 1280 960 32
+ timings 7959 224 32 36 1 144 3
+endmode
+
+
#
# 1280x1024, 43 Hz, Interlaced (80.00 MHz dotclock)
#
@@ -849,13 +919,13 @@
#
mode "1280x1024-75"
- # D: 135.00 MHz, H: 79.976 kHz, V: 75.02 Hz
- geometry 1280 1024 1280 1024 8
- timings 7408 248 16 38 1 144 3
+ # D: 134.880 MHz, H: 79.905 kHz, V: 74.958 Hz
+ geometry 1280 1024 1280 3264 8
+ timings 7414 232 64 38 1 112 3
hsync high
vsync high
endmode
-
+
#
# 1600x1200, 60 Hz, Non-Interlaced (156.00 MHz dotclock)
#
--- fbset.8
+++ fbset.8
@@ -1,4 +1,4 @@
-.TH fbset 8 "July 1998" local "Linux frame buffer utils"
+.TH fbset 8 "June 2001" 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
--- fbset.c
+++ fbset.c
@@ -42,6 +42,7 @@
*/
#define DEFAULT_FRAMEBUFFER "/dev/fb0"
+#define DEFAULT_FRAMEBUFFER_DEVFS "/dev/fb/0"
/*
@@ -199,6 +200,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 +732,7 @@
puts("Frame buffer device information:");
printf(" Name : %s\n", fix->id);
- printf(" Address : %p\n", fix->smem_start);
+ printf(" Address : %#0lx\n", fix->smem_start);
printf(" Size : %d\n", fix->smem_len);
printf(" Type : ");
switch (fix->type) {
@@ -780,7 +802,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: %#0lx\n", fix->mmio_start);
printf(" MMIO Size : %d\n", fix->mmio_len);
}
printf(" Accelerator : ");
@@ -846,7 +868,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 +999,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
--- modeline2fb.8
+++ modeline2fb.8
@@ -0,0 +1,40 @@
+.TH MODELINE2FB 8
+.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>.
--- modes.l
+++ modes.l
@@ -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;
--- modes.y
+++ modes.y
@@ -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);
}