Commit Graph

332 Commits

Author SHA1 Message Date
Kevin O'Connor c8845029a7 vgabios: Rework bochsvga mode switching.
Make the bochsvga mode switch more similar to the original lgpl
vgabios code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-02-01 21:58:49 -05:00
Kevin O'Connor 3524453b5d vgabios: Fix linelength calculations in bochsvga and vbe.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-02-01 21:58:38 -05:00
Kevin O'Connor 2af8ba1ab2 vgabios: Compare PCI ids against pci rom struct instead of config settings.
QEMU can update the pci rom struct - so use that as the location to
determine if the pci address passed into the option rom is accurate.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-02-01 20:43:20 -05:00
Kevin O'Connor 2bd4531436 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>
2012-02-01 20:42:06 -05:00
Kevin O'Connor d9211ee9e3 vgabios: Update copyright statements in bochsvga.c and vbe.c.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-02-01 20:40:47 -05:00
Kevin O'Connor 31f67ae978 vgabios: Fix missing "extern" declaration on vbe variables.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-02-01 20:39:41 -05:00
Kevin O'Connor f98bbf09fc vgabios: Move stdvga_set_mode() to stdvgamodes.c.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-02-01 20:39:27 -05:00
Kevin O'Connor 1692007a5f vgabios: Minor - pass display address to stdvga_set_cursor_pos().
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-02-01 20:39:21 -05:00
Kevin O'Connor 59f75d4bdc vgabios: Add VBE power management (10h) stub function.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-02-01 20:39:09 -05:00
Kevin O'Connor d61fc53a60 vgabios: Add support for VBE get/set display start function.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-02-01 20:39:03 -05:00
Kevin O'Connor 3876b53122 vgabios: Add support for vbe get/set line length function.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-02-01 20:38:49 -05:00
Kevin O'Connor 9961f9958c vgabios: Add support for vesa get/set window function.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-02-01 20:37:02 -05:00
Kevin O'Connor e6bc4c1c58 vgabios: Move BDA setting from driver code to common code.
Always setup the BDA on a mode switch.  Call that BDA setup code
unconditionally.

Also, always set vbe_mode and use that for finding the current mode
and for reporting the mode to vbe callers.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-02-01 20:35:48 -05:00
Kevin O'Connor 4a73f93396 vgabios: Extract out current mode finding into new function.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-01-21 11:08:35 -05:00
Kevin O'Connor 0377602ae6 vgabios: Set cwidth/cheight/sstart in vgamode_s for cirrus/bochs.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-01-21 11:00:11 -05:00
Kevin O'Connor 5e1694c71d vgabios: Use stored total memory in cirrus code instead of recalculating.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-01-21 10:43:30 -05:00
Kevin O'Connor 8cf8f8e6ce vgabios: Check that the PCI BDF passed in is valid before using.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-01-19 21:34:44 -05:00
Kevin O'Connor 160d34abce 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>
2012-01-19 21:33:23 -05:00
Kevin O'Connor 707d2168f5 vgabios: Use regular pci_config_readl func in geode code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-01-16 12:03:19 -05:00
Kevin O'Connor 69b01cbdb3 vgabios: Don't have geode code peak into stdvga mode struct.
Create a wrapper (stdvga_override_crtc) so the Geode code doesn't need
to access the stdvga mode tables directly.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-01-16 12:03:14 -05:00
Kevin O'Connor b3df857fe6 vgabios: Make VBE code depend on a config setting.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-01-16 12:02:44 -05:00
Kevin O'Connor 5f4ce9e9be vgabios: Move vgabios Kconfig definitions to vgasrc/Kconfig.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-01-16 12:02:39 -05:00
Kevin O'Connor 4ad2d107be vgabios: Rename vgatables.c to stdvgamodes.c.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-01-16 12:01:16 -05:00
Kevin O'Connor aad3b695b7 vgabios: Move video_param_table definition to vgabios.c.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-01-16 12:01:12 -05:00
Kevin O'Connor efb4523d4b vgabios: Move static_functionality[] from vgatables.c to vgabios.c.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-01-16 12:00:58 -05:00
Kevin O'Connor 2c23a7ab6a vgabios: Use standard VGA IO wrappers in geodevga.c.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-01-16 11:59:32 -05:00
Kevin O'Connor add3becb5d vgabios: Use standard VGA IO wrappers in clext.c.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-01-16 11:58:08 -05:00
Kevin O'Connor 184705fc8c vgabios: Use standard VGA IO wrapper functions in bochsvga.
Also, this alters some of the IO port settings in bochsvga_set_mode to
fix what looks like errors during the asm to C conversion.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-01-16 11:52:46 -05:00
Kevin O'Connor 86d2e004e2 vgabios: Use standard VGA IO wrapper functions in stdvga.c.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-01-16 11:51:37 -05:00
Kevin O'Connor 3471fdbe63 vgabios: Add wrapper functions for accessing standard VGA registers.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-01-16 11:50:42 -05:00
Kevin O'Connor 97cc354a02 vgabios: Add cirrus linear framebuffer detection; enable VBE in cirrus.
Extract Cirrus framebuffer address from PCI config space.

