[PATCH 1/3: FBDEV: VGA State Save/Restore module

From: Antonino Daplas (adaplas@pol.net)
Date: Wed Dec 04 2002 - 12:26:10 EST


Hi,

Attached is a patch against linux-2.5.50 + James Simmons fbdev.diff to
save and restore the VGA state. This includes character maps (plane
0-3), the colormap, and the video mode. This can be used in fb_open()
and fb_release() to go back to VGA text/graphics mode.

Usage:

struct fb_vgastate state;

/* To save VGA state */
state.flags = VGA_SAVE_MODE | VGA_SAVE_CMAP | VGA_SAVE_FONTS;
fb_save_vga(&state);

/* To restore VGA state */
fb_restore_vga(&state);

Limitations:
1. Restoring the VGA state from high-resolution graphics mode may
result in a corrupt display which can be corrected by switching
consoles. May need a screen redraw at this point. Restoring from VGA
graphics mode to text mode and vice versa is okay.

2. Assumes some things about the hardware which is not universally
correct: VGA memory base is at 0xA0000, memory size is 64KB, the
hardware palette is readable, etc.

Any comments welcome.

Tony

PS: Please reverse the early patch I submitted if it was applied --
vgastate.diff



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Dec 07 2002 - 22:00:19 EST