Commit Graph

20 Commits

Author SHA1 Message Date
Kevin O'Connor 1588fd1437 vgasrc: Rename vgahw_get_linesize() to vgahw_minimum_linelength()
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>
2024-03-15 19:50:29 -04:00
Kevin O'Connor d73e18bb70 vgasrc: Use curmode_g instead of vmode_g when mode is the current video mode
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>
2024-03-15 10:58:57 -04:00
Uwe Kleine-König 120996f147 Remove dos line endings introduced in the last two commits
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>
2019-10-21 08:49:53 +02:00
Uwe Kleine-König dc5cc91aa1 cbvga: reuse svga modes definitions from svgamodes.c
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>
2019-10-18 12:07:12 +02:00
Matt DeVillier bf8e4f902c SeaVGABios/cbvga: Fix bpp for coreboot framebuffer
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>
2018-09-18 13:35:30 -04:00
Gerd Hoffmann 69ea6dabeb cbvga_set_mode: refine clear display logic
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>
2018-06-26 09:16:31 +02:00
Gerd Hoffmann ddbb6da350 cbvga_set_mode: disable clearmem in windows x86 emulator.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2018-06-22 07:44:07 +02:00
Gerd Hoffmann 0c2b3b1d95 cbvga_list_modes: don't list current mode twice
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>
2018-06-22 07:44:07 +02:00
Gerd Hoffmann 902bacb5f0 cbvga_setup_modes: use real mode number instead of 0x140
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>
2018-06-22 07:44:07 +02:00
Gerd Hoffmann 4d70b24b86 cbvga: factor out cbvga_setup_modes()
Factor out generic data structure setup code from cbvga_setup().

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2018-06-22 07:44:07 +02:00
Patrick Rudolph e30d51cc58 SeaVGABios/cbvga: Advertise compatible VESA modes
Advertise compatible VESA modes, that are smaller or equal to
coreboot's active framebuffer. Only modes that have the same Bpp
are advertise and can be selected.

Allows the Windows 7 bootloader NTLDR to show up in VESA mode.
Allows to show the Windows 7 boot logo.
Allows Windows to boot in safe mode and in normal boot using
VgaSave driver with resolution up to 1600x1200.

This fixes most likely other bootloader and operating systems as well,
in case the are relying on VESA framebuffer support.

Signed-off-by: Patrick Rudolph <siro@das-labor.org>
2017-06-12 15:25:12 -04:00
Patrick Rudolph 6b69446de7 SeaVGABios/cbvga: Use active mode to clear screen
As coreboot framebuffer is immutable always use CBmodeinfo.

Signed-off-by: Patrick Rudolph <siro@das-labor.org>
2017-06-12 15:17:10 -04:00
Patrick Rudolph 4902b8a703 SeaVGABIOS/vbe: Query driver for scanline pitch v2
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>
2017-06-12 15:17:09 -04:00
Patrick Rudolph 4b42cc4b31 SeaVGABios/cbvga: Advertise correct pixel format
Accumulate the pixel format's bits instead relying on coreboot's
bits_per_pixel, which says nothing about the active pixel format.

Allows VBE to correctly advertise XRGB8 and BGRX8 framebuffer formats,
commonly used by coreboot.

Fixes at least Windows Bootloader and gfxboot.

Signed-off-by: Patrick Rudolph <siro@das-labor.org>
2017-06-12 15:10:05 -04:00
Kevin O'Connor 65bc0a7bc9 vgautil: Move definitions from cbvga.h and clext.h to vgautil.h
These files only need to export simple function definitions - move
them to vgautil.h.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-08-05 11:53:32 -04:00
Kevin O'Connor 2f2ec113be vgautil: Add new header file with misc function and variable definitions
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>
2016-08-05 11:28:19 -04:00
Kevin O'Connor 0397e80528 vgafb: Move header definitions from vgabios.h to new file vgafb.h
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-08-04 17:53:45 -04:00
Kevin O'Connor b4eb6fc5cc vgabios: Add software cursor capability
Add mechanism for drawing a cursor to the framebuffer to implement a
cursor in software.  The timer interrupt is "hooked" so that the
cursor can blink.  This can be useful for "coreboot native vga".

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-11-12 12:17:57 -05:00
Kevin O'Connor 6fed307251 vgabios: Support emulating text mode attributes while in graphics mode
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>
2014-11-12 12:17:57 -05:00
Kevin O'Connor 7c79029e43 vgabios: Initial support for coreboot native vga vgabios.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-04-11 11:26:23 -04:00