Enable VBE code for Cirrus cards.

Also, rework bochsvga code to use direct PCI accesses instead of
calling into the BIOS.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-01-14 17:20:07 -05:00
Kevin O'Connor e91ec7c773 vgabios: Hook up Cirrus extended bios functions.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-01-14 17:20:04 -05:00
Kevin O'Connor e19a68f5ac 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>
2012-01-14 17:19:58 -05:00
Kevin O'Connor 643290fb1f vgabios: Unify cirrus and vbe vesa functions.
Unify the code for the Cirrus and VBE vesa functions 00-03.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-01-14 17:19:50 -05:00
Kevin O'Connor 3339c05f19 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>
2012-01-14 17:19:45 -05:00
Kevin O'Connor 34203cdf8a vgabios: Unify code to generate the vbe mode list.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-01-14 17:19:39 -05:00
Kevin O'Connor c4a0b976c0 vgabios: Use vgamode_s in cirrus and bochsvga mode tables.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-01-14 17:19:30 -05:00
Kevin O'Connor 10dff3db24 vgabios: Extract out common parts of struct vgamode_s.
Extract out the fields in 'struct vgamode_s' that are used in the main
code.  The remaining fields are specific to the standard vga hardware
driver.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-01-14 17:19:25 -05:00
Kevin O'Connor 83047be58e 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>
2012-01-14 17:19:20 -05:00
Kevin O'Connor bb17d84468 vgabios: Add memmodel field to bochsvga mode list.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-01-14 17:19:12 -05:00
Kevin O'Connor 80da87da8d 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>
2012-01-14 17:19:04 -05:00
Kevin O'Connor 2c8ba89aab vgabios: Remove dummy 0xfe mode from list of cirrus modes.
The 0xfe mode isn't a real mode, it's a place holder for settings
needed to switch back to non-cirrus modes.  Handle it that way.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-01-14 17:18:54 -05:00
Kevin O'Connor 4519197f2e vgabios: Add char width to stdvga mode table.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-01-14 17:18:43 -05:00
Kevin O'Connor b451f18969 vgabios: Use standard naming for cirrus memmodel.
The cirrus mode array stores memmodel as vesacolortype - rename it to
'memmodel' and use common field names.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-01-14 12:59:46 -05:00
Kevin O'Connor d4398adab6 vgabios: Use vesa style memory model flags in stdvga code.
Replace the custom flags with the flags defined in the VBE spec.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-01-14 12:59:46 -05:00
Kevin O'Connor ddb8047f61 vgabios: Actually remove vgasrc/geodelx.[ch] - fixup of patch apply.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-01-14 12:57:03 -05:00
Nils 24ddd8678c vgabios: Add the geode GX2 functionality.
Signed-off-by: Nils Jacobs <njacobs8 at adsltotaal.nl>
2012-01-14 12:15:14 -05:00
Nils e8b184fe57 vgabios: Some little geode cleanup.
Signed-off-by: Nils Jacobs <njacobs8 at adsltotaal.nl>
2012-01-14 12:13:34 -05:00
Nils 31eabf9ba8 vgabios: Make the naming in the LX code generic to Geode.
Signed-off-by: Nils Jacobs <njacobs8 at adsltotaal.nl>
2012-01-14 12:11:41 -05:00
Kevin O'Connor b937397765 vgabios: Add scrolling for linear (packed pixel) graphics mode.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-01-01 11:04:42 -05:00
Kevin O'Connor 68ab041138 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>
2012-01-01 10:54:19 -05:00
Kevin O'Connor ae6eb8f5d3 vgabios: Framebuffer fixes for CGA and planar graphics modes.
Fix missing divide by 2 in CGA mode scroll.  Consistently use
cheight/2 for all uses.

