Author: jkim Date: Tue Mar 23 22:50:22 2010 New Revision: 205558 URL: http://svn.freebsd.org/changeset/base/205558
Log: Fall back to VGA palette functions if VESA function failed and DAC is still in 6-bit mode. Although we have to check non-VGA compatibility bit here, it seems there are too many broken VESA BIOSes out to rely on it. Modified: head/sys/dev/fb/vesa.c Modified: head/sys/dev/fb/vesa.c ============================================================================== --- head/sys/dev/fb/vesa.c Tue Mar 23 22:35:52 2010 (r205557) +++ head/sys/dev/fb/vesa.c Tue Mar 23 22:50:22 2010 (r205558) @@ -1241,7 +1241,6 @@ vesa_set_mode(video_adapter_t *adp, int if ((vesa_adp_info->v_flags & V_DAC8) != 0 && (info.vi_flags & V_INFO_GRAPHICS) != 0 && - (info.vi_flags & V_INFO_NONVGA) != 0 && vesa_bios_set_dac(8) > 6) adp->va_flags |= V_ADP_DAC8; @@ -1323,10 +1322,12 @@ vesa_save_palette(video_adapter_t *adp, { int bits; - if (adp == vesa_adp && VESA_MODE(adp->va_mode) && - (adp->va_info.vi_flags & V_INFO_NONVGA) != 0) { + if (adp == vesa_adp && VESA_MODE(adp->va_mode)) { bits = (adp->va_flags & V_ADP_DAC8) != 0 ? 8 : 6; - return (vesa_bios_save_palette(0, 256, palette, bits)); + if (vesa_bios_save_palette(0, 256, palette, bits) == 0) + return (0); + if (bits > 6) + return (1); } return ((*prevvidsw->save_palette)(adp, palette)); @@ -1337,10 +1338,12 @@ vesa_load_palette(video_adapter_t *adp, { int bits; - if (adp == vesa_adp && VESA_MODE(adp->va_mode) && - (adp->va_info.vi_flags & V_INFO_NONVGA) != 0) { + if (adp == vesa_adp && VESA_MODE(adp->va_mode)) { bits = (adp->va_flags & V_ADP_DAC8) != 0 ? 8 : 6; - return (vesa_bios_load_palette(0, 256, palette, bits)); + if (vesa_bios_load_palette(0, 256, palette, bits) == 0) + return (0); + if (bits > 6) + return (1); } return ((*prevvidsw->load_palette)(adp, palette)); @@ -1545,8 +1548,6 @@ get_palette(video_adapter_t *adp, int ba return (1); if (!VESA_MODE(adp->va_mode)) return (1); - if ((adp->va_info.vi_flags & V_INFO_NONVGA) == 0) - return (1); bits = (adp->va_flags & V_ADP_DAC8) != 0 ? 8 : 6; r = malloc(count * 3, M_DEVBUF, M_WAITOK); @@ -1583,8 +1584,6 @@ set_palette(video_adapter_t *adp, int ba return (1); if (!VESA_MODE(adp->va_mode)) return (1); - if ((adp->va_info.vi_flags & V_INFO_NONVGA) == 0) - return (1); bits = (adp->va_flags & V_ADP_DAC8) != 0 ? 8 : 6; r = malloc(count * 3, M_DEVBUF, M_WAITOK); _______________________________________________ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"