summaryrefslogtreecommitdiffstats
path: root/sys/dev/syscons
diff options
context:
space:
mode:
authoryokota <yokota@FreeBSD.org>1998-08-10 08:39:19 +0000
committeryokota <yokota@FreeBSD.org>1998-08-10 08:39:19 +0000
commitec2542bd97008da13cfaec0011f64f0976cfb594 (patch)
treeede768bbde872fa897001cb163d96181b1b42911 /sys/dev/syscons
parentadbadeedc1436461332343fdb618f844de5fca51 (diff)
downloadFreeBSD-src-ec2542bd97008da13cfaec0011f64f0976cfb594.zip
FreeBSD-src-ec2542bd97008da13cfaec0011f64f0976cfb594.tar.gz
A workaround for screen flicker; eliminate some I/O access to the VGA
chip. It has been observed that the problem is most apparent: a) in notebook computers, b) and/or in the systems with C&T video chips. Define the new configuration option SC_BAD_FLICKER in the kernel configuration file to remove outb()/outw() calls in question.
Diffstat (limited to 'sys/dev/syscons')
-rw-r--r--sys/dev/syscons/syscons.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c
index bb68f7f..da3b3bf 100644
--- a/sys/dev/syscons/syscons.c
+++ b/sys/dev/syscons/syscons.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: syscons.c,v 1.271 1998/08/03 09:18:58 yokota Exp $
+ * $Id: syscons.c,v 1.272 1998/08/03 11:30:45 yokota Exp $
*/
#include "sc.h"
@@ -4734,18 +4734,26 @@ set_font_mode(u_char *buf)
outb(ATC, 0x20); /* enable palette */
#if SLOW_VGA
+#ifndef SC_BAD_FLICKER
outb(TSIDX, 0x00); outb(TSREG, 0x01);
+#endif
outb(TSIDX, 0x02); outb(TSREG, 0x04);
outb(TSIDX, 0x04); outb(TSREG, 0x07);
+#ifndef SC_BAD_FLICKER
outb(TSIDX, 0x00); outb(TSREG, 0x03);
+#endif
outb(GDCIDX, 0x04); outb(GDCREG, 0x02);
outb(GDCIDX, 0x05); outb(GDCREG, 0x00);
outb(GDCIDX, 0x06); outb(GDCREG, 0x04);
#else
+#ifndef SC_BAD_FLICKER
outw(TSIDX, 0x0100);
+#endif
outw(TSIDX, 0x0402);
outw(TSIDX, 0x0704);
+#ifndef SC_BAD_FLICKER
outw(TSIDX, 0x0300);
+#endif
outw(GDCIDX, 0x0204);
outw(GDCIDX, 0x0005);
outw(GDCIDX, 0x0406); /* addr = a0000, 64kb */
@@ -4766,10 +4774,14 @@ set_normal_mode(u_char *buf)
outb(ATC, 0x20); /* enable palette */
#if SLOW_VGA
+#ifndef SC_BAD_FLICKER
outb(TSIDX, 0x00); outb(TSREG, 0x01);
+#endif
outb(TSIDX, 0x02); outb(TSREG, buf[0]);
outb(TSIDX, 0x04); outb(TSREG, buf[1]);
+#ifndef SC_BAD_FLICKER
outb(TSIDX, 0x00); outb(TSREG, 0x03);
+#endif
outb(GDCIDX, 0x04); outb(GDCREG, buf[2]);
outb(GDCIDX, 0x05); outb(GDCREG, buf[3]);
if (crtc_addr == MONO_BASE) {
@@ -4778,10 +4790,14 @@ set_normal_mode(u_char *buf)
outb(GDCIDX, 0x06); outb(GDCREG,(buf[4] & 0x03) | 0x0c);
}
#else
+#ifndef SC_BAD_FLICKER
outw(TSIDX, 0x0100);
+#endif
outw(TSIDX, 0x0002 | (buf[0] << 8));
outw(TSIDX, 0x0004 | (buf[1] << 8));
+#ifndef SC_BAD_FLICKER
outw(TSIDX, 0x0300);
+#endif
outw(GDCIDX, 0x0004 | (buf[2] << 8));
outw(GDCIDX, 0x0005 | (buf[3] << 8));
if (crtc_addr == MONO_BASE)
OpenPOWER on IntegriCloud