Planar graphics character write has a read to video memory with a side
effect - mark that as volatile so the compiler doesn't optimize it
away.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-01-01 10:33:51 -05:00
Kevin O'Connor 161d201aff vgabios: Unify X_init() functions.
Use the same function signature for cirrus, bochsvga, geodelx, and
stdvga init code.

Have each hardware type explicitly call stdvga_init when needed.

To unify bochsvga_init() signature, store the device BDF passed into
the optionrom init code in a global variable (VgaBDF).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-12-31 19:45:14 -05:00
Kevin O'Connor 5108c69c47 vgabios: Unify X_set_mode() functions.
Use the same function signature for cirrus, bochsvga, and stdvga
set_mode code.

Make both the int1000 interface and the VBE 104f02 interface use the
same set_mode function.

Where clext and bochsvga need to fallback to the standard vga mode
switching, have them call vgastd_mode_switch directly.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-12-31 19:21:23 -05:00
Kevin O'Connor 6f77508892 vgabios: Create clext.h and use "clext_" as prefix for exported funcs.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-12-31 18:41:51 -05:00
Kevin O'Connor 821d6b410e 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>
2011-12-31 18:19:22 -05:00
Kevin O'Connor cecbc5da2c 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>
2011-12-31 17:29:36 -05:00
Kevin O'Connor 323d8c6357 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>
2011-12-31 16:22:35 -05:00
Kevin O'Connor c990f27298 vgabios: Introduce stdvga_get_crtc() and use it consistently.
The low level VGA code shouldn't depend on the crtc address stored in
the BDA - it can find the address on its own.

The cirrus_get_crtc() function is the same - replace it with
stdvga_get_crtc().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-12-31 16:03:41 -05:00
Kevin O'Connor 7e1d5301fd vgabios: Fix typo in release_font_access() - inb instead of inw.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-12-31 15:52:22 -05:00
Kevin O'Connor 2bec7d6162 vgabios: Move vgafb_load_font to stdvga.c.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-12-31 04:32:58 -05:00
Kevin O'Connor 88ca74183a vgabios: Rename vgahw_* functions to stdvga_*.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-12-31 04:24:20 -05:00
Kevin O'Connor ed68e5b601 vgabios: Rename vgaio.c to stdvga.c.
Also, introduce stdvga.h.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-12-31 04:17:44 -05:00
Kevin O'Connor 4040195d46 vgabios: Move vbe code from vgabios.c to new file vbe.c.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-12-31 03:51:57 -05:00
Kevin O'Connor e1e000b177 vgabios: Rename vga.c to vgabios.c.
Also, rename vgatables.h to vgabios.h.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-12-31 03:30:40 -05:00
Kevin O'Connor f1e217dc18 vgabios: Use bochsvga_ prefix for bochs vga functions.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-12-31 03:20:32 -05:00
Kevin O'Connor acdcbf024d vgabios: Rename vbe.c to bochsvga.c.
The code is specific to the Bochs "dispi" interface, not the vesa
video bios extensions spec.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-12-31 03:09:55 -05:00
Kevin O'Connor 8f4c019d75 vgabios: Continue port of clext.c.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-12-31 03:03:31 -05:00
Kevin O'Connor db301ef20c 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>
2011-12-30 16:37:20 -05:00
Kevin O'Connor 4c52fb4ce7 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>
2011-12-27 21:51:59 -05:00
Kevin O'Connor 72b5e45550 vgabios: Place a signature at offset 0x1e of the rom.
It appears some emulators look for a signature at offset 0x1e of the
option rom.  So, port the signature from the LGPL bios.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-12-27 21:44:27 -05:00
Kevin O'Connor f3760375e0 vgabios: Generate video_param_table at runtime.
Now that all the mode info is available in vga_modes, generate the
externally visible video_param_table data from it.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-12-27 21:43:53 -05:00
Kevin O'Connor 87233e9dda vgabios: Use vgamode_s instead of video_param_table in code.
Now that all the info in video_param_table is also in vgamode_s, use
the info in vgamode_s throughout the code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-12-27 21:39:29 -05:00
Kevin O'Connor 0c7d4d006f vgabios: Extend information in internal vgamode_s struct.
Copy all the data in video_param_table to vga_modes.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-12-27 21:39:29 -05:00
Kevin O'Connor 87dfad3013 vgabios: Minor - use segoff_s for static_functionality ptr. 2011-12-27 21:39:29 -05:00
Kevin O'Connor 815e447898 vgabios: Define video_save_pointer_table layout.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-12-27 21:39:29 -05:00
Kevin O'Connor 3c06536954 vgabios: Fix compile error due to missing include in clext.c.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-12-27 21:34:33 -05:00
Kevin O'Connor e48a537954 Updates to vgabios cirrus code.
Work in progress updates to cirrus vgabios code.
2011-12-20 23:56:14 -05:00
Julian Pidancet 8bd766f40c Preliminary DISPI VBE driver implementation
It allowed me to boot Windows 7 with Qemu BOCHS VGA emulation and it
seemed to work fine. It probably needs some further testing though.

