// SPDX-License-Identifier: GPL-2.0-only /* -*- linux-c -*- ------------------------------------------------------- * * * Copyright (C) 1991, 1992 Linus Torvalds * Copyright 2007-2008 rPath, Inc. - All Rights Reserved *
* ----------------------------------------------------------------------- */
/* * arch/i386/boot/video-mode.c * * Set the video mode. This is separated out into a different * file in order to be shared with the ACPI wakeup code.
*/
/* * Common variables
*/ int adapter; /* 0=CGA/MDA/HGC, 1=EGA, 2=VGA+ */ int force_x, force_y; /* Don't query the BIOS for cols/rows */ int do_restore; /* Screen contents changed during mode flip */ int graphic_mode; /* Graphic mode with linear frame buffer */
/* Probe the video drivers and have them generate their mode lists. */ void probe_cards(int unsafe)
{ struct card_info *card; static u8 probed[2];
if (probed[unsafe]) return;
probed[unsafe] = 1;
for (card = video_cards; card < video_cards_end; card++) { if (card->unsafe == unsafe) { if (card->probe)
card->nmodes = card->probe(); else
card->nmodes = 0;
}
}
}
/* Test if a mode is defined */ int mode_defined(u16 mode)
{ struct card_info *card; struct mode_info *mi; int i;
for (card = video_cards; card < video_cards_end; card++) {
mi = card->modes; for (i = 0; i < card->nmodes; i++, mi++) { if (mi->mode == mode) return 1;
}
}
/* Drop the recalc bit if set */
mode &= ~VIDEO_RECALC;
/* Scan for mode based on fixed ID, position, or resolution */
nmode = 0; for (card = video_cards; card < video_cards_end; card++) {
mi = card->modes; for (i = 0; i < card->nmodes; i++, mi++) { int visible = mi->x || mi->y;
ov = in_idx(crtc, 0x07); /* Overflow register */
ov &= 0xbd;
ov |= (rows >> (8-1)) & 0x02;
ov |= (rows >> (9-6)) & 0x40;
out_idx(ov, crtc, 0x07);
}
/* Set mode (with recalc if specified) */ int set_mode(u16 mode)
{ int rv;
u16 real_mode;
/* Very special mode numbers... */ if (mode == VIDEO_CURRENT_MODE) return 0; /* Nothing to do... */ elseif (mode == NORMAL_VGA)
mode = VIDEO_80x25; elseif (mode == EXTENDED_VGA)
mode = VIDEO_8POINT;
rv = raw_set_mode(mode, &real_mode); if (rv) return rv;
if (mode & VIDEO_RECALC)
vga_recalc_vertical();
/* Save the canonical mode number for the kernel, not
an alias, size specification or menu position */ #ifndef _WAKEUP
boot_params.hdr.vid_mode = real_mode; #endif return 0;
}
Messung V0.5
¤ Dauer der Verarbeitung: 0.17 Sekunden
(vorverarbeitet)
¤
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.