Commit 4737042c authored by James Simmons's avatar James Simmons

VGA text mode handling cleanup. Rusty's janitoral cleanups.

parent b4e5e606
This diff is collapsed.
......@@ -1967,8 +1967,7 @@ static void pm2fb_set_disp(const void* par, struct display* disp,
struct pm2fb_par* p=(struct pm2fb_par* )par;
unsigned long flags;
save_flags(flags);
cli();
local_irq_save(flags);
#ifdef __alpha__
disp->screen_base=i->regions.v_fb + dense_mem(i->regions.v_fb);
#else
......@@ -2014,7 +2013,7 @@ static void pm2fb_set_disp(const void* par, struct display* disp,
disp->dispsw=&fbcon_dummy;
break;
}
restore_flags(flags);
local_irq_restore(flags);
}
#ifdef PM2FB_HW_CURSOR
......
......@@ -3297,8 +3297,7 @@ static void pm3fb_set_disp(const void *par, struct display *disp,
DTRACE;
save_flags(flags);
cli();
local_irq_save(flags);
info->info.screen_base = l_fb_info->v_fb;
switch (p->depth) {
#ifdef FBCON_HAS_CFB8
......@@ -3356,7 +3355,7 @@ static void pm3fb_set_disp(const void *par, struct display *disp,
DPRINTK(1, "Invalid depth, using fbcon_dummy\n");
break;
}
restore_flags(flags);
local_irq_restore(flags);
}
/* */
......
......@@ -38,7 +38,6 @@
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/pci.h>
#include <linux/console.h>
#ifdef CONFIG_MTRR
#include <asm/mtrr.h>
#endif
......@@ -50,13 +49,9 @@
#error This driver requires PCI support.
#endif
/* version number of this driver */
#define RIVAFB_VERSION "0.9.3"
/* ------------------------------------------------------------------------- *
*
* various helpful macros and constants
......@@ -1166,12 +1161,12 @@ static int rivafb_open(struct fb_info *info, int user)
int cnt = atomic_read(&par->ref_count);
if (!cnt) {
memset(&par->state, 0, sizeof(struct fb_vgastate));
memset(&par->state, 0, sizeof(struct vgastate));
par->state.flags = VGA_SAVE_MODE | VGA_SAVE_FONTS;
/* save the DAC for Riva128 */
if (par->riva.Architecture == NV_ARCH_03)
par->state.flags |= VGA_SAVE_CMAP;
fb_save_vga(&par->state);
save_vga(&par->state);
RivaGetConfig(&par->riva);
riva_save_state(par, &par->initial_state);
......@@ -1192,7 +1187,7 @@ static int rivafb_release(struct fb_info *info, int user)
par->riva.LockUnlock(&par->riva, 0);
par->riva.LoadStateExt(&par->riva, &par->initial_state.ext);
fb_restore_vga(&par->state);
restore_vga(&par->state);
par->riva.LockUnlock(&par->riva, 1);
}
......
......@@ -3,6 +3,7 @@
#include <linux/config.h>
#include <linux/fb.h>
#include <video/vga.h>
#include "riva_hw.h"
/* GGI compatibility macros */
......@@ -34,7 +35,7 @@ struct riva_par {
struct riva_regs initial_state; /* initial startup video mode */
struct riva_regs current_state;
struct fb_vgastate state;
struct vgastate state;
atomic_t ref_count;
riva_cfb8_cmap_t cmap[256]; /* VGA DAC palette cache */
u32 riva_palette[16];
......
......@@ -780,8 +780,7 @@ static int tgafb_blank(int blank, struct fb_info_gen *info)
u32 vhcr, vvcr, vvvr;
unsigned long flags;
save_flags(flags);
cli();
local_irq_save(flags);
vhcr = TGA_READ_REG(TGA_HORIZ_REG);
vvcr = TGA_READ_REG(TGA_VERT_REG);
......@@ -821,7 +820,7 @@ static int tgafb_blank(int blank, struct fb_info_gen *info)
break;
}
restore_flags(flags);
local_irq_restore(flags);
return 0;
}
......
......@@ -23,7 +23,7 @@
#include <linux/init.h>
#include <asm/io.h>
#include "vga.h"
#include <video/vga.h>
#define GRAPHICS_ADDR_REG VGA_GFX_I /* Graphics address register. */
#define GRAPHICS_DATA_REG VGA_GFX_D /* Graphics data register. */
......@@ -70,7 +70,7 @@ static struct vga16fb_par {
unsigned char ModeControl; /* CRT-Controller:17h */
unsigned char ClockingMode; /* Seq-Controller:01h */
} vga_state;
struct fb_vgastate state;
struct vgastate state;
atomic_t ref_count;
int palette_blanked, vesa_blanked, mode, isVGA;
u8 misc, pel_msk, vss, clkdiv;
......@@ -304,9 +304,9 @@ static int vga16fb_open(struct fb_info *info, int user)
int cnt = atomic_read(&par->ref_count);
if (!cnt) {
memset(&par->state, 0, sizeof(struct fb_vgastate));
memset(&par->state, 0, sizeof(struct vgastate));
par->state.flags = 8;
fb_save_vga(&par->state);
save_vga(&par->state);
}
atomic_inc(&par->ref_count);
return 0;
......@@ -320,7 +320,7 @@ static int vga16fb_release(struct fb_info *info, int user)
if (!cnt)
return -EINVAL;
if (cnt == 1)
fb_restore_vga(&par->state);
restore_vga(&par->state);
atomic_dec(&par->ref_count);
return 0;
......
This diff is collapsed.
......@@ -321,37 +321,6 @@ struct fb_cursor {
struct fb_image image; /* Cursor image */
};
/* VGA State Save and Restore */
#define VGA_SAVE_FONT0 1 /* save/restore plane 2 fonts */
#define VGA_SAVE_FONT1 2 /* save/restore plane 3 fonts */
#define VGA_SAVE_TEXT 4 /* save/restore plane 0/1 fonts */
#define VGA_SAVE_FONTS 7 /* save/restore all fonts */
#define VGA_SAVE_MODE 8 /* save/restore video mode */
#define VGA_SAVE_CMAP 16 /* save/restore color map/DAC */
struct fb_vgastate {
caddr_t vgabase; /* mmio base, if supported */
__u32 flags; /* what state/s to save (see VGA_SAVE_*) */
__u32 depth; /* current fb depth, not important */
__u32 num_attr; /* number of att registers, 0 for default */
__u32 num_crtc; /* number of crt registers, 0 for default */
__u32 num_gfx; /* number of gfx registers, 0 for default */
__u32 num_seq; /* number of seq registers, 0 for default */
caddr_t fbbase; /* -- DO NOT ALTER STARTING HERE -- */
__u8 *vga_font0;
__u8 *vga_font1;
__u8 *vga_text;
__u8 *vga_cmap;
__u8 *attr;
__u8 *crtc;
__u8 *gfx;
__u8 *seq;
__u8 misc;
};
extern int fb_save_vga(struct fb_vgastate *state);
extern int fb_restore_vga(struct fb_vgastate *state);
#ifdef __KERNEL__
#include <linux/fs.h>
......
......@@ -187,6 +187,29 @@
#define VGA_OUTW_WRITE
#endif
/* VGA State Save and Restore */
#define VGA_SAVE_FONT0 1 /* save/restore plane 2 fonts */
#define VGA_SAVE_FONT1 2 /* save/restore plane 3 fonts */
#define VGA_SAVE_TEXT 4 /* save/restore plane 0/1 fonts */
#define VGA_SAVE_FONTS 7 /* save/restore all fonts */
#define VGA_SAVE_MODE 8 /* save/restore video mode */
#define VGA_SAVE_CMAP 16 /* save/restore color map/DAC */
struct vgastate {
caddr_t vgabase; /* mmio base, if supported */
__u32 flags; /* what state[s] to save (see VGA_SAVE_*) */
__u32 membase; /* VGA window base, 0 for default - 0xA000 */
__u32 memsize; /* VGA window size, 0 for default 64K */
__u32 depth; /* current fb depth, not important */
__u32 num_attr; /* number of att registers, 0 for default */
__u32 num_crtc; /* number of crt registers, 0 for default */
__u32 num_gfx; /* number of gfx registers, 0 for default */
__u32 num_seq; /* number of seq registers, 0 for default */
void *vidstate;
};
extern int save_vga(struct vgastate *state);
extern int restore_vga(struct vgastate *state);
/*
* generic VGA port read/write
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment