summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa/pcvt
diff options
context:
space:
mode:
authorhm <hm@FreeBSD.org>2000-03-31 08:28:18 +0000
committerhm <hm@FreeBSD.org>2000-03-31 08:28:18 +0000
commitbe60391fa67d156544b9a6edccc441ba6163b29b (patch)
treeaab96fc1a659cd9bd2a4bc1a6ca4e97ca2c892dd /sys/i386/isa/pcvt
parent7c2c4384983ed7f9dd8cc3b0a2e79a2930206a24 (diff)
downloadFreeBSD-src-be60391fa67d156544b9a6edccc441ba6163b29b.zip
FreeBSD-src-be60391fa67d156544b9a6edccc441ba6163b29b.tar.gz
PR: kern/2327
Submitted by: Brian Campbell (brianc@netrover.com) Add a "green" saver mode to pcvt.
Diffstat (limited to 'sys/i386/isa/pcvt')
-rw-r--r--sys/i386/isa/pcvt/pcvt_conf.h9
-rw-r--r--sys/i386/isa/pcvt/pcvt_sup.c45
2 files changed, 52 insertions, 2 deletions
diff --git a/sys/i386/isa/pcvt/pcvt_conf.h b/sys/i386/isa/pcvt/pcvt_conf.h
index 2e5bffe..9cdd555 100644
--- a/sys/i386/isa/pcvt/pcvt_conf.h
+++ b/sys/i386/isa/pcvt/pcvt_conf.h
@@ -39,7 +39,7 @@
* pcvt_conf.h VT220 driver global configuration file
* ------------------------------------------------------
*
- * Last Edit-Date: [Sun Mar 26 10:38:19 2000]
+ * Last Edit-Date: [Fri Mar 31 10:20:27 2000]
*
* $FreeBSD$
*
@@ -79,6 +79,13 @@
/* which turns off the display if its */
/* black !!!!!! */
+#if !defined PCVT_GREENSAVER /* ---------- DEFAULT: OFF ------------ */
+# define PCVT_GREENSAVER 0 /* screensaver mode that enables */
+#elif PCVT_GREENSAVER != 0 /* power-save mode */
+# undef PCVT_GREENSAVER
+# define PCVT_GREENSAVER 1
+#endif
+
#if !defined PCVT_CTRL_ALT_DEL /* ---------- DEFAULT: OFF ------------ */
# define PCVT_CTRL_ALT_DEL 0 /* this enables the execution of a cpu */
#elif PCVT_CTRL_ALT_DEL != 0 /* reset by pressing the CTRL, ALT and */
diff --git a/sys/i386/isa/pcvt/pcvt_sup.c b/sys/i386/isa/pcvt/pcvt_sup.c
index e966413..1a420d5 100644
--- a/sys/i386/isa/pcvt/pcvt_sup.c
+++ b/sys/i386/isa/pcvt/pcvt_sup.c
@@ -44,7 +44,7 @@
* pcvt_sup.c VT220 Driver Support Routines
* ---------------------------------------------
*
- * Last Edit-Date: [Mon Mar 27 16:11:33 2000]
+ * Last Edit-Date: [Fri Mar 31 10:23:04 2000]
*
* $FreeBSD$
*
@@ -310,6 +310,10 @@ vgapcvtinfo(struct pcvtinfo *data)
#if PCVT_NO_LED_UPDATE
| CONF_NO_LED_UPDATE
#endif
+#if PCVT_GREENSAVER
+ | CONF_GREENSAVER
+#endif
+
);
}
@@ -1790,6 +1794,38 @@ pcvt_set_scrnsv_tmo(int timeout)
}
}
+#if PCVT_GREENSAVER
+#define TSIDX IO_VGA+0x04 /* timing sequencer idx */
+#define TSREG IO_VGA+0x05 /* timing sequencer data */
+
+static void
+green_saver(int blank)
+{
+ u_char val;
+
+ if (blank)
+ {
+ outb(TSIDX, 0x01);
+ val = inb(TSREG);
+ outb(TSIDX, 0x01);
+ outb(TSREG, val | 0x20);
+ outb(addr_6845, 0x17);
+ val = inb(addr_6845 + 1);
+ outb(addr_6845 + 1, val & ~0x80);
+ }
+ else
+ {
+ outb(TSIDX, 0x01);
+ val = inb(TSREG);
+ outb(TSIDX, 0x01);
+ outb(TSREG, val & 0xDF);
+ outb(addr_6845, 0x17);
+ val = inb(addr_6845 + 1);
+ outb(addr_6845 + 1, val | 0x80);
+ }
+}
+#endif
+
/*---------------------------------------------------------------------------*
* we were timed out
*---------------------------------------------------------------------------*/
@@ -1868,6 +1904,10 @@ scrnsv_timedout(void *arg)
#endif /* PCVT_PRETTYSCRNS */
sw_cursor(0); /* cursor off on mda/cga */
+
+#if PCVT_GREENSAVER
+ green_saver(1);
+#endif
}
splx(x);
}
@@ -1912,6 +1952,9 @@ pcvt_scrnsv_reset(void)
vgapaletteio(7 /* LIGHTGRAY */, &vsp->palette[7], 1);
#endif /* PCVT_PRETTYSCRNS */
+#if PCVT_GREENSAVER
+ green_saver(0);
+#endif
}
scrnsv_active = 0;
OpenPOWER on IntegriCloud