Signed-off-by: Julian Pidancet <julian.pidancet@gmail.com>
2011-12-20 23:13:06 -05:00
Julian Pidancet 87879e256f Partially implement VBE interface, create VBE driver skeleton
Signed-off-by: Julian Pidancet <julian.pidancet@gmail.com>
2011-12-20 23:13:06 -05:00
Julian Pidancet da08a6de74 Add configuration menu for the VGA ROM
This patch adds a configuration menu for the VGA ROM, it also allow
the creation of a PCI header so the ROM can be extracted from a PCI
device.

V2: Default Device IDs and Vendor IDs values for Cirrus and Bochs are now set
    by Kconfig.

Signed-off-by: Julian Pidancet <julian.pidancet@gmail.com>
2011-12-20 23:13:06 -05:00
Julian Pidancet 7c6509cb10 Add a PCI header to the VGA ROM if needed
Allows the ROM to be extracted from a PCI device.

V2: * Declare the PCI header in C
    * Replace #ifdef CONFIG_VGA_PCI with #if CONFIG_VGA_PCI == 1

Signed-off-by: Julian Pidancet <julian.pidancet@gmail.com>
2011-12-20 23:13:06 -05:00
Julian Pidancet 677631f3db Rename CONFIG_VBE in CONFIG_VGA_BOCHS and CONFIG_CIRRUS in CONFIG_VGA_CIRRUS
Signed-off-by: Julian Pidancet <julian.pidancet@gmail.com>
2011-12-20 23:13:05 -05:00
Kevin O'Connor 3dba4c236d Support non-local build directory - allow "make OUT=abc/" to work.
Don't require the build directory to be the "out/" directory of the
SeaBIOS source.
2011-01-29 14:48:53 -05:00
Kevin O'Connor 3862b2dab5 vgabios: Fix compile error due to fixed prototypes. 2010-01-03 17:53:58 -05:00
Kevin O'Connor 1ca05b0f39 Be sure to add "void" to all function prototypes that take no args.
Omitting "void" leads to a K&R style declaration which was not intended.
2010-01-03 17:43:37 -05:00
Kevin O'Connor c9d3c2d1c4 Minor vga binary cleanups. 2010-01-01 13:05:23 -05:00
Kevin O'Connor 9f985427ff Replace common segment/offset pairs with struct segoff_s.
Introduce 'struct segoff_s' to more places.
2009-09-09 11:34:39 -04:00
Kevin O'Connor c0693941fd Do garbage collection of unused sections.
Implement -ffunction-sections and -fdata-sections in both 32bit and
    16bit code.
Make sure all sections have unique names (even asm and discarded
    sections).
Enhance tools/layoutrom.py script to find all sections reachable from
    exported 16bit code - prune all other sections.
Mark sections with "export" if they can be visible outside of code -
    these sections wont be dropped when pruning unused sections.
