bochsvga: use closest value in set_dacformat
Per the VBE 2.0 and 3.0 specs, for VBE function 08h (Set/Get DAC Palette
format), if the caller requests a bits per color value that the hardware
does not support, then the next lower value supported by the hardware is
used. However, bochsvga_set_dacformat() was checking for exact matches
of either 6 or 8 bits per color channel. Adjust the checks to allow
larger values, clamping to either 8 or 6, and still indicating failure
if a value lower than 6 is requested, as there are no lower supported
values.
Signed-off-by: Daniel Verkamp <daniel@drv.nu>
Message-ID: <20260409065319.3438719-1-daniel@drv.nu>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
1 file changed