summaryrefslogtreecommitdiffstats
path: root/sys/dev/syscons/blank
diff options
context:
space:
mode:
authoryokota <yokota@FreeBSD.org>1997-10-04 04:24:18 +0000
committeryokota <yokota@FreeBSD.org>1997-10-04 04:24:18 +0000
commitd26bc9bf8e3c7261deac2260a4d95f056b786eb2 (patch)
tree6ea10efd986e3f36789dcd399bab62c3212f415b /sys/dev/syscons/blank
parent1d704478e47ba414979ce4f1e15b18075567e99a (diff)
downloadFreeBSD-src-d26bc9bf8e3c7261deac2260a4d95f056b786eb2.zip
FreeBSD-src-d26bc9bf8e3c7261deac2260a4d95f056b786eb2.tar.gz
Make the blank screen saver work with MDA and CGA. The fade and green
savers are also modified so that they behave in the same way as the blank saver on MDA and CGA, although it's not the way these screen savers are supposed to work, but fading monitor and tickling green monitor cannot be done on MDA and CGA, AFAIK. So, this is the second best solution. As of this change, the current state of support of screen savers is summarized in the following table. MDA CGA EGA VGA blank OK OK NA OK daemon OK OK OK OK fade * * NA OK green * * NA OK snake OK OK OK OK star OK OK OK OK OK: works NA: doesn't work, the module cannot be loaded for this adapter. *: behave the same way as the blank saver. As you can see, EGA is left out for now. But, we can do no better, as EGA registers cannot be read... Reviewed by: sos
Diffstat (limited to 'sys/dev/syscons/blank')
-rw-r--r--sys/dev/syscons/blank/blank_saver.c55
1 files changed, 48 insertions, 7 deletions
diff --git a/sys/dev/syscons/blank/blank_saver.c b/sys/dev/syscons/blank/blank_saver.c
index a534ab3..451dc9a 100644
--- a/sys/dev/syscons/blank/blank_saver.c
+++ b/sys/dev/syscons/blank/blank_saver.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: blank_saver.c,v 1.9 1997/04/06 10:48:10 dufault Exp $
+ * $Id: blank_saver.c,v 1.10 1997/07/15 14:49:09 yokota Exp $
*/
#include <sys/param.h>
@@ -46,12 +46,44 @@ blank_saver(int blank)
u_char val;
if (blank) {
scrn_blanked = 1;
- outb(TSIDX, 0x01); val = inb(TSREG);
- outb(TSIDX, 0x01); outb(TSREG, val | 0x20);
+ switch (crtc_type) {
+ case KD_VGA:
+ outb(TSIDX, 0x01); val = inb(TSREG);
+ outb(TSIDX, 0x01); outb(TSREG, val | 0x20);
+ break;
+ case KD_EGA:
+ /* not yet done XXX */
+ break;
+ case KD_CGA:
+ outb(crtc_addr + 4, 0x25);
+ break;
+ case KD_MONO:
+ case KD_HERCULES:
+ outb(crtc_addr + 4, 0x21);
+ break;
+ default:
+ break;
+ }
}
else {
- outb(TSIDX, 0x01); val = inb(TSREG);
- outb(TSIDX, 0x01); outb(TSREG, val & 0xDF);
+ switch (crtc_type) {
+ case KD_VGA:
+ outb(TSIDX, 0x01); val = inb(TSREG);
+ outb(TSIDX, 0x01); outb(TSREG, val & 0xDF);
+ break;
+ case KD_EGA:
+ /* not yet done XXX */
+ break;
+ case KD_CGA:
+ outb(crtc_addr + 4, 0x2d);
+ break;
+ case KD_MONO:
+ case KD_HERCULES:
+ outb(crtc_addr + 4, 0x29);
+ break;
+ default:
+ break;
+ }
scrn_blanked = 0;
}
}
@@ -59,8 +91,17 @@ blank_saver(int blank)
static int
blank_saver_load(struct lkm_table *lkmtp, int cmd)
{
- if (!crtc_vga)
- return EINVAL;
+ switch (crtc_type) {
+ case KD_MONO:
+ case KD_HERCULES:
+ case KD_CGA:
+ case KD_VGA:
+ break;
+ case KD_EGA:
+ /* EGA is yet to be supported */
+ default:
+ return ENODEV;
+ }
return add_scrn_saver(blank_saver);
}
OpenPOWER on IntegriCloud