2009-06-10 21:56:01 -04:00
Kevin O'Connor 414d0738df VGA: Move direct in/out calls out of vgafb.c.
Implement wrapper calls in vgaio.c and use them instead.
2009-05-31 22:42:04 -04:00
Kevin O'Connor 227a2bb42c VGA: Comment and name update.
Remove remaining "biosfn_" prefixes from functions.
Don't use register names as function parameters.
vgafb_read_pixel should return a value (instead of passing in a pointer)
2009-05-31 22:00:20 -04:00
Kevin O'Connor afb287d4b2 VGA: Arrange screen writing functions to minimize stack.
Pass pointer to cursor position into write_string and write_teletype.
Handle flag processing of write_string in handle_1013.
Implement a tail-recursive scroll_one() function.
2009-05-31 21:15:33 -04:00
Kevin O'Connor 0ad77f09fa VGA: Reduce stack usage.
Make 'struct carattr' 3 bytes in size - gcc does better with this.
Add 'noinline' directives to some funcs to reduce handle_10 stack usage.
2009-05-31 20:46:43 -04:00
Kevin O'Connor 2e86c6a805 VGA: No need to scroll multiple times when writing a tab.
A tab can only scroll the screen once.
Inline the code from check_scroll into write_teletype.
Also, move row check in write_string to handle_1013.
2009-05-31 20:43:06 -04:00
Kevin O'Connor 2c34f41b01 VGA: Further simplify scrolling code.
Introduce memcpy_stride and memset_stride functions.
Simplify the moves and fills using src and dest pointers.
Don't nest for loops - just use one loop for copies.
2009-05-31 15:25:14 -04:00
Kevin O'Connor c3e158732c VGA: Simplify scrolling implementation.
Check for nblines==0 in calling function.
Eliminate full screen clearing optimization.
2009-05-31 01:37:54 -04:00
Kevin O'Connor ae6e1c852f VGA: Fix bad commit to vgafb.c - missing '}'. 2009-05-31 01:09:30 -04:00
Kevin O'Connor e4145adddd VGA: Define clear_screen in terms of memmodel.
Use vmode_g->memmodel instead of memmodel and svgamode.
2009-05-31 00:53:18 -04:00
Kevin O'Connor 217f2bc7d5 VGA: Breakup biosfn_scroll.
Rename biosfn_scroll to vgafb_scroll.
Break function up into per-mode scroll function.
Pass row/col params in a 'struct cursorpos'.
Encode direction as sign in nblines.
Move parameter checking to callers.
Add enhancement to 'attr' for using mode specific default attribute.
Also, make get_cursor_pos local to vga.c.
2009-05-31 00:46:47 -04:00
Kevin O'Connor 116a044f45 VGA: Move cursor setting out of biosfn_write_teletype.
Call set_cursor_pos in callers that need it.
2009-05-26 00:47:32 -04:00
Kevin O'Connor 82221b2bf1 VGA: Remove recursion from biosfn_write_teletype(). 2009-05-26 00:20:40 -04:00
Kevin O'Connor d3b381514a VGA: Simplify vgafb_write/read_char.
Pass cursor position into vgafb_write_char and vgafb_read_char.
Don't pass count into vgafb_write_char.
Break text writing into separate function.
2009-05-26 00:05:37 -04:00
Kevin O'Connor e4f220fa2e VGA: Remove vmode_g->class - store info in vmode_g->memmodel. 2009-05-25 23:37:13 -04:00
Kevin O'Connor 0926241e64 VGA: Use struct for car/attr/WITH_ATTR.
The three parameters are used frequently together - define a struct to
    hold them.
Alos, merge biosfn_write_char_attr/_only into one function.
2009-05-25 11:44:11 -04:00
Kevin O'Connor 918b1564dd VGA: Combine x/y/page into one parameter.
These three values are frequently used together - put them in a struct
    and pass the struct around.
2009-05-25 11:05:18 -04:00
Kevin O'Connor 85ea07e668 VGA: Inline biosfn_set_video_mode() into its only caller. 2009-05-25 09:41:07 -04:00
Kevin O'Connor deb9cb929d VGA: Replace biosfn_load_text_* with vgafb_load_font().
The functions font loading functions are nearly identical - replace
    with one common function.
