Kevin O'Connor [Fri, 3 Feb 2012 03:52:17 +0000 (22:52 -0500)]
vgabios: Handle VGA option rom being re-run.
Check for the case where the option rom is executed a second time - in
that case re-init the hardware, but do not set any variables. This
should make the rom better behaving when run from S3 resume.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Gleb Natapov [Tue, 24 Jan 2012 12:33:42 +0000 (14:33 +0200)]
mask interrupts on S3 resume
i8259 clears interrupt mask on reset. Interrupt need to be
masked again before enabling interrupts on CPU. Since option
roms are called with interrupts enabled, resume should mask
interrupts in i8259 before calling vgabios.
Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Kevin O'Connor [Sun, 29 Jan 2012 16:53:59 +0000 (11:53 -0500)]
vgabios: handle vmware vga in bochsvga.
The vmware vga emulated by qemu has a I/O region in pci bar 0.
The framebuffer is in pci bar 1. Handle that by checking the
type of bar 0 in case it is a I/O bar use bar 1 instead.
Also make bochsbios report lfb size in debug output.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Kevin O'Connor [Mon, 16 Jan 2012 23:48:26 +0000 (18:48 -0500)]
vgabios: Simplify planar4 vgafb code.
Don't bother programming the vga registers to manipulate the
framebuffer when in planar4 mode. Instead, just switch between the
four planes and do the manipulation with regular reads and writes.
This makes the code simpler to understand (the vga hardware
manipulations are arcane and complex).
Note, this could make text scrolling in planar4 mode slower and more
likely to result in tearing. However, it's unlikely anything
important uses the vgabios in planar4 mode.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Kevin O'Connor [Sun, 15 Jan 2012 06:12:20 +0000 (01:12 -0500)]
vgabios: Improve vgabios Kconfig menu.
Place driver types in a "choice" selection - only one driver type
makes sense.
Only prompt the user for PCI Vendor/Device ids if they wish to
override the default choices. Otherwise, Kconfig wont know to use the
proper defaults when building autoconf.h.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Kevin O'Connor [Sat, 14 Jan 2012 19:52:01 +0000 (14:52 -0500)]
vgabios: Make cirrus line lengths standard.
Only two modes don't match their expected line length. One looks like
a bug (it has a virtual line length of 1280 for a screen of 1600
bytes) and one looks like an optimization (2048 vs 1920). Change the
mode line lengths to exactly match the expected line lengths so that
the VBE code is correct.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Kevin O'Connor [Sat, 14 Jan 2012 01:00:35 +0000 (20:00 -0500)]
vgabios: Make VBE code independent of bochsvga.
Introduce new global variables (VBE_enabled, VBE_total_memory,
VBE_capabilities, VBE_framebuffer) to replace the need for function
calls that were specific to bochsvga.
Replace info received from bochsvga_mode_info with info found in
vgahw_find_mode.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Kevin O'Connor [Sat, 7 Jan 2012 23:27:19 +0000 (18:27 -0500)]
vgabios: Unify page size calculations; remove page size from vgamode_s.
The previous code could obtain the page size in different ways - from
vmode_g->sslength, from SCREEN_MEM_START, or by manually multiplying
cols and rows. Add a new func (calc_page_size) and use that in areas
that need to calculate the page size.
Convert readers of the page size to read it from the "video_pagesize"
entry in the BDA instead of recalculating it.
Remove the page size from struct vgamode_s (slength) as it is now
calculated dynamically. The new calculated versions are different
from the existing values exported in video_param_table. However, the
existing values (for CGA) did not look correct - I compared the values
to those exported by two other VGA BIOS manufacturers and used the
values that look more standard.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Kevin O'Connor [Mon, 2 Jan 2012 16:13:14 +0000 (11:13 -0500)]
vgabios: Make struct vgamode_s more similar to bochs/cirrus mode tables.
For graphics modes, store pixel width/height instead of text
width/height. Add explicit char width field. Where needed, calculate
text width/height from pixel width/height by dividing pixel count by
character size.
Rename some fields and change field sizes to match cirrus/bochs
definitions.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Kevin O'Connor [Sat, 14 Jan 2012 16:58:14 +0000 (11:58 -0500)]
BCVs should inherrit the legacy harddrive priority.
A BCV will (almost assuredly) be a hard drive, so it makes sense to
prioritize them the same as builtin hard drives when only the legacy
priority system is used.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Kevin O'Connor [Sat, 14 Jan 2012 16:55:35 +0000 (11:55 -0500)]
Permit multiple BEV and BEV/BCV combinations in a single option rom.
The BBS spec is unclear on multiple BEV entry points for a rom.
However, the LSI scsi rom has been seen to register a BEV followed by
multiple BCV entry points. Add support for it, as there's no harm in
it.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Kevin O'Connor [Sun, 1 Jan 2012 15:54:19 +0000 (10:54 -0500)]
vgabios: Minor - make FB scroll functions look similar.
All three scroll function variants have the same format, but those
that have an implicit character width or height of 1 have those
multiplications omitted. Add those multiplications back in (the
compiler will optimize them away) so all the variants look similar.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Kevin O'Connor [Sat, 31 Dec 2011 23:19:22 +0000 (18:19 -0500)]
vgabios: Refactor vga_set_mode and stdvga_set_mode.
Split out the BDA setup part of vga_set_mode to new function
modeswitch_set_bda. Move the remaining parts (palette loading, screen
clearing, font loading) of vga_set_mode into stdvga_set_mode.
Add new mode switching flags and pass them to stdvga_set_mode, so it
does not need to inspect modeset_ctl directly.
Move code needed by stdvga_set_mode (perform_gray_scale_summing,
clear_screen) to stdvga.c.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Kevin O'Connor [Sat, 31 Dec 2011 22:24:11 +0000 (17:24 -0500)]
vgabios: Change vga_set_mode() to directly setup BDA.
The calls to set_cursor_shape, set_cursor_pos, and set_active_page
have no impact other than to set the BDA variables, because the
standard vga mode switch already programed the registers these
functions set. So, just setup the BDA directly.
The stdvga_set_text_block_specifier call is unnecessary - it sets
a register which is already programmed that way.
Call stdvga_get_crtc() to obtain the crtc address instead of inferring
it from the memory model.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Kevin O'Connor [Sat, 31 Dec 2011 21:22:35 +0000 (16:22 -0500)]
vgabios: Don't call int10 during mode switch.
Don't call int10 to load the fonts - instead call the font loading
functions directly.
Theoretically, this could change behavior if an external program has
captured int10 and redirects the font loading calls. However, there
does not seem to be any indication that an external app could expect
that to work.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Kevin O'Connor [Fri, 30 Dec 2011 21:37:20 +0000 (16:37 -0500)]
vgabios: Minor fixes to struct vbe_info definition.
Although the VBE3 spec says there is 189 bytes of pad at the end of
the vbe_info struct, the spec also says the total struct size should
be 256 bytes. The VBE2 spec uses sufficient pad to get to 256 bytes.
So, assume the spec was off by one and make the pad 190 bytes.
Also, use u32 for capabilities and 'struct segoff_s' for
win_func_ptr.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Kevin O'Connor [Sat, 24 Dec 2011 05:44:07 +0000 (00:44 -0500)]
vgabios: Merge support for GeodeLX vga bios.
GeodeLX support based on a patch sent by Chris Kindt on 20090825. The
patch provides basic support for running the vga bios on a Geode
device.
The original patch has been updated with the following:
* Updates to merge with the current code,
* geode specific timings are loaded at init time
* PCI code was dropped as the current code now supports pci
* Updates for Kconfig
* dropped redundant lxdprintf
* dropped geode_demo screen writing
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>