fbutils
Subsystems (2)
Here's a patch to get fbutils from the CVS working if anyone else wants to play around with them.
John
etc/modes +18 -18
@@ -7,20 +7,20 @@ { 800 600 27777 128 24 22 1 72 2 } "1024x768@87" # 1024x768 @ 87 Hz interlaced, 35.5 kHz hsync { 1024 768 22271 56 24 33 8 160 8 interlace } -# "640x400@85" # 640x400 @ 85 Hz, 37.86 kHz hsync -# { 640 400 31746 96 32 41 1 64 3 vsync+ } + "640x400@85" # 640x400 @ 85 Hz, 37.86 kHz hsync + { 640 400 31746 96 32 41 1 64 3 vsync+ } "640x480@72" # 640x480 @ 72 Hz, 36.5 kHz hsync { 640 480 31746 144 40 30 8 40 3 } "640x480@75" # 640x480 @ 75 Hz, 37.50 kHz hsync { 640 480 31746 120 16 16 1 64 3 } -# "800x600@60" # 800x600 @ 60 Hz, 37.8 kHz hsync -# { 800 600 25000 88 40 23 1 128 4 0 hsync+ vsync+ } + "800x600@60" # 800x600 @ 60 Hz, 37.8 kHz hsync + { 800 600 25000 88 40 23 1 128 4 0 hsync+ vsync+ } "640x480@85" # 640x480 @ 85 Hz, 43.27 kHz hsync { 640 480 27777 80 56 25 1 56 3 } "1152x864@89" # 1152x864 @ 89 Hz interlaced, 44 kHz hsync { 1152 864 15384 96 16 110 1 216 10 interlace } -# "800x600@72" # 800x600 @ 72 Hz, 48.0 kHz hsync -# { 800 600 20000 64 56 23 37 120 6 hsync+ vsync+ } + "800x600@72" # 800x600 @ 72 Hz, 48.0 kHz hsync + { 800 600 20000 64 56 23 37 120 6 hsync+ vsync+ } "1024x768@60" # 1024x768 @ 60 Hz, 48.4 kHz hsync { 1024 768 15384 168 8 29 3 144 6 } "640x480@100" # 640x480 @ 100 Hz, 53.01 kHz hsync
@@ -47,8 +47,8 @@ { 1152 864 9090 228 88 32 0 84 12 } "1280x1024@70" # 1280x1024 @ 70 Hz, 74.59 kHz hsync { 1280 1024 7905 224 32 28 8 160 8 } -# "1600x1200@60" # 1600x1200 @ 60Hz, 75.00 kHz hsync -# { 1600 1200 6172 304 64 46 1 192 3 hsync+ vsync+ } + "1600x1200@60" # 1600x1200 @ 60Hz, 75.00 kHz hsync + { 1600 1200 6172 304 64 46 1 192 3 hsync+ vsync+ } "1152x864@84" # 1152x864 @ 84 Hz, 76.0 kHz hsync { 1152 864 7407 184 312 32 0 128 12 } "1280x1024@74" # 1280x1024 @ 74 Hz, 78.85 kHz hsync
@@ -61,18 +61,18 @@ { 1600 1200 5291 304 64 46 1 192 3 } "1152x864@100" # 1152x864 @ 100 Hz, 89.62 kHz hsync { 1152 864 7264 224 32 17 2 128 19 } -# "1280x1024@85" # 1280x1024 @ 85 Hz, 91.15 kHz hsync -# { 1280 1024 6349 224 64 44 1 160 3 hsync+ vsync+ } -# "1600x1200@75" # 1600x1200 @ 75 Hz, 93.75 kHz hsync -# { 1600 1200 4938 304 64 46 1 192 3 hsync+ vsync+ } -# "1600x1200@85" # 1600x1200 @ 85 Hz, 105.77 kHz hsync -# { 1600 1200 4545 272 16 37 4 192 3 hsync+ vsync+ } + "1280x1024@85" # 1280x1024 @ 85 Hz, 91.15 kHz hsync + { 1280 1024 6349 224 64 44 1 160 3 hsync+ vsync+ } + "1600x1200@75" # 1600x1200 @ 75 Hz, 93.75 kHz hsync + { 1600 1200 4938 304 64 46 1 192 3 hsync+ vsync+ } + "1600x1200@85" # 1600x1200 @ 85 Hz, 105.77 kHz hsync + { 1600 1200 4545 272 16 37 4 192 3 hsync+ vsync+ } "1280x1024@100" # 1280x1024 @ 100 Hz, 107.16 kHz hsync { 1280 1024 5502 256 32 26 7 128 15 } -# "1800x1440@64" # 1800x1440 @ 64Hz, 96.15 kHz hsync -# { 1800 1440 4347 304 96 46 1 192 3 hsync+ vsync+ } -# "1800x1440@70" # 1800x1440 @ 70Hz, 104.52 kHz hsync -# { 1800 1440 4000 304 96 46 1 192 3 hsync+ vsync+ } + "1800x1440@64" # 1800x1440 @ 64Hz, 96.15 kHz hsync + { 1800 1440 4347 304 96 46 1 192 3 hsync+ vsync+ } + "1800x1440@70" # 1800x1440 @ 70Hz, 104.52 kHz hsync + { 1800 1440 4000 304 96 46 1 192 3 hsync+ vsync+ } "512x384@78" # 512x384 @ 78 Hz, 31.50 kHz hsync { 512 384 49603 48 16 16 1 64 3 } "512x384@85" # 512x384 @ 85 Hz, 34.38 kHz hsync
fbconvert/fbconvert.C +1 -9
@@ -29,7 +29,6 @@ static bool Opt_version = false; static bool Opt_verbose = false; -static bool Opt_quiet = false; static const char *Opt_debug = NULL; const char *Opt_modedb = NULL;
@@ -39,7 +38,6 @@ { ID_HELP, 'h', "help", NULL, 0 }, { 0, 'V', "version", &Opt_version, 0 }, { 0, 'v', "verbose", &Opt_verbose, 0 }, - { 0, 'q', "quiet", &Opt_quiet, 0 }, }; u_int DebugMask = 0;
@@ -50,18 +48,12 @@ static void Usage(void) { puts(VERSION); - Die("\nUsage: %s [options] [mode]\n\n" + Die("\nUsage: %s [options] modedb\n\n" "Valid options:\n" " General options:\n" " -h, --help : display this usage information\n" - " --test : don't change, just test whether the mode is " - "valid\n" - " -s, --show : display video mode settings\n" - " -i, --info : display all frame buffer information\n" " -v, --verbose : verbose mode\n" " -V, --version : print version information\n" - " -x, --xfree86 : XFree86 compatibility mode\n" - " -a, --all : change all virtual consoles on this device\n" "n", ProgramName); }
fbset/fbset.C +138 -74
237 lines not on this page · raw message
include/database.h +57 -0
81 lines not on this page · raw message
include/util.h +1 -1
@@ -20,7 +20,7 @@extern void Die (const char *fmt,...) __attribute__((noreturn));extern void Warn (const char *fmt,...); -extern int GetNextOption(int &argc, const char **&argv, +extern int GetNextOption(int &argc, char **&argv,const struct option options[],const u_int num_options);
lib/config.l +8 -8
@@ -34,18 +34,14 @@ { "geometry", GEOMETRY, 0 }, { "format", FORMAT, 0 }, { "mode", MODE, 0 }, - { "hsync", HSYNC, 0 }, - { "vsync", VSYNC, 0 }, - { "csync", CSYNC, 0 }, + { "hsync+", HSYNCP, 0 }, + { "vsync+", VSYNCP, 0 }, + { "csync+", CSYNCP, 0 }, { "gsync", GSYNC, 0 }, { "extsync", EXTSYNC, 0 }, { "broadcast", BCAST, 0 }, { "interlace", LACED, 0 }, { "doublescan", DOUBLE, 0 }, - { "low", POLARITY, 0 }, - { "high", POLARITY, 1 }, - { "false", BOOL, 0 }, - { "true", BOOL, 1 }, { "", -1, 0 } };
@@ -110,7 +106,7 @@ %} -keyword [a-zA-Z][a-zA-Z0-9]* +keyword [a-zA-Z][a-zA-Z0-9\+]* int [0-9]* string \"[^\"\n]*\" comment \#([^\n]*)
@@ -149,6 +145,10 @@ \} { return CLOSEB; } + +\: { + return COLON; + } {junk} { yyerror("Invalid token `%s'\n", yytext);
lib/config.y +82 -16
178 lines not on this page · raw message
lib/database.C +27 -5
@@ -46,6 +46,18 @@ if (IsDoubleScan()) printf("doublescan "); // if (sync) ... + if (IsSyncHorPos()) + printf("hsync+ "); + if (IsSyncVertPos()) + printf("vsync+ "); + if (IsSyncCompPos()) + printf("csync+ "); + if (IsSyncOnGreen()) + printf("gsync "); + if (IsSyncExt()) + printf("extsync "); + if (IsSyncBcast()) + printf("broadcast "); puts("}"); }
@@ -88,11 +100,21 @@ void Format::Dump(bool in_list) const { - printf("{ %d %d:%d:%d %d:%d:%d %d:%d:%d %d:%d:%d %d %d }\n", - bits_per_pixel, red.offset, red.length, red.msb_right, green.offset, - green.length, green.msb_right, blue.offset, blue.length, - blue.msb_right, transp.offset, transp.length, transp.msb_right, - grayscale, nonstd); + printf("{ %d ", bits_per_pixel ); + + if( BitfieldsAreNZ() ) + printf("%d:%d:%d %d:%d:%d %d:%d:%d %d:%d:%d ", + red.offset, red.length, red.msb_right, green.offset, + green.length, green.msb_right, blue.offset, blue.length, + blue.msb_right, transp.offset, transp.length, transp.msb_right ); + + if( IsGrayscale() ) + printf( "grayscale " ); + + if( IsNonStd() ) + printf( "nonstd %d ", nonstd ); + + printf( "}\n" ); } void FormatNode::Dump(bool in_list) const
lib/framebuffer.C +2 -2
@@ -164,7 +164,7 @@ } } -void ColorMap::Print(const char *indent = "") const +void ColorMap::Print(const char *indent) const { printf("start = %d\n", start); printf("len = %d\n", len);
@@ -191,7 +191,7 @@ Die("ioctl FBIOPUT_CON2FBMAP: %s\n", strerror(errno)); } -void Con2FBMap::Print(const char *indent = "") const +void Con2FBMap::Print(const char *indent) const { printf("%sconsole %d -> fb %d\n", indent, console, framebuffer); }
lib/list.C +2 -0
@@ -1,4 +1,6 @@ +#include <string.h> + #include "list.h" #include "util.h"
lib/util.C +2 -1
@@ -5,6 +5,7 @@ #include <stdio.h> #include <string.h> #include <unistd.h> +#include <stdlib.h> #include <sys/ioctl.h> #include "util.h"
@@ -43,7 +44,7 @@ // Command Line Parameter Processing -int GetNextOption(int &argc, const char **&argv, +int GetNextOption(int &argc, char **&argv, const struct option options[], const u_int num_options) { static bool first = true;
Am Montag, 22. Dezember 2003 02:32 schrieb John Zielinski:
Quoted 4 lines
Here's a patch to get fbutils from the CVS working if anyone else wants to play around with them.
John
Have you ./configure for it ? I'm wonder, that this package does not have classic build system.
Regards Alex
P.S. You spoked also about program named "fbtest". Where I can find it? I have implement accelerated imageblt for mach64. It works good for boot logo and console.
"make menuconfig" works also good, but "mc" completely sucks.
-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
Quoted 3 lines · Alexander Kern
Am Montag, 22. Dezember 2003 02:32 schrieb John Zielinski:
Quoted 2 lines
Here's a patch to get fbutils from the CVS working if anyone else wants to play around with them.
Thanks John!
Quoted 3 lines
Quoted 1 line
John
Have you ./configure for it ? I'm wonder, that this package does not have classic build system.
I started fbutils in 1999, but I never finished it.
In fact I never thought anyone would finish it ;-)
Quoted 1 line
P.S. You spoked also about program named "fbtest". Where I can find it?
CVS module fbtest in linux-fbdev CVS at SourceForge, next to fbutils.
Quoted 2 lines
I have implement accelerated imageblt for mach64. It works good for boot logo and console.
Nice!
Quoted 1 line
"make menuconfig" works also good, but "mc" completely sucks.
That may be a generic fbcon bug...
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
Quoted 6 lines · Geert Uytterhoeven
Quoted 3 lines · Alexander Kern
Am Montag, 22. Dezember 2003 02:32 schrieb John Zielinski:
Quoted 10 lines
Quoted 4 lines
Quoted 4 lines
Here's a patch to get fbutils from the CVS working if anyone else wants to play around with them.
Thanks John!
No problem.
Quoted 6 lines
I started fbutils in 1999, but I never finished it.
In fact I never thought anyone would finish it ;-)
It was either that or keep rebooting every time I wanted to play with some video mode settings. :)
That patch basically got it to the functional stage. The command line options work and all sections of the database file can now be used. Changing resolutions doesn't quite work because of some kernel bugs I mentioned before and having a different resolution on each virtual terminal is also broken in the kernel. With a working fbset I can look into these bugs now.
Hopefully by tonight I'll have another patch ready with the rest of the changes I've made to fbutils. I've made the help text match the actual command line arguments and I'm getting the last of them to work. After that patch we can put it in the finished category.
John
-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
Quoted 5 lines · Alexander Kern
Have you ./configure for it ? I'm wonder, that this package does not have classic build system.
Unfortunately no. My cross platform skills are serverly lacking.
Quoted 4 lines
P.S. You spoked also about program named "fbtest". Where I can find it?
I got it from the source forge CVS and I posted a minor patch for it on the list.
John
-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
I didn't get as much done as I've hoped but there's a few important fixes so I'll repost early. Apply to a fresh CVS copy.
John
con2fbmap/con2fbmap.C +1 -0
@@ -13,6 +13,7 @@ bool Opt_version = false; bool Opt_verbose = false; +bool Opt_quiet = false; const char *Opt_debug = NULL; const char *Opt_fb = DEFAULT_FRAMEBUFFER; const char *Opt_console = NULL;
etc/modes +23 -23
80 lines not on this page · raw message
fbcmap/fbcmap.C +1 -0
@@ -16,6 +16,7 @@ bool Opt_version = false; bool Opt_verbose = false; +bool Opt_quiet = false; const char *Opt_debug = NULL; const char *Opt_fb = DEFAULT_FRAMEBUFFER; const char *Opt_length = NULL;
fbconvert/fbconvert.C +4 -10
@@ -27,9 +27,9 @@ extern int y2parse(void); -static bool Opt_version = false; -static bool Opt_verbose = false; -static bool Opt_quiet = false; +bool Opt_version = false; +bool Opt_verbose = false; +bool Opt_quiet = false; static const char *Opt_debug = NULL; const char *Opt_modedb = NULL;
@@ -50,18 +50,12 @@ static void Usage(void) { puts(VERSION); - Die("\nUsage: %s [options] [mode]\n\n" + Die("\nUsage: %s [options] modedb\n\n" "Valid options:\n" " General options:\n" " -h, --help : display this usage information\n" - " --test : don't change, just test whether the mode is " - "valid\n" - " -s, --show : display video mode settings\n" - " -i, --info : display all frame buffer information\n" " -v, --verbose : verbose mode\n" " -V, --version : print version information\n" - " -x, --xfree86 : XFree86 compatibility mode\n" - " -a, --all : change all virtual consoles on this device\n" "n", ProgramName); }
fbconvert/modes.y +1 -1
@@ -108,7 +108,7 @@ virtual_.xres_virtual = vmode->vxres; virtual_.yres_virtual = vmode->vyres; - Videomode *node = new Videomode(vmode->name, geometry, format, &virtual_); + Videomode *node = new Videomode(vmode->name, geometry, format, virtual_); node->accel_flags = vmode->accel_flags; Videomodes.Add(node); }
fbset/fbset.C +119 -93
289 lines not on this page · raw message
include/database.h +112 -3
179 lines not on this page · raw message
include/list.h +4 -0
@@ -48,6 +48,10 @@return Pred->Pred ? Pred : (Node *)NULL ; } +inline const char *Node::GetName(void) const +{ +return Name; +}// List Header
include/util.h +2 -1
@@ -14,13 +14,14 @@extern const char *ProgramName; +extern bool Opt_quiet;// Function Prototypes extern void Die (const char *fmt,...) __attribute__((noreturn));extern void Warn (const char *fmt,...); -extern int GetNextOption(int &argc, const char **&argv, +extern int GetNextOption(int &argc, char **&argv,const struct option options[],const u_int num_options);
lib/config.l +10 -8
@@ -34,18 +34,16 @@ { "geometry", GEOMETRY, 0 }, { "format", FORMAT, 0 }, { "mode", MODE, 0 }, - { "hsync", HSYNC, 0 }, - { "vsync", VSYNC, 0 }, - { "csync", CSYNC, 0 }, + { "hsync+", HSYNCP, 0 }, + { "vsync+", VSYNCP, 0 }, + { "csync+", CSYNCP, 0 }, { "gsync", GSYNC, 0 }, { "extsync", EXTSYNC, 0 }, { "broadcast", BCAST, 0 }, { "interlace", LACED, 0 }, { "doublescan", DOUBLE, 0 }, - { "low", POLARITY, 0 }, - { "high", POLARITY, 1 }, - { "false", BOOL, 0 }, - { "true", BOOL, 1 }, + { "virtual", VIRTUAL, 0 }, + { "accel", ACCEL, 0 }, { "", -1, 0 } };
@@ -110,7 +108,7 @@ %} -keyword [a-zA-Z][a-zA-Z0-9]* +keyword [a-zA-Z][a-zA-Z0-9\+]* int [0-9]* string \"[^\"\n]*\" comment \#([^\n]*)
@@ -149,6 +147,10 @@ \} { return CLOSEB; } + +\: { + return COLON; + } {junk} { yyerror("Invalid token `%s'\n", yytext);
lib/config.y +96 -33
243 lines not on this page · raw message
lib/database.C +123 -16
194 lines not on this page · raw message
lib/framebuffer.C +2 -2
@@ -164,7 +164,7 @@ } } -void ColorMap::Print(const char *indent = "") const +void ColorMap::Print(const char *indent) const { printf("start = %d\n", start); printf("len = %d\n", len);
@@ -191,7 +191,7 @@ Die("ioctl FBIOPUT_CON2FBMAP: %s\n", strerror(errno)); } -void Con2FBMap::Print(const char *indent = "") const +void Con2FBMap::Print(const char *indent) const { printf("%sconsole %d -> fb %d\n", indent, console, framebuffer); }
lib/list.C +2 -0
@@ -1,4 +1,6 @@ +#include <string.h> + #include "list.h" #include "util.h"
lib/util.C +13 -9
@@ -5,6 +5,7 @@ #include <stdio.h> #include <string.h> #include <unistd.h> +#include <stdlib.h> #include <sys/ioctl.h> #include "util.h"
@@ -19,11 +20,12 @@ { va_list ap; - fflush(stdout); - va_start(ap, fmt); - vfprintf(stderr, fmt, ap); - va_end(ap); - + if (!Opt_quiet) { + fflush(stdout); + va_start(ap, fmt); + vfprintf(stderr, fmt, ap); + va_end(ap); + } exit(1); }
@@ -34,16 +36,18 @@ { va_list ap; - fflush(stdout); - va_start(ap, fmt); - vfprintf(stderr, fmt, ap); + if (!Opt_quiet) { + fflush(stdout); + va_start(ap, fmt); + vfprintf(stderr, fmt, ap); + } va_end(ap); } // Command Line Parameter Processing -int GetNextOption(int &argc, const char **&argv, +int GetNextOption(int &argc, char **&argv, const struct option options[], const u_int num_options) { static bool first = true;
Quoted 2 lines · John Zielinski
I didn't get as much done as I've hoped but there's a few important fixes so I'll repost early. Apply to a fresh CVS copy.
Thanks!
I need these patches to:
- accept the included etc/modes as a valid config file
- kill a warning
If these are OK, I'll check everything in (someday :-)
etc/modes +1 -1
@@ -14,7 +14,7 @@ "640x480@75" # 640x480 @ 75 Hz, 37.50 kHz hsync { 640 480 31746 120 16 16 1 64 3 } "800x600@60" # 800x600 @ 60 Hz, 37.8 kHz hsync - { 800 600 25000 88 40 23 1 128 4 0 hsync+ vsync+ } + { 800 600 25000 88 40 23 1 128 4 hsync+ vsync+ } "640x480@85" # 640x480 @ 85 Hz, 43.27 kHz hsync { 640 480 27777 80 56 25 1 56 3 } "1152x864@89" # 1152x864 @ 89 Hz interlaced, 44 kHz hsync
fbset/fbset.C +2 -2
@@ -259,8 +259,8 @@ // Parse the Options - while (id = GetNextOption(argc, argv, Options, - sizeof(Options)/sizeof(*Options))) { + while ((id = GetNextOption(argc, argv, Options, + sizeof(Options)/sizeof(*Options)))) { switch (id) { case ID_HELP: Usage();
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
etc/modes line 20
Quoted 13 lines · Geert Uytterhoeven
etc/modes +1
-1@@ -14,7 +14,7 @@ "640x480@75" # 640x480 @ 75 Hz, 37.50 kHz hsync { 640 480 31746 120 16 16 1 64 3 } "800x600@60" # 800x600 @ 60 Hz, 37.8 kHz hsync - { 800 600 25000 88 40 23 1 128 4 0 hsync+ vsync+ } + { 800 600 25000 88 40 23 1 128 4 hsync+ vsync+ } "640x480@85" # 640x480 @ 85 Hz, 43.27 kHz hsync { 640 480 27777 80 56 25 1 56 3 } "1152x864@89" # 1152x864 @ 89 Hz interlaced, 44 kHz hsync
Woops. I changed that in my /etc/fb/modes file but forgot to update the one in the source package.
Quoted 6 lines
fbset/fbset.C line 266
Quoted 10 lines
fbset/fbset.C +2
-2@@ -259,8 +259,8 @@ // Parse the Options - while (id = GetNextOption(argc, argv, Options, - sizeof(Options)/sizeof(*Options))) { + while ((id = GetNextOption(argc, argv, Options, + sizeof(Options)/sizeof(*Options)))) { switch (id) { case ID_HELP: Usage();
Already cought that one. Don't know why I changed it in the first place. That must have been a late night session or something. :)
I still have a couple of command line options that need finishing. I'll have another updated patch with those in the next few days. I've been extremely busy lately: holidays, email server dying, Prince of Persia....
John
-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software. Perforce is the Fast Software Configuration Management System offering advanced branching capabilities and atomic changes on 50+ platforms. Free Eval! http://www.perforce.com/perforce/loadprog.html