2009-05-25 09:06:50 -04:00
Kevin O'Connor 124b6f7c9f VGA: Factor out hardware accesses from biosfn_set_video_mode.
Create vgahw_set_mode() that handles low-level vga setup in vgaio.c.
Move screen clearing to new function in vgafb.c.
2009-05-25 00:44:29 -04:00
Kevin O'Connor a959aa16be VGA: Minor - improve indentation of palette structs. 2009-05-25 00:12:18 -04:00
Kevin O'Connor e713204209 VGA: Inline several functions in vga.c.
Move some functions directly into their only caller.
Also, fix bug in handle_101210 - don't set ax.
2009-05-25 00:10:35 -04:00
Kevin O'Connor ca668640a9 VGA: Define structs for save/restore state calls.
Define C structs for the state info.
Move hw specific code to vgahw.c.
Also, make sure to set 0x1c in regs->al on state save/restore calls.
2009-05-21 23:06:08 -04:00
Kevin O'Connor a0ecb056c8 VGA: Move some ioport accesses from vga.c to vgaio.c.
Move more hardware port accesses to vgaio.c.
2009-05-18 23:34:00 -04:00
Kevin O'Connor 8bc059e9f7 VGA: Remove references to 'struct bregs' from vgaio.c code.
Move the bios interface control to vga.c.
Also, replace "biosfn_" prefix with "vgahw_".
2009-05-17 21:19:36 -04:00
Kevin O'Connor c0c7df6bf4 VGA: Extract code from vga.c into new files vgaio.c and vgafb.c.
Move hardware IO accessor functions to vgaio.c.
Move framebuffer and font manipulation code to vgafb.c.
Also, have biosfn_write_teletype use biosfn_write_char_attr/only.
Also, breakout set_scan_lines() functionality from biosfn_load_text_X.
2009-05-17 18:11:33 -04:00
Kevin O'Connor 3c3c8315c8 VGA: Fix DAC loading during mode switch.
The total dac size is stored - not the number of entries.
2009-05-17 16:16:29 -04:00
Kevin O'Connor 99e08b7fc3 VGA: Make use of regs->ebp - now that it is present in 'struct bregs'. 2009-05-17 00:07:31 -04:00
Kevin O'Connor 9f193b9883 Define unified entry points for irq handlers.
The irq entry points now push the handler address and jump to a
    function that does parameter setup.  This reduces the code size
    because the entry setup isn't repeated for every handler.
2009-05-16 23:31:27 -04:00
Kevin O'Connor f61afb897f VGA: Use GET_IVT macro instead of raw GET_FARVAR. 2009-05-16 21:32:27 -04:00
Kevin O'Connor 21079f4437 VGA: Add calling stubs for vbe functions. 2009-05-16 21:30:10 -04:00
Kevin O'Connor d113a99c84 VGA: Use segment definitions.
Don't hardcode use of 0xc000.
Use definitions for 0xb000,0xb800,0xa000.
2009-05-16 21:05:02 -04:00
Kevin O'Connor 0818e1aa2d VGA: Split biosfn_get_cursor_pos function.
Create biosfn_get_cursor_pos and biosfn_get_cursor_shape.
2009-05-16 18:00:19 -04:00
Kevin O'Connor f94ec43133 VGA: Minor - use "_far" postfix on far pointers. 2009-05-16 17:37:23 -04:00
Kevin O'Connor 5727c29f9c VGA: Rework vga_modes[] array to have pointers to other structs.
Prefer using pointers instead of indexes into arrays.
2009-05-16 17:29:32 -04:00
Kevin O'Connor dd2be77bac VGA: Misc syntax cleanups.
Use c99 variable declarations.
Postfix global pointers with "_g" and far pointers with "_far".
Other syntax cleanups.
2009-05-16 15:41:23 -04:00
Kevin O'Connor 4f79274123 VGA: Minor - use "_g" suffix for global pointers. 2009-05-16 14:55:01 -04:00
Kevin O'Connor 05c32dcc75 VGA: Add header guard to vgasrc/vgatables.h 2009-05-14 19:29:37 -04:00
Kevin O'Connor 6ace78f368 VGA: Remove unused DEBUG ifdefs. 2009-05-14 19:24:49 -04:00
Kevin O'Connor a5288ffc77 VGA: memset16_far and memcpy16_far take byte count (not word count). 2009-05-13 22:25:24 -04:00
Kevin O'Connor a12c2158f7 VGA - turn DEBUG printfs into dprintf calls. 2009-05-13 22:06:16 -04:00
Kevin O'Connor d9fc0a09f7 Cleanup vga inb/outb port usages.
Use symbolic names for ports.
Use VGAREG_ACTL_WRITE_DATA instead of VGAREG_ACTL_ADDRESS when writing
     a value to the register.
2009-05-07 22:00:25 -04:00
Kevin O'Connor 6a71970423 Minor - update vgasrc/vga.c todo list. 2009-05-06 23:40:07 -04:00
Kevin O'Connor 1f2c307bc3 Add initial port of the "open source vga bios" project.
This is an initial import of the code from:
    http://www.nongnu.org/vgabios/
The code has been ported from bcc to gcc and gas.
This is an initial import - many functions have not been ported; many
    bugs are present.
2009-05-06 23:35:59 -04:00