aboutsummaryrefslogtreecommitdiffstats
path: root/vgasrc/bochsvga.c
Commit message (Collapse)AuthorAgeFilesLines
* vgasrc: Use curmode_g instead of vmode_g when mode is the current video modeKevin O'Connor2024-03-151-20/+20
| | | | | | | | | Many functions are passed a pointer to the current video mode vgamode_s struct. Use the name 'curmode_g' for these functions and use 'vmode_g' for functions that can accept an arbitrary video mode. Hopefully this will make the goals of the functions more clear. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* bochsvga: add edid support.Gerd Hoffmann2019-05-151-3/+16
| | | | | | Read EDID blob from mmio bar, store in VBE_edid. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* vga: move modelist from bochsvga.c to new svgamodes.cGerd Hoffmann2019-03-141-86/+16
| | | | | | So other drivers can simply use the same list too. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* vgautil: Move generic definitions from stdvga.h to vgautil.hKevin O'Connor2016-08-051-1/+1
| | | | | | | Don't use stdvga.h for function definitions of code in stdvgamodes.c and stdvgaio.c. Move them to vgautil.h. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgautil: Add new header file with misc function and variable definitionsKevin O'Connor2016-08-051-1/+2
| | | | | | | | 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>
* vga: rework virtio-vga supportGerd Hoffmann2015-06-111-4/+1
| | | | | | | | Unlike planned earlier virtio-vga will be compatible with the qemu stdvga, with the framebuffer in bar 0. Drop the virtio-vga chunk, update comment accordingly. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* vgabios: fix graphics operation with Bochs VGA in non-DISPI modesPaolo Bonzini2015-01-061-8/+19
| | | | | | | | | For legacy VGA modes that do not set the VBE_DISPI_ENABLED bit, bochsvga_get_linelength returns 0. Thus all characters are squashed into the first scanline. Fix this by falling back to stdvga for the legacy modes. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* vga: rework bar detection, add virtio-vgaGerd Hoffmann2014-03-061-4/+12
| | | | | | | | | | | | Replace the heuristic which checks the bar 0 attributes to figure whenever bar 0 or bar 1 has the linear framebuffer with a vendor id check. Add support for virtio-vga which uses bar 2 for the linear framebuffer. Cc: Dave Airlie <airlied@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* vgabios: Simplify save/restore mechanism.Kevin O'Connor2014-02-051-35/+19
| | | | | | | Reorganize the save/restore functions to eliminate some boilerplate code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Avoid possible divide by zero in bochsvga_set_displaystart.Kevin O'Connor2013-12-041-0/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Add bochsvga "HDTV" resolutions.Kevin O'Connor2013-12-041-0/+9
| | | | | | | The same set of video modes were added to the "lgpl vgabios" in release 0.7a. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Load the DAC palette in "packed" modes on Cirrus and BochsVGA.Kevin O'Connor2013-12-041-7/+6
| | | | | | | This is a port of a patch applied to the "lgpl vgabios" tree (that was released in its v0.7a release). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Remove ioport.h; disperse its contents to other header files.Kevin O'Connor2013-09-281-0/+12
| | | | | | | Move the inb(), insb(), etc. code from ioport.h to x86.h. Move the PORT_* definitions to their appropriate hardware files. 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>
* vgabios: Rename stdvga_bpp_factor to stdvga_vram_ratio.Kevin O'Connor2013-09-181-1/+1
| | | | | | Invert the values returned by stdvga_bpp_factor and rename it. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* bochsvga: fallback to stdvga if dispi interface isn't presentGerd Hoffmann2013-09-161-19/+48
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* Move code centered around specific hardware devices to src/hw/Kevin O'Connor2013-09-021-2/+2
| | | | | | Move many C files from the src/ directory to the new src/hw/ directory. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Enable VGA output when settings bochs-specific modeDavid Woodhouse2013-02-161-0/+1
| | | | | | | | When used from OVMF+CSM, we got no video output. It appears that we were never enabling the display output except when configuring a text mode. Which never happens, in the OVMF+CSM case. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* Normalize POST initialization function name suffixes.Kevin O'Connor2013-02-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The POST phase has to invoke many initialization functions, and these functions can have complex inter-dependencies. Try to categorize the functions into 4 classes: preinit - functions called very early in POST where function ordering is very important and the code has limited access to other interfaces. init - functions that initialize internal interfaces and standard external interfaces. This code is generally not dependent on particular hardware and typically does not communicate directly with any hardware devices. setup - functions which access hardware or are dependent on particular hardware or platform devices. prepboot - functions that finalize internal interfaces and that prepare for the boot phase. This patch attempts to normalize the suffixes - functions that used _init(), _setup(), _finalize(), or similar that did not follow the above pattern were renamed. Other than function name changes, there should be no code impact to this patch. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Check for relocatable windows before advertising support for it.Kevin O'Connor2012-09-041-0/+1
| | | | | | | | 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>
* vga: fix bochs lfb size displayGerd Hoffmann2012-02-061-1/+1
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* vgabios: Implement VBE save/restore state function (func 04).Kevin O'Connor2012-02-041-0/+65
| | | | 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-0/+21
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Handle VGA option rom being re-run.Kevin O'Connor2012-02-021-0/+3
| | | | | | | | 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>
* vgabios: Move bocshvga mode checking from runtime to init.Kevin O'Connor2012-02-011-94/+85
| | | | | | Check mode validity at init. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Rework bochsvga mode switching.Kevin O'Connor2012-02-011-36/+6
| | | | | | | Make the bochsvga mode switch more similar to the original lgpl vgabios code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Fix linelength calculations in bochsvga and vbe.Kevin O'Connor2012-02-011-1/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: handle vmware vga in bochsvga.Kevin O'Connor2012-02-011-4/+13
| | | | | | | | | | | 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>
* vgabios: Update copyright statements in bochsvga.c and vbe.c.Kevin O'Connor2012-02-011-0/+8
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Add support for VBE get/set display start function.Kevin O'Connor2012-02-011-0/+21
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Add support for vbe get/set line length function.Kevin O'Connor2012-02-011-0/+15
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Add support for vesa get/set window function.Kevin O'Connor2012-02-011-0/+19
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Move BDA setting from driver code to common code.Kevin O'Connor2012-02-011-17/+13
| | | | | | | | | | 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-61/+61
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Check that the PCI BDF passed in is valid before using.Kevin O'Connor2012-01-191-5/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Make VBE code depend on a config setting.Kevin O'Connor2012-01-161-1/+0
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Use standard VGA IO wrapper functions in bochsvga.Kevin O'Connor2012-01-161-34/+19
| | | | | | | 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>
* vgabios: Add cirrus linear framebuffer detection; enable VBE in cirrus.Kevin O'Connor2012-01-141-22/+4
| | | | | | | | | | | 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>
* vgabios: Make VBE code independent of bochsvga.Kevin O'Connor2012-01-141-89/+48
| | | | | | | | | | | 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-12/+6
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Use vgamode_s in cirrus and bochsvga mode tables.Kevin O'Connor2012-01-141-90/+81
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Add memmodel field to bochsvga mode list.Kevin O'Connor2012-01-141-61/+62
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Unify X_init() functions.Kevin O'Connor2011-12-311-8/+7
| | | | | | | | | | | | 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>
* vgabios: Unify X_set_mode() functions.Kevin O'Connor2011-12-311-5/+30
| | | | | | | | | | | | | 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/+1
| | | | | | | | | | | | | | 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: Rename vgaio.c to stdvga.c.Kevin O'Connor2011-12-311-0/+1
| | | | | | Also, introduce stdvga.h. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Rename vga.c to vgabios.c.Kevin O'Connor2011-12-311-2/+2
| | | | | | Also, rename vgatables.h to vgabios.h. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Use bochsvga_ prefix for bochs vga functions.Kevin O'Connor2011-12-311-17/+16
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Rename vbe.c to bochsvga.c.Kevin O'Connor2011-12-311-0/+340
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>