freebsd-dev/sys/dev/fb
Bruce Evans 3a98d83edb Reset the DAC to 6-bit mode before calling the BIOS to set the screen
mode.  This works around bugs in at least 2 Intel BIOSes for our
subsequent setting of the DAC back to 8-bit mode.  The bug caused dark
(mostly 1/4-intensity) colors for all except the first setting to a
VESA graphics mode (including for settings to the current mode).

Remove restoration (with less bits) of the palette in vesa_unload()
after resetting the DAC to 6-bit mode.  Depend on the BIOS to keep
the palette consistent with the DAC for the simpler reset case like
we do everywhere else in places that are actually important.

Setting the video mode should reset everything to defaults, although
we usually don't want that.  Even the buggy BIOSes set the DAC to the
default 6-bit mode, and set the palette to a default that matches the
DAC.  We don't undo the reset for most things, but we do undo it for
the DAC (more precisely, we change to an 8-bit DAC if possible, and
this is the only way that we set to an 8-bit DAC; it is accidental
that if the DAC was in 8-bit mode from a previous mode switch then
setting it to 8-bit mode is an undo).  The buggy BIOSes are confused
by our setting of the DAC to 8-bit mode in the "undo" case.  They
should multiply palette entries by 4 to match, but they actually leave
all palette entries except #2 (green) and #248-255 (unused) untouched.
Green is mysteriously scaled from 0x2a to 0x6a, and #248-255 are scaled
correctly.

Our support for the 8-bit DAC had almost no effect except to enable
bugs.  Syscons barely supports 16 colors, so it doesn't benefit much
from having a palette with 16 million colors instead of only 256K.
Applications can manage the palette using FBIO_{GET,SET}PALETTE, but
the palette managed by this is only used in the less interesting modes
(text and non-truecolor graphics modes up to 8 bits wide), and the
kernel loses the changes on any mode switch (including to another vt
in a different mode).
2017-04-02 08:39:32 +00:00
..
boot_font.c
creator_vt.c
creator.c sys: use our nitems() macro when param.h is available. 2016-04-21 19:40:10 +00:00
creatorreg.h
fb_if.m
fb.c Remove pc98 support completely. 2017-01-28 02:22:15 +00:00
fbd.c Provide way for framebuffer driver to request mmap(2) mapping type 2016-10-01 17:43:02 +00:00
fbreg.h
gallant12x22.c
gfb.h
machfb.c sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
machfbreg.h
s3_pci.c
splash_bmp.c Remove pc98 support completely. 2017-01-28 02:22:15 +00:00
splash_pcx.c
splash_txt.c
splash.c sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
splashreg.h
vesa.c Reset the DAC to 6-bit mode before calling the BIOS to set the screen 2017-04-02 08:39:32 +00:00
vesa.h
vga.c Fix 3 entries in mode tables related to mono and 90-column text modes. 2017-03-26 14:31:29 +00:00
vgareg.h