Hi, i have the following in my queue. This updates the code to the vbetool 0.6 codebase. There is nothing in there which should actually make any difference to s2ram, but it might reduce the "you don't even use the latest vbetool code!!!1! no wonder this does not work!!!1!" mails i get :-)
Index: vbetool/Makefile.am =================================================================== RCS file: /cvsroot/suspend/suspend/vbetool/Makefile.am,v retrieving revision 1.1 diff -u -p -r1.1 Makefile.am --- vbetool/Makefile.am 20 Feb 2006 18:01:22 -0000 1.1 +++ vbetool/Makefile.am 18 Jul 2006 10:50:21 -0000 @@ -6,10 +6,11 @@ SUBDIRS = x86emu if WITH_X86EMU x86 = thunk.c x86-common.c -vbetool_LDADD = x86emu/libx86emu.a +vbetool_LDADD = x86emu/libx86emu.a /usr/lib/libpci.a else x86 = lrmi.c x86-common.c x86lib = "" +vbetool_LDADD = /usr/lib/libpci.a endif man_MANS = vbetool.1 @@ -22,4 +23,4 @@ maintainer-clean-local: $(RM) Makefile.in aclocal.m4 config.h.in stamp-h.in configure AM_CFLAGS = -g -Wall -pedantic -std=gnu99 -AM_LDFLAGS = -lpci +AM_LDFLAGS = Index: vbetool/vbetool.1 =================================================================== RCS file: /cvsroot/suspend/suspend/vbetool/vbetool.1,v retrieving revision 1.1 diff -u -p -r1.1 vbetool.1 --- vbetool/vbetool.1 20 Feb 2006 17:06:48 -0000 1.1 +++ vbetool/vbetool.1 18 Jul 2006 10:50:21 -0000 @@ -3,7 +3,7 @@ vbetool - run real-mode video BIOS code to alter hardware state .SH SYNOPSIS -.B "vbetool [[vbestate save|restore]|[vbemode set|get]|[vgamode]|[dpms on|off|standby|suspend|reduced]|[post]|[vbestate on|off]]" +.B "vbetool [[vbestate save|restore]|[vbemode set|get]|[vgamode]|[dpms on|off|standby|suspend|reduced]|[post]|[vgastate on|off]|[vbefp panelid|panelsize|getbrightness|setbrightness|invert]]" .SH DESCRIPTION .B vbetool @@ -54,6 +54,20 @@ will enable or disable the current video will cause the hardware to stop responding until it is reenabled. You probably don't want to do this if you're using a framebuffer. +.IP "vbefp" +.B vbetool +will execute a VESA flat panel interface call. +.IP +panelid will provide information about the panel +.IP +panelsize will provide the size of the panel +.IP +getbrightness will provide the current screen brightness as an integer +.IP +setbrightness accepts an integer as an argument and will set the screen brightness to that +.IP +invert will invert the colours of the screen + .SH BUGS Switching dpms modes may interact badly with X on some systems. .PP @@ -66,6 +80,10 @@ used to be. The VESA specification does not require that "vbemode get" provides the correct mode if the current mode was set via some means other than the VESA BIOS extensions. +.PP +The VESA flat panel interface ceased development at the proposal stage. +panelid and panelsize will work on many machines, but the other arguments are +unlikely to be implemented on available hardware. .SH AUTHOR vbetool was written by Matthew Garrett <[EMAIL PROTECTED]>, based on Index: vbetool/vbetool.c =================================================================== RCS file: /cvsroot/suspend/suspend/vbetool/vbetool.c,v retrieving revision 1.4 diff -u -p -r1.4 vbetool.c --- vbetool/vbetool.c 26 Mar 2006 21:24:26 -0000 1.4 +++ vbetool/vbetool.c 18 Jul 2006 10:50:21 -0000 @@ -39,7 +39,7 @@ static struct pci_access *pacc; void vbetool_init(void) { if (!LRMI_init()) { - fprintf(stderr, "Failed to initialise LRMI.\n"); + fprintf(stderr, "Failed to initialise LRMI (Linux Real-Mode Interface).\n"); exit(1); } @@ -54,10 +54,10 @@ void vbetool_init(void) #ifndef S2RAM int main(int argc, char *argv[]) { - vbetool_init(); - if (argc < 2) { + if (argc < 2) goto usage; - } else if (!strcmp(argv[1], "vbestate")) { + vbetool_init(); + if (!strcmp(argv[1], "vbestate")) { /* VBE save/restore tends to break when done underneath X */ int err = check_console(); @@ -116,10 +116,24 @@ int main(int argc, char *argv[]) } else { return disable_vga(); } + } else if (!strcmp(argv[1], "vbefp")) { + if (!strcmp(argv[2], "id")) { + return do_get_panel_id(0); + } else if (!strcmp(argv[2], "panelsize")) { + return do_get_panel_id(1); + } else if (!strcmp(argv[2], "getbrightness")) { + return do_get_panel_brightness(); + } else if (!strcmp(argv[2], "setbrightness")) { + return do_set_panel_brightness(atoi(argv[3])); + } else if (!strcmp(argv[2], "invert")) { + return do_invert_panel(); + } else { + return 1; + } } else { usage: fprintf(stderr, - "%s: Usage %s [[vbestate save|restore]|[vbemode set|get]|[vgamode]|[dpms on|off|standby|suspend|reduced]|[post]|[vgastate on|off]]\n", + "%s: Usage %s [[vbestate save|restore]|[vbemode set|get]|[vgamode]|[dpms on|off|standby|suspend|reduced]|[post]|[vgastate on|off]|[vbefp panelid|panelsize|getbrightness|setbrightness|invert]]\n", argv[0], argv[0]); return 1; } @@ -149,10 +163,15 @@ int do_vbe_service(unsigned int AX, unsi function_sup = ((AX & 0xff) == 0x4f); success = ((AX & 0xff00) == 0); - if (!success) + if (!success) { + fprintf(stderr, "Real mode call failed\n"); return -2; - if (!function_sup) + } + + if (!function_sup) { + fprintf(stderr, "Function not supported\n"); return -3; + } return access_ptr_register(regs, ebx); } Index: vbetool/vbetool.h =================================================================== RCS file: /cvsroot/suspend/suspend/vbetool/vbetool.h,v retrieving revision 1.2 diff -u -p -r1.2 vbetool.h --- vbetool/vbetool.h 7 Mar 2006 23:54:21 -0000 1.2 +++ vbetool/vbetool.h 18 Jul 2006 10:50:21 -0000 @@ -5,6 +5,9 @@ int do_real_post(unsigned pci_device); int do_blank(int state); int do_set_mode (int mode, int vga); int do_get_mode(void); +int do_get_panel_brightness(void); +int do_set_panel_brightness(int brightness); +int do_invert_panel(void); int do_post(void); void restore_state(void); void save_state(void); @@ -12,6 +15,7 @@ void text_mode(void); int check_console(void); int enable_vga(void); int disable_vga(void); +int do_get_panel_id(); void vbetool_init(void); char *__save_state(int *); void restore_state_from(char *); -- Stefan Seyfried | "Please, just tell people QA / R&D Team Mobile Devices | to use KDE." SUSE LINUX Products GmbH, Nürnberg | -- Linus Torvalds ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Suspend-devel mailing list Suspend-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/suspend-devel