*** /usr/homes/nicholas/src/linux62/config.in Tue Nov 8 16:04:08 1994 --- /usr/homes/nicholas/src/linux/config.in Tue Nov 8 16:50:17 1994 *************** *** 5,10 **** --- 5,15 ---- comment 'General setup' + + bool 'VESA Power Saving Protocol Support' CONFIG_VESA_PSPM y + if [ "$CONFIG_VESA_PSPM" = "y" ]; then + bool 'VESA PSPM Force Off' CONFIG_PSPM_FORCE_OFF n + fi bool 'Kernel math emulation' CONFIG_MATH_EMULATION n bool 'Normal harddisk support' CONFIG_BLK_DEV_HD y bool 'XT harddisk support' CONFIG_BLK_DEV_XD n *************** *** 12,18 **** --- 17,26 ---- bool 'Limit memory to low 16MB' CONFIG_MAX_16M n bool 'System V IPC' CONFIG_SYSVIPC y bool 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF y + bool 'Use -mpentium flag for Pentium-specific optimizations' CONFIG_M586 n + if [ "$CONFIG_M586" = "n" ]; then bool 'Use -m486 flag for 486-specific optimizations' CONFIG_M486 y + fi if [ "$CONFIG_NET" = "y" ]; then comment 'Networking options' *** /usr/homes/nicholas/src/linux62/drivers/char/console.c Tue Nov 8 15:56:38 1994 --- /usr/homes/nicholas/src/linux/drivers/char/console.c Tue Nov 8 16:40:04 1994 *************** *** 159,165 **** --- 159,167 ---- static int console_blanked = 0; static int blankinterval = 10*60*HZ; + #ifndef CONFIG_VESA_PSPM static long blank_origin, blank__origin, unblank_origin; + #endif struct vc_data { unsigned long vc_screenbuf_size; *************** *** 287,292 **** --- 289,447 ---- #define vcmode (vt_cons[currcons]->vc_mode) #define structsize (sizeof(struct vc_data) + sizeof(struct vt_struct)) + #ifdef CONFIG_VESA_PSPM + /* + * This section(s) handles the VESA Power Saving Protocol that let a * + * monitor be powered down whenever not needed for a longer time. * + * VESA protocol defines: * + * * + * Mode/Status HSync VSync Video * + * ---------------------------------------------- * + * "On" on on active * + * "Suspend" {either} on off blank * + * { or } off on blank * + * "Off" off off blank << PSPM_FORCE_OFF * + * * + * Original code taken from the Power Management Utility (PMU) of * + * Huang shi chao, delivered together with many new monitor models * + * capable of the VESA Power Saving Protocol. * + * Adapted to Linux by Christoph Rimek (chrimek@toppoint.de) 15-may-94 * + * Patched to 1.1.57 by Nicholas Leon (nicholas@neko.binary9.com) 10/94 * + * (with minor reorganization) * + */ + + + static void vesa_blank(void); + static void vesa_unblank(void); + + #define seq_port_reg (0x3c4) /* Sequencer register select port */ + #define seq_port_val (0x3c5) /* Sequencer register value port */ + #define video_misc_rd (0x3cc) /* Video misc. read port */ + #define video_misc_wr (0x3c2) /* Video misc. write port */ + + /* structure holding original VGA register settings */ + static struct { + unsigned char SeqCtrlIndex; /* Sequencer Index reg. */ + unsigned char CrtCtrlIndex; /* CRT-Contr. Index reg. */ + unsigned char CrtMiscIO; /* Miscellaneous register */ + #ifdef CONFIG_PSPM_FORCE_OFF + unsigned char HorizontalTotal; /* CRT-Controller:00h */ + unsigned char HorizDisplayEnd; /* CRT-Controller:01h */ + unsigned char StartHorizRetrace; /* CRT-Controller:04h */ + unsigned char EndHorizRetrace; /* CRT-Controller:05h */ + #endif + unsigned char Overflow; /* CRT-Controller:07h */ + unsigned char StartVertRetrace; /* CRT-Controller:10h */ + unsigned char EndVertRetrace; /* CRT-Controller:11h */ + unsigned char ModeControl; /* CRT-Controller:17h */ + unsigned char ClockingMode; /* Seq-Controller:01h */ + } vga; + + /* routine to blank a vesa screen */ + static void vesa_blank(void) + { + /* save original values of VGA controller registers */ + cli(); + vga.SeqCtrlIndex = inb_p(seq_port_reg); + vga.CrtCtrlIndex = inb_p(video_port_reg); + vga.CrtMiscIO = inb_p(video_misc_rd); + sti(); + #ifdef CONFIG_PSPM_FORCE_OFF + outb_p(0x00,video_port_reg); /* HorizontalTotal */ + vga.HorizontalTotal = inb_p(video_port_val); + outb_p(0x01,video_port_reg); /* HorizDisplayEnd */ + vga.HorizDisplayEnd = inb_p(video_port_val); + outb_p(0x04,video_port_reg); /* StartHorizRetrace */ + vga.StartHorizRetrace = inb_p(video_port_val); + outb_p(0x05,video_port_reg); /* EndHorizRetrace */ + vga.EndHorizRetrace = inb_p(video_port_val); + #endif + outb_p(0x07,video_port_reg); /* Overflow */ + vga.Overflow = inb_p(video_port_val); + outb_p(0x10,video_port_reg); /* StartVertRetrace */ + vga.StartVertRetrace = inb_p(video_port_val); + outb_p(0x11,video_port_reg); /* EndVertRetrace */ + vga.EndVertRetrace = inb_p(video_port_val); + outb_p(0x17,video_port_reg); /* ModeControl */ + vga.ModeControl = inb_p(video_port_val); + outb_p(0x01,seq_port_reg); /* ClockingMode */ + vga.ClockingMode = inb_p(seq_port_val); + + /* assure that video is enabled */ + /* "0x20" is VIDEO_ENABLE_bit in register 01 of sequencer */ + cli(); + outb_p(0x01,seq_port_reg); + outb_p(vga.ClockingMode | 0x20,seq_port_val); + + /* sti(); + cli(); */ + + /* test for vertical retrace in process.... */ + if ((vga.CrtMiscIO & 0x80) == 0x80) + outb_p(vga.CrtMiscIO & 0xef,video_misc_wr); + + /* Set to minimum (0) and * + * to maximum (incl. overflow) * + * Result: turn off vertical sync (VSync) pulse */ + outb_p(0x10,video_port_reg); /* StartVertRetrace */ + outb_p(0xff,video_port_val); /* maximum value */ + outb_p(0x11,video_port_reg); /* EndVertRetrace */ + outb_p(0x40,video_port_val); /* minimum (bits 0..3) */ + outb_p(0x07,video_port_reg); /* Overflow */ + outb_p(vga.Overflow | 0x84,video_port_val); /* bits 9,10 of */ + /* vert. retrace */ + #ifdef CONFIG_PSPM_FORCE_OFF + /* Set to minimum (0) and * + * to maximum * + * Result: turn off horizontal sync (HSync) pulse */ + outb_p(0x04,video_port_reg); /* StartHorizRetrace */ + outb_p(0xff,video_port_val); /* maximum */ + outb_p(0x05,video_port_reg); /* EndHorizRetrace */ + outb_p(0x00,video_port_val); /* minimum (0) */ + #endif + /* restore both index registers */ + outb_p(vga.SeqCtrlIndex,seq_port_reg); + outb_p(vga.CrtCtrlIndex,video_port_reg); + sti(); + + } + + /* routine to unblank a vesa screen */ + static void vesa_unblank(void) + { + /* restore original values of VGA controller registers */ + cli(); + outb_p(vga.CrtMiscIO,video_misc_wr); + #ifdef CONFIG_PSPM_FORCE_OFF + outb_p(0x00,video_port_reg); /* HorizontalTotal */ + outb_p(vga.HorizontalTotal,video_port_val); + outb_p(0x01,video_port_reg); /* HorizDisplayEnd */ + outb_p(vga.HorizDisplayEnd,video_port_val); + outb_p(0x04,video_port_reg); /* StartHorizRetrace */ + outb_p(vga.StartHorizRetrace,video_port_val); + outb_p(0x05,video_port_reg); /* EndHorizRetrace */ + outb_p(vga.EndHorizRetrace,video_port_val); + #endif + outb_p(0x07,video_port_reg); /* Overflow */ + outb_p(vga.Overflow,video_port_val); + outb_p(0x10,video_port_reg); /* StartVertRetrace */ + outb_p(vga.StartVertRetrace,video_port_val); + outb_p(0x11,video_port_reg); /* EndVertRetrace */ + outb_p(vga.EndVertRetrace,video_port_val); + outb_p(0x17,video_port_reg); /* ModeControl */ + outb_p(vga.ModeControl,video_port_val); + outb_p(0x01,seq_port_reg); /* ClockingMode */ + outb_p(vga.ClockingMode,seq_port_val); + + /* restore index/control registers */ + outb_p(vga.SeqCtrlIndex,seq_port_reg); + outb_p(vga.CrtCtrlIndex,video_port_reg); + sti(); + } + + #endif /* CONFIG_VESA_PSPM */ + + static void * memsetw(void * s, unsigned short c, unsigned int count) { __asm__("cld\n\t" *************** *** 2025,2031 **** --- 2180,2188 ---- void blank_screen(void) { + #ifndef CONFIG_VESA_PSPM int currcons; + #endif if (console_blanked) return; *************** *** 2036,2041 **** --- 2193,2201 ---- } timer_table[BLANK_TIMER].fn = unblank_screen; + #ifdef CONFIG_VESA_PSPM + vesa_blank(); + #else /* try not to lose information by blanking, and not to waste memory */ currcons = fg_console; has_scrolled = 0; *************** *** 2046,2059 **** --- 2206,2222 ---- unblank_origin = origin; memsetw((void *)blank_origin, BLANK, video_mem_term-blank_origin); hide_cursor(); + #endif console_blanked = fg_console + 1; } void unblank_screen(void) { int currcons; + #ifndef CONFIG_VESA_PSPM int resetorg; long offset; + #endif if (!console_blanked) return; *************** *** 2068,2073 **** --- 2231,2240 ---- timer_active |= 1<