summaryrefslogtreecommitdiffstats
path: root/drivers/char/vga.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1997-04-29 21:13:14 +0000
committer <ralf@linux-mips.org>1997-04-29 21:13:14 +0000
commit19c9bba94152148523ba0f7ef7cffe3d45656b11 (patch)
tree40b1cb534496a7f1ca0f5c314a523c69f1fee464 /drivers/char/vga.c
parent7206675c40394c78a90e74812bbdbf8cf3cca1be (diff)
Import of Linux/MIPS 2.1.36
Diffstat (limited to 'drivers/char/vga.c')
-rw-r--r--drivers/char/vga.c55
1 files changed, 35 insertions, 20 deletions
diff --git a/drivers/char/vga.c b/drivers/char/vga.c
index eaf3c9ac9..7ae406d8e 100644
--- a/drivers/char/vga.c
+++ b/drivers/char/vga.c
@@ -33,6 +33,10 @@
* because it causes screen to flicker, by Mitja Horvat
* 5-May-96 <mitja.horvat@guest.arnes.si>
*
+ * Use 2 outw instead of 4 outb_p to reduce erroneous text
+ * flashing on RHS of screen during heavy console scrolling .
+ * Oct 1996, Paul Gortmaker.
+ *
*/
#include <linux/sched.h>
@@ -79,6 +83,29 @@ unsigned long video_port_base;
#define dac_reg (0x3c8)
#define dac_val (0x3c9)
+/*
+ * By replacing the four outb_p with two back to back outw, we can reduce
+ * the window of opportunity to see text mislocated to the RHS of the
+ * console during heavy scrolling activity. However there is the remote
+ * possibility that some pre-dinosaur hardware won't like the back to back
+ * I/O. Since the Xservers get away with it, we should be able to as well.
+ */
+static inline void write_vga(unsigned char reg, unsigned int val)
+{
+#ifndef SLOW_VGA
+ unsigned int v1, v2;
+
+ v1 = reg + (val & 0xff00);
+ v2 = reg + 1 + ((val << 8) & 0xff00);
+ outw(v1, video_port_reg);
+ outw(v2, video_port_reg);
+#else
+ outb_p(reg, video_port_reg);
+ outb_p(val >> 8, video_port_val);
+ outb_p(reg+1, video_port_reg);
+ outb_p(val & 0xff, video_port_val);
+#endif
+}
void
set_palette (void)
@@ -101,17 +128,10 @@ set_palette (void)
void
__set_origin(unsigned short offset)
{
- unsigned long flags;
-
clear_selection();
- save_flags(flags); cli();
__origin = offset;
- outb_p(12, video_port_reg);
- outb_p(offset >> 8, video_port_val);
- outb_p(13, video_port_reg);
- outb_p(offset, video_port_val);
- restore_flags(flags);
+ write_vga(12, offset);
}
/*
@@ -123,30 +143,20 @@ hide_cursor(void)
/* This is inefficient, we could just put the cursor at 0xffff,
but perhaps the delays due to the inefficiency are useful for
some hardware... */
- outb_p(14, video_port_reg);
- outb_p(0xff&((video_mem_term-video_mem_base)>>9), video_port_val);
- outb_p(15, video_port_reg);
- outb_p(0xff&((video_mem_term-video_mem_base)>>1), video_port_val);
+ write_vga(14, (video_mem_term - video_mem_base - 1)>>1);
}
void
set_cursor(int currcons)
{
- unsigned long flags;
-
if (currcons != fg_console || console_blanked || vcmode == KD_GRAPHICS)
return;
if (__real_origin != __origin)
__set_origin(__real_origin);
- save_flags(flags); cli();
if (deccm) {
- outb_p(14, video_port_reg);
- outb_p(0xff&((pos-video_mem_base)>>9), video_port_val);
- outb_p(15, video_port_reg);
- outb_p(0xff&((pos-video_mem_base)>>1), video_port_val);
+ write_vga(14, (pos - video_mem_base)>>1);
} else
hide_cursor();
- restore_flags(flags);
}
unsigned long
@@ -319,6 +329,11 @@ con_type_init(unsigned long kmem_start, const char **display_desc)
}
void
+con_type_init_finish(void)
+{
+}
+
+void
get_scrmem(int currcons)
{
memcpyw((unsigned short *)vc_scrbuf[currcons],