aboutsummaryrefslogtreecommitdiffstats
path: root/vgasrc
Commit message (Collapse)AuthorAgeFilesLines
* stdvga: Add stdvga_set_vertical_size() helper functionKevin O'Connor2024-04-053-7/+13
| | | | | | | | Add helper function and update the bochsvga.c code to use it. This emphasizes the relationship between stdvga_get_vertical_size() and stdvga_set_vertical_size() code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stdvga: Rename stdvga_get_vde() to stdvga_get_vertical_size()Kevin O'Connor2024-04-053-7/+7
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stdvga: Rename stdvga_set_scan_lines() to stdvga_set_character_height()Kevin O'Connor2024-04-053-8/+8
| | | | | Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stdvga: Rename stdvga_set_text_block_specifier() to stdvga_set_font_location()Kevin O'Connor2024-04-053-9/+9
| | | | | Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stdvga: Rework stdvga palette index paging interface functionsKevin O'Connor2024-04-053-17/+26
| | | | | | Rename the functions to make them a little easier to understand. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stdvga: Rename stdvga_toggle_intensity() to stdvga_set_palette_blinking()Kevin O'Connor2024-04-053-4/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stdvga: Add comments to interface functions in stdvga.cKevin O'Connor2024-04-051-1/+22
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stdvga: Rename CGA palette functionsKevin O'Connor2024-04-053-13/+18
| | | | | | | | | | Rename stdvga_set_border_color() to stdvga_set_cga_background_color() and stdvga_set_palette() to stdvga_set_cga_palette(). These functions implement compatibility for old CGA cards - rename them so they are not confused with the functions that manipulte the VGA palette. Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stdvgamodes: Improve naming of dac palette tablesKevin O'Connor2024-03-311-42/+50
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stdvgamodes: No need to store pelmask in vga_modes[]Kevin O'Connor2024-03-311-19/+18
| | | | | | The pelmask is always 0xff so no need to store in a static table. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgasrc: Rename vgahw_get_linesize() to vgahw_minimum_linelength()Kevin O'Connor2024-03-156-21/+27
| | | | | | | | Make the relationship between vgahw_get_linelength() and vgahw_get_linesize() more clear by renaming it to vgahw_minimum_linelength(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgasrc: Use curmode_g instead of vmode_g when mode is the current video modeKevin O'Connor2024-03-1514-207/+206
| | | | | | | | | 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>
* vbe: implement function 09h (get/set palette data)Daniel Verkamp2024-03-151-0/+58
| | | | | | | | | | | | | | | | | | | | | Since the VBE mode attributes indicate that all modes are not VGA compatible, applications must use VBE function 09h to manipulate the palette rather than directly accessing the VGA registers. This implementation uses the standard VGA registers for all hardware, which may not be appropriate; I only verified qemu -device VGA. Without this patch, the get/set palette function returns an error code, so programs that use 8-bit indexed color modes fail. For example, Quake (DOS) printed "Error: Unable to load VESA palette" and exited when trying to set a SVGA mode like 640x480, but with the patch it succeeds. This fixes qemu issue #251 and #1862. <https://gitlab.com/qemu-project/qemu/-/issues/251> <https://gitlab.com/qemu-project/qemu/-/issues/1862> Signed-off-by: Daniel Verkamp <daniel@drv.nu> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgasrc: round up save/restore sizeDaniel Verkamp2024-03-122-2/+2
| | | | | | | | | When calculating the size of the buffer required for the VGA/VBE state, round up rather than truncating when dividing the number of bytes to get the number of 64-byte blocks. Without this modification, the save state function will write past the end of a buffer of the size requested. Signed-off-by: Daniel Verkamp <daniel@drv.nu>
* vbe: Add VBE 2.0+ OemData field to struct vbe_infoDaniel Verkamp2024-03-101-1/+3
| | | | | | | | | | | | | | | | | Per the VBE 2.0 specification, the VBE controller information is 512 bytes long when the "VBE2" signature is provided, instead of the original 256 bytes. src/bootsplash.c uses the original pre-VBE-2.0 256-byte structure while also filling in the "VBE2" signature, so a video BIOS that makes use of the VBE2 OemData area could write past the end of the allocated region. The original bootsplash code did not have this bug; it was introduced when the bootsplash VBE structures were merged with the VGA ROM struct definitions. Fixes: 69e941c159ed ("Merge bootsplash and VGA ROM vbe structure definitions") Signed-off-by: Daniel Verkamp <daniel@drv.nu>
* vgasrc: Don't use VAR16 in header files to fix gcc warningKevin O'Connor2021-12-181-2/+2
| | | | | | | Some versions of gcc complain when VAR16 is used in both the header and C files - use only in the C file to fix the warning. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* svgamodes: add standard 4k modesGerd Hoffmann2021-12-181-0/+8
| | | | | | | | | | | Add all three 4k modes. Computer monitors typically use the first one (3840x2160). Add 16 and 32 bpp variants. 24bpp is dead these days, and software which is so old that still uses those modes most likely doesn't even know what 4k is. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* vgasrc: ignore .node.gnu.property (binutils-2.36 support)Sergei Trofimovich2021-05-261-1/+8
| | | | | | | | | | | | | | | Modern binutils unconditionally tracks x86_64 ISA levels in intermediate files in .note.gnu.property. Custom liker script does not handle the section and complains about it: ld --gc-sections -T out/vgasrc/vgalayout.lds out/vgaccode16.o \ out/vgaentry.o out/vgaversion.o -o out/vgarom.o ld: section .note.gnu.property LMA [0000000000000000,0000000000000027] \ overlaps section .text LMA [0000000000000000,00000000000098af] The change ignores .note* sections. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* vgabios: Fix preserve memory flag in handle_1000Kevin O'Connor2020-07-131-4/+3
| | | | | | | | | Commit 5108c69c made a change to the ordering of some code which broke the check for the MF_NOCLEARMEM flag. Reported by felix.von.s@posteo.de Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vga: fix cirrus biosGerd Hoffmann2020-06-251-1/+1
| | | | | | | | | Little mistake, big effect. The patch adding the ati driver broke cirrus due to a missing "else", which effectively downgrades cirrus to standard vga. Fixes: 34b6ecc16074 ("vga: add atiext driver") Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* ramfb: add copyright and license to ramfb.cGerd Hoffmann2019-10-281-0/+6
| | | | | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* bochsdisplay: add copyright and license to bochsdisplay.cGerd Hoffmann2019-10-281-0/+6
| | | | | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* svgamodes: Add copyright notice to vgasrc/svgamodes.cKevin O'Connor2019-10-281-0/+8
| | | | | | | Commit 004f5b3a moved part of vgasrc/bochsvga.c to vgasrc/svgamodes.c - copy over the copyright statements as well. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Remove dos line endings introduced in the last two commitsUwe Kleine-König2019-10-212-17/+17
| | | | | | | | | | | These were added somewhere between the mailing list server and Gerd's working copy (as the patch I got via the mailing list is fine). These don't disturb the compiler, but they look ugly so remove them. Reported-by: Paul Menzel <pmenzel@molgen.mpg.de> Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org> Message-Id: <20191020200726.20116-1-uwe@kleine-koenig.org> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* Add additional resolutions for 16:9 displays: 1600x900 and 2560x1440Uwe Kleine-König2019-10-181-0/+8
| | | | | | | | | | | | This allows to have qemu run at the native screen resolution of my (physical) monitor. This is inspired by a patch created by Andreas Dangel that I found on https://adangel.org/2015/09/11/qemu-kvm-custom-resolutions/ . Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org> Message-Id: <20191017203353.18898-2-uwe@kleine-koenig.org> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* cbvga: reuse svga modes definitions from svgamodes.cUwe Kleine-König2019-10-181-71/+9
| | | | | | | | | | | | | | For cbvga only modes with MM_DIRECT are usable, so skip the other ones. This effectively adds the following modes: { 0x10D, { MM_DIRECT, 320, 200, 15, 8, 16, SEG_GRAPH } }, { 0x10E, { MM_DIRECT, 320, 200, 16, 8, 16, SEG_GRAPH } }, { 0x10F, { MM_DIRECT, 320, 200, 24, 8, 16, SEG_GRAPH } }, { 0x140, { MM_DIRECT, 320, 200, 32, 8, 16, SEG_GRAPH } }, Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org> Message-Id: <20191017203353.18898-1-uwe@kleine-koenig.org> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* ati-vga: add rage128 edid supportGerd Hoffmann2019-06-241-0/+25
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* ati-vga: try vga ddc firstGerd Hoffmann2019-06-241-0/+9
| | | | | | | Try vga ddc bus before dvi ddc bus. Return early in case we got valid data. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* ati-vga: make i2c register and bits configurableGerd Hoffmann2019-06-241-7/+27
| | | | | | | Prepare to support other ati cards. Also log access mode and whenever we got a valid edid block. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* ati-vga: fix ati_read()Gerd Hoffmann2019-06-241-1/+1
| | | | | | | Cut & paste bug probably. Had no bad effect so far because the code doesn't read registers larger than 0x100. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* ati-vga: make less verboseGerd Hoffmann2019-06-241-1/+1
| | | | | | Reduce loglevel for mode line removals from 1 to 3. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* bochsdisplay: parse resolution from edid.Gerd Hoffmann2019-05-151-8/+16
| | | | | | Then use the resolution for the framebuffer. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* bochsdisplay: add edid support.Gerd Hoffmann2019-05-151-1/+7
| | | | | | Read EDID blob from mmio bar, store in VBE_edid. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* 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>
* ati: add edid support.Gerd Hoffmann2019-05-151-0/+114
| | | | | | Read EDID blob via i2c, store in VBE_edid. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* vbe: add edid support.Gerd Hoffmann2019-05-152-0/+31
| | | | | | | | | | | 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>
* vga: add ati bios tablesGerd Hoffmann2019-03-152-0/+46
| | | | | | | Needed to make drivers happy which try to gather informations from these tables. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* vga: add atiext driverGerd Hoffmann2019-03-154-0/+270
| | | | | | | | | | | | Supports qemu emulated ati cards. They have been added in qemu 4.0. Acceleration support (in qemu) is pretty rough still. A simple framebuffer works fine though. Available models: * ati rage 128 pro * ati rv100 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* vga: make memcpy_high() publicGerd Hoffmann2019-03-142-2/+2
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* vga: move modelist from bochsvga.c to new svgamodes.cGerd Hoffmann2019-03-143-86/+108
| | | | | | So other drivers can simply use the same list too. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* SeaVGABios/cbvga: Fix bpp for coreboot framebufferMatt DeVillier2018-09-181-2/+8
| | | | | | | | | | | | | | | | Commit 4b42cc4 [SeaVGABios/cbvga: Advertise correct pixel format] neglected to wrap the cbfb mask size components in GET_FARVAR(), which resulted in a bogus value for bpp, breaking output on most/all devices. Fix this by adding GET_FARVAR() as appropriate. Additionally, some newer ChromeOS devices still fail even with this fix, so fall back to using the coreboot reported bit depth if the calculated valid is invalid. TEST: build/boot a variety of devices (google/[reef,eve], purism/librem_skl) using coreboot framebuffer init, verify SeaBIOS boot menu prompt visible. Signed-off-by: Matt DeVillier <matt.devillier@puri.sm>
* cbvga_set_mode: refine clear display logicGerd Hoffmann2018-06-261-8/+10
| | | | | | | There is no need to skip text mode clearing. Clearing the framebuffer should be safe on legacy calls too. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* qemu: add qemu ramfb supportGerd Hoffmann2018-06-224-13/+188
| | | | | | | | | | | | | | | | | Add support for qemu ramfb. This is a simple boot framebuffer device, with normal ram being used to back the framebuffer and fw_cfg being used to configure the device. Use case (on x86): boot display for vgpu devices (which neither emulate vga nor have a vgabios). Sharing fw_cfg code with seabios turned out to be difficuilt due to various dependencies the code has on infrastructure which only seabios has. So include a copy of the code here, with those dependencies removed and also stripped down because we don't need a non-dma fallback here. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* vgasrc: add allocate_pmm()Gerd Hoffmann2018-06-222-16/+33
| | | | | | Factor out pmm allocation function from stack allocator. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* bochs_display_setup: return error on failureGerd Hoffmann2018-06-221-1/+1
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* cbvga_set_mode: disable clearmem in windows x86 emulator.Gerd Hoffmann2018-06-221-1/+9
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* cbvga_list_modes: don't list current mode twiceGerd Hoffmann2018-06-221-1/+5
| | | | | | | In case we've already added the framebuffer video mode to the list do not add number 0x140. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* cbvga_setup_modes: use real mode number instead of 0x140Gerd Hoffmann2018-06-221-0/+5
| | | | | | | In case the framebuffer size matches one of the cbvga video modes just use that mode number instead of 0x140. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* qemu: add bochs-display supportGerd Hoffmann2018-06-224-13/+94
| | | | | | | | | | Use coreboot text mode emulation to also support the qemu bochs-display device. This is a new display device supporting simple linear framebuffers, using the bochs register interface. No support for legacy vga (text modes, planar modes, cga modes, 8bpp palette modes all dropped). The bochs interface is compatible with the qemu stdvga. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* cbvga: factor out cbvga_setup_modes()Gerd Hoffmann2018-06-222-25/+33
| | | | | | Factor out generic data structure setup code from cbvga_setup(). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>