#include <linux/spinlock.h>
#include <linux/ioport.h>
#include <linux/init.h>
+#include <linux/smp_lock.h>
#include <video/vga.h>
#include <asm/io.h>
-static spinlock_t vga_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(vga_lock);
+static int cursor_size_lastfrom;
+static int cursor_size_lastto;
static struct vgastate state;
#define BLANK 0x0020
{
unsigned long flags;
int curs, cure;
- static int lastfrom, lastto;
#ifdef TRIDENT_GLITCH
if (xpos < 16)
from--, to--;
#endif
- if ((from == lastfrom) && (to == lastto))
+ if ((from == cursor_size_lastfrom) && (to == cursor_size_lastto))
return;
- lastfrom = from;
- lastto = to;
+ cursor_size_lastfrom = from;
+ cursor_size_lastto = to;
spin_lock_irqsave(&vga_lock, flags);
outb_p(0x0a, vga_video_port_reg); /* Cursor start */
charmap += 4 * cmapsz;
#endif
+ unlock_kernel();
spin_lock_irq(&vga_lock);
/* First, the Sequencer */
vga_wseq(state->vgabase, VGA_SEQ_RESET, 0x1);
vga_wattr(state->vgabase, VGA_AR_ENABLE_DISPLAY, 0);
}
spin_unlock_irq(&vga_lock);
+ lock_kernel();
return 0;
}
unsigned char ovr, vde, fsr;
int rows, maxscan, i;
- if (fontheight == vc->vc_font.height)
- return 0;
-
- vc->vc_font.height = fontheight;
-
rows = vc->vc_scan_lines / fontheight; /* Number of video rows we end up with */
maxscan = rows * fontheight - 1; /* Scan lines to actually display-1 */
for (i = 0; i < MAX_NR_CONSOLES; i++) {
struct vc_data *c = vc_cons[i].d;
- if (c && c->vc_sw == &vga_con)
+ if (c && c->vc_sw == &vga_con) {
+ if (CON_IS_VISIBLE(c)) {
+ /* void size to cause regs to be rewritten */
+ cursor_size_lastfrom = 0;
+ cursor_size_lastto = 0;
+ c->vc_sw->con_cursor(c, CM_DRAW);
+ }
+ c->vc_font.height = fontheight;
vc_resize(c->vc_num, 0, rows); /* Adjust console size */
+ }
}
return 0;
}