aboutsummaryrefslogtreecommitdiffstats
path: root/vgasrc/bochsvga.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2013-11-29 18:43:35 -0500
committerKevin O'Connor <kevin@koconnor.net>2013-12-04 10:34:17 -0500
commit5b6936e0e8a2dcee62cf789f25c0e18796268c42 (patch)
tree1ae66b18872c4ff5a4a9f90faa40c85c2c94cfdb /vgasrc/bochsvga.c
parent4cd522e673426e68a96e8d2a026b99e58a821ca0 (diff)
downloadseabios-5b6936e0e8a2dcee62cf789f25c0e18796268c42.tar.gz
vgabios: Load the DAC palette in "packed" modes on Cirrus and BochsVGA.
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>
Diffstat (limited to 'vgasrc/bochsvga.c')
-rw-r--r--vgasrc/bochsvga.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/vgasrc/bochsvga.c b/vgasrc/bochsvga.c
index 9425a828..27f7615e 100644
--- a/vgasrc/bochsvga.c
+++ b/vgasrc/bochsvga.c
@@ -318,14 +318,13 @@ bochsvga_set_mode(struct vgamode_s *vmode_g, int flags)
if (!GET_GLOBAL(dispi_found))
return -1;
- u8 depth = GET_GLOBAL(vmode_g->depth);
- if (depth == 4)
+ u8 memmodel = GET_GLOBAL(vmode_g->memmodel);
+ if (memmodel == MM_PLANAR)
stdvga_set_mode(stdvga_find_mode(0x6a), 0);
- if (depth == 8)
- // XXX load_dac_palette(3);
- ;
+ if (memmodel == MM_PACKED && !(flags & MF_NOPALETTE))
+ stdvga_set_packed_palette();
- dispi_write(VBE_DISPI_INDEX_BPP, depth);
+ dispi_write(VBE_DISPI_INDEX_BPP, GET_GLOBAL(vmode_g->depth));
u16 width = GET_GLOBAL(vmode_g->width);
u16 height = GET_GLOBAL(vmode_g->height);
dispi_write(VBE_DISPI_INDEX_XRES, width);
@@ -353,7 +352,7 @@ bochsvga_set_mode(struct vgamode_s *vmode_g, int flags)
stdvga_attr_mask(0x10, 0x00, 0x01);
stdvga_grdc_write(0x06, 0x05);
stdvga_sequ_write(0x02, 0x0f);
- if (depth >= 8) {
+ if (memmodel != MM_PLANAR) {
stdvga_crtc_mask(crtc_addr, 0x14, 0x00, 0x40);
stdvga_attr_mask(0x10, 0x00, 0x40);
stdvga_sequ_mask(0x04, 0x00, 0x08);