summaryrefslogtreecommitdiff
path: root/vgasrc/vbe.c
Commit message (Collapse)AuthorAgeFilesLines
* vbe: add edid support.Gerd Hoffmann2019-05-151-0/+30
| | | | | | | | | | | VBE subfunction 0x15, read ddc data. Add VBE_edid where drivers can fill in a EDID data blob. If we find valid data there (checking the first two header bytes), then report the function as supported and hand out the data. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* SeaVGABIOS/vbe: Query driver for scanline pitch v2Patrick Rudolph2017-06-121-1/+1
| | | | | | | | | | | Query the driver for the real scanline pitch in bytes. As cbvga doesn't change the pitch on mode change, always return the same pitch, that might exceed width times Bytes-per-pixel. Report the default stdvga pitch for all other drivers. Signed-off-by: Patrick Rudolph <siro@das-labor.org>
* vgautil: Add new header file with misc function and variable definitionsKevin O'Connor2016-08-051-1/+7
| | | | | | | | Move the generic function and variable definitions from vgabios.h to a new file vgautil.h. This reduces the size and complexity of vgabios.h. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Support emulating text mode attributes while in graphics modeKevin O'Connor2014-11-121-3/+2
| | | | | | | | | Add support for simple text mode attribute emulation while in graphics mode. This improves text highlighting and background color on some boot-loaders. Enable it only for CBVGA vgabios and only when a text mode is requested. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Rename vbe_flags to flagsKevin O'Connor2014-10-271-3/+4
| | | | | | | Allow the custom bda field vbe_flags to be used for flags outside of vbe. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Don't declare custom internal BDA storage in std/bda.hKevin O'Connor2014-10-271-4/+4
| | | | | | | | | | | The vgabios uses storage in the BDA at offset 0xb9 for internal custom storage (the contents do not appear to be part of any bios standard). Move the description of this custom vgabios area from std/bda.h to vgasrc/vgabios.h. Add two new macros (GET_BDA_EXT and SET_BDA_EXT). This should make it more clear that the area is for custom internal storage. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Simplify save/restore mechanism.Kevin O'Connor2014-02-051-21/+6
| | | | | | | Reorganize the save/restore functions to eliminate some boilerplate code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Move vbe.h to std/vbe.h.Kevin O'Connor2013-09-181-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Move function definitions for output.c from util.h to new file output.h.Kevin O'Connor2013-09-181-5/+5
| | | | | | Also, sort the order of include files in the c files. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Rename util.c to string.c and introduce string.h.Kevin O'Connor2013-09-181-0/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Limit the range of the VBE number of "pages" parameter.Kevin O'Connor2013-09-181-0/+4
| | | | | | | | Looking at the output of other VGA BIOS implementations, it appears that the number of available video pages reported is always between 1 and 127. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Add support for text and cga modes to vbe_104f01().Kevin O'Connor2012-09-081-44/+64
| | | | | | Attempt to handle cga and text modes in the vbe get_mode_info call. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Check for relocatable windows before advertising support for it.Kevin O'Connor2012-09-041-3/+4
| | | | | | | | Use the VBE_win_granularity field to determine if the memory windows are relocatable. (Bochs and Cirrus vga support relocatable windows while the standard vga controller does not.) Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Ignore mode flags in vbe get_mode_info call.Kevin O'Connor2012-09-031-1/+1
| | | | | | | | Ignore any mode flags a caller may have set on the vbe get_mode_info call. The spec doesn't require ignoring of flags, but it appears at least some real-world vgabios vbe implementations do this. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Some tweaks to optimize stack space.Kevin O'Connor2012-02-131-1/+1
| | | | | | | | | | | | | | | | Gcc seems to handle passing structs by value if they are 4 bytes in size instead of 3 bytes. So, add a pad byte to struct carattr and struct cursorpos. Reorganize set_cursor_pos(), verify_scroll(), and handle_1013() so there are less live variables. Don't inline the VBE functions into the main handler code. Code calling VBE functions are newer and are more likely to provide adequate stack space - inlining can cause more stack usage for older functions (which may be stack constrained). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Claim VBE 3 support; minor VBE cleanups.Kevin O'Connor2012-02-121-10/+8
| | | | | | | Claim support for VBE3 - that spec is actually more lenient for required minimum support. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Implement VBE save/restore state function (func 04).Kevin O'Connor2012-02-041-2/+30
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Add support for VBE get/set dac palette format (func 08).Kevin O'Connor2012-02-041-2/+23
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Fix linelength calculations in bochsvga and vbe.Kevin O'Connor2012-02-011-9/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Update copyright statements in bochsvga.c and vbe.c.Kevin O'Connor2012-02-011-1/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Add VBE power management (10h) stub function.Kevin O'Connor2012-02-011-0/+21
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Add support for VBE get/set display start function.Kevin O'Connor2012-02-011-2/+31
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Add support for vbe get/set line length function.Kevin O'Connor2012-02-011-2/+27
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Add support for vesa get/set window function.Kevin O'Connor2012-02-011-3/+27
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Move BDA setting from driver code to common code.Kevin O'Connor2012-02-011-8/+4
| | | | | | | | | | 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>
* vgabios: Set cwidth/cheight/sstart in vgamode_s for cirrus/bochs.Kevin O'Connor2012-01-211-3/+3
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Make VBE code depend on a config setting.Kevin O'Connor2012-01-161-2/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Make cirrus line lengths standard.Kevin O'Connor2012-01-141-1/+1
| | | | | | | | | | 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>
* vgabios: Unify cirrus and vbe vesa functions.Kevin O'Connor2012-01-141-11/+10
| | | | | | Unify the code for the Cirrus and VBE vesa functions 00-03. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Make VBE code independent of bochsvga.Kevin O'Connor2012-01-141-36/+37
| | | | | | | | | | | 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>
* vgabios: Unify code to generate the vbe mode list.Kevin O'Connor2012-01-141-2/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Unify X_set_mode() functions.Kevin O'Connor2011-12-311-34/+8
| | | | | | | | | | | | | 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>
* vgabios: Refactor vga_set_mode and stdvga_set_mode.Kevin O'Connor2011-12-311-1/+2
| | | | | | | | | | | | | | 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>
* vgabios: Move vbe code from vgabios.c to new file vbe.c.Kevin O'Connor2011-12-311-0/+301
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Rename vbe.c to bochsvga.c.Kevin O'Connor2011-12-311-340/+0
| | | | | | | 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>
* Preliminary DISPI VBE driver implementationJulian Pidancet2011-12-201-6/+204
| | | | | | | 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>
* Partially implement VBE interface, create VBE driver skeletonJulian Pidancet2011-12-201-0/+142
Signed-off-by: Julian Pidancet <julian.pidancet@gmail.com>