summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>2000-05-18 13:31:13 +0000
committerJason Wright <jason@cvs.openbsd.org>2000-05-18 13:31:13 +0000
commitf91d6bab7f52d69c80c813778f169971cee7a861 (patch)
tree841c9dcbe91b2d28cfb48c32f9b4809fd385f9b1
parent5f6bc7799cd98587b12f1c087a71a3c729eef23c (diff)
add machdep.vsyncblank sysctl for controlling whether vsync is disabled
when the monitor is blanked.
-rw-r--r--etc/etc.sparc/sysctl.conf1
-rw-r--r--sbin/sysctl/sysctl.84
-rw-r--r--sys/arch/sparc/dev/cgsix.c7
-rw-r--r--sys/arch/sparc/include/cpu.h6
-rw-r--r--sys/arch/sparc/sparc/machdep.c7
5 files changed, 19 insertions, 6 deletions
diff --git a/etc/etc.sparc/sysctl.conf b/etc/etc.sparc/sysctl.conf
index 50e54ded7f6..c6f01028df1 100644
--- a/etc/etc.sparc/sysctl.conf
+++ b/etc/etc.sparc/sysctl.conf
@@ -1 +1,2 @@
#machdep.led_blink=1 # 1=On sparc, make led(s) blink
+#machdep.vsyncblank=1 # 1=Turn video sync off when blanking
diff --git a/sbin/sysctl/sysctl.8 b/sbin/sysctl/sysctl.8
index bdab67b2ebb..7c3a47435fd 100644
--- a/sbin/sysctl/sysctl.8
+++ b/sbin/sysctl/sysctl.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: sysctl.8,v 1.45 2000/04/25 22:12:53 deraadt Exp $
+.\" $OpenBSD: sysctl.8,v 1.46 2000/05/18 13:31:12 jason Exp $
.\" $NetBSD: sysctl.8,v 1.4 1995/09/30 07:12:49 thorpej Exp $
.\"
.\" Copyright (c) 1993
@@ -238,6 +238,8 @@ privilege can change the value.
.It machdep.apmwarn integer yes (i386 only)
.It machdep.kbdreset integer yes (i386 only)
.It machdep.allowaperture integer yes (i386 only, XFree86)
+.It machdep.led_blink integer yes (sparc only)
+.It machdep.vsyncblank integer yes (sparc only)
.It user.cs_path string no
.It user.bc_base_max integer no
.It user.bc_dim_max integer no
diff --git a/sys/arch/sparc/dev/cgsix.c b/sys/arch/sparc/dev/cgsix.c
index 8ace1e00fcc..a0f3194672b 100644
--- a/sys/arch/sparc/dev/cgsix.c
+++ b/sys/arch/sparc/dev/cgsix.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cgsix.c,v 1.12 1999/05/08 01:15:58 jason Exp $ */
+/* $OpenBSD: cgsix.c,v 1.13 2000/05/18 13:31:12 jason Exp $ */
/* $NetBSD: cgsix.c,v 1.33 1997/08/07 19:12:30 pk Exp $ */
/*
@@ -88,6 +88,8 @@
#include <sparc/dev/pfourreg.h>
#endif
+extern int sparc_vsyncblank;
+
union cursor_cmap { /* colormap, like bt_cmap, but tiny */
u_char cm_map[2][3]; /* 2 R/G/B entries */
u_int cm_chip[2]; /* 2 chip equivalents */
@@ -429,7 +431,8 @@ cgsixioctl(dev, cmd, data, flags, p)
cg6_unblank(&sc->sc_dev);
else if (!sc->sc_blanked) {
sc->sc_blanked = 1;
- sc->sc_thc->thc_misc &= ~(THC_MISC_VIDEN|THC_MISC_SYNCEN);
+ sc->sc_thc->thc_misc &= ~(THC_MISC_VIDEN |
+ (sparc_vsyncblank ? THC_MISC_SYNCEN : 0));
}
break;
diff --git a/sys/arch/sparc/include/cpu.h b/sys/arch/sparc/include/cpu.h
index 5ccf95a2502..c510fb680d1 100644
--- a/sys/arch/sparc/include/cpu.h
+++ b/sys/arch/sparc/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.8 2000/02/21 21:05:58 art Exp $ */
+/* $OpenBSD: cpu.h,v 1.9 2000/05/18 13:31:12 jason Exp $ */
/* $NetBSD: cpu.h,v 1.24 1997/03/15 22:25:15 pk Exp $ */
/*
@@ -52,11 +52,13 @@
* CTL_MACHDEP definitions.
*/
#define CPU_LED_BLINK 1 /* int: twiddle the power LED */
-#define CPU_MAXID 2 /* 1 valid machdep ID */
+#define CPU_VSYNCBLANK 2 /* int: turn off monitors in *blank */
+#define CPU_MAXID 3 /* 2 valid machdep IDs */
#define CTL_MACHDEP_NAMES { \
{ 0, 0 }, \
{ "led_blink", CTLTYPE_INT }, \
+ { "vsyncblank", CTLTYPE_INT }, \
}
#ifdef _KERNEL
diff --git a/sys/arch/sparc/sparc/machdep.c b/sys/arch/sparc/sparc/machdep.c
index d063046906f..12d5111cc35 100644
--- a/sys/arch/sparc/sparc/machdep.c
+++ b/sys/arch/sparc/sparc/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.48 2000/03/23 09:59:56 art Exp $ */
+/* $OpenBSD: machdep.c,v 1.49 2000/05/18 13:31:12 jason Exp $ */
/* $NetBSD: machdep.c,v 1.85 1997/09/12 08:55:02 pk Exp $ */
/*
@@ -141,6 +141,7 @@ int physmem;
/* sysctl settable */
int sparc_led_blink = 0;
+int sparc_vsyncblank = 0;
/*
* safepri is a safe priority for sleep to set for a spin-wait
@@ -553,6 +554,10 @@ cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
return (ENOTDIR); /* overloaded */
switch (name[0]) {
+ case CPU_VSYNCBLANK:
+ ret = sysctl_int(oldp, oldlenp, newp, newlen,
+ &sparc_vsyncblank);
+ return (ret);
case CPU_LED_BLINK:
#if (NLED > 0) || (NAUXREG > 0) || (NSCF > 0)
oldval = sparc_led_blink;