/* * linux/drivers/video/hgafb.c -- Hercules graphics adaptor frame buffer device * * Created 25 Nov 1999 by Ferenc Bakonyi (fero@drama.obuda.kando.hu) * Based on skeletonfb.c by Geert Uytterhoeven and * mdacon.c by Andrew Apted * * History: * * - Revision 0.1.8 (23 Oct 2002): Ported to new framebuffer api. * * - Revision 0.1.7 (23 Jan 2001): fix crash resulting from MDA only cards * being detected as Hercules. (Paul G.) * - Revision 0.1.6 (17 Aug 2000): new style structs * documentation * - Revision 0.1.5 (13 Mar 2000): spinlocks instead of saveflags();cli();etc * minor fixes * - Revision 0.1.4 (24 Jan 2000): fixed a bug in hga_card_detect() for * HGA-only systems * - Revision 0.1.3 (22 Jan 2000): modified for the new fb_info structure * screen is cleared after rmmod * virtual resolutions * module parameter 'nologo={0|1}' * the most important: boot logo :) * - Revision 0.1.0 (6 Dec 1999): faster scrolling and minor fixes * - First release (25 Nov 1999) * * This file is subject to the terms and conditions of the GNU General Public * License. See the file COPYING in the main directory of this archive * for more details.
*/
#define HGA_INDEX_PORT 0x3b4 /* Register select port */ #define HGA_VALUE_PORT 0x3b5 /* Register value port */ #define HGA_MODE_PORT 0x3b8 /* Mode control port */ #define HGA_STATUS_PORT 0x3ba /* Status and Config port */ #define HGA_GFX_PORT 0x3bf /* Graphics control port */
/* Don't assume that tty1 will be the initial current console. */ staticint release_io_port = 0; staticint release_io_ports = 0; staticbool nologo = 0;
hga_vram = ioremap(0xb0000, hga_vram_len); if (!hga_vram) return -ENOMEM;
if (request_region(0x3b0, 12, "hgafb"))
release_io_ports = 1; if (request_region(0x3bf, 1, "hgafb"))
release_io_port = 1;
/* do a memory check */
p = hga_vram;
q = hga_vram + 0x01000;
p_save = readw(p); q_save = readw(q);
writew(0xaa55, p); if (readw(p) == 0xaa55) count++;
writew(0x55aa, p); if (readw(p) == 0x55aa) count++;
writew(p_save, p);
if (count != 2) goto error;
/* Ok, there is definitely a card registering at the correct * memory location, so now we do an I/O port test.
*/
if (!test_hga_b(0x66, 0x0f)) /* cursor low register */ goto error;
if (!test_hga_b(0x99, 0x0f)) /* cursor low register */ goto error;
/* See if the card is a Hercules, by checking whether the vsync * bit of the status register is changing. This test lasts for * approximately 1/10th of a second.
*/
/** * hgafb_open - open the framebuffer device * @info: pointer to fb_info object containing info for current hga board * @init: open by console system or userland. * * Returns: %0
*/
staticint hgafb_open(struct fb_info *info, int init)
{
hga_gfx_mode();
hga_clear_screen(); if (!nologo) hga_show_logo(info); return 0;
}
/** * hgafb_release - open the framebuffer device * @info: pointer to fb_info object containing info for current hga board * @init: open by console system or userland. * * Returns: %0
*/
/** * hgafb_setcolreg - set color registers * @regno:register index to set * @red:red value, unused * @green:green value, unused * @blue:blue value, unused * @transp:transparency value, unused * @info:unused * * This callback function is used to set the color registers of a HGA * board. Since we have only two fixed colors only @regno is checked. * A zero is returned on success and 1 for failure. * * Returns: %0
*/
/** * hgafb_pan_display - pan or wrap the display * @var:contains new xoffset, yoffset and vmode values * @info:pointer to fb_info object containing info for current hga board * * This function looks only at xoffset, yoffset and the %FB_VMODE_YWRAP * flag in @var. If input parameters are correct it calls hga_pan() to * program the hardware. @info->var is updated to the new values. * * Returns: %0 on success or %-EINVAL for failure.
*/
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.