diff options
author | jkim <jkim@FreeBSD.org> | 2009-11-04 17:30:48 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2009-11-04 17:30:48 +0000 |
commit | cfa9e27db03ca5539315cbdd98d497d2f906b5b4 (patch) | |
tree | 67f55a86e1d311485be57f1f9937be106722b332 | |
parent | eeda8890030288eac660b533f5d9182642fc28b0 (diff) | |
download | FreeBSD-src-cfa9e27db03ca5539315cbdd98d497d2f906b5b4.zip FreeBSD-src-cfa9e27db03ca5539315cbdd98d497d2f906b5b4.tar.gz |
Do not probe video mode if we are not going to use it.
-rw-r--r-- | sys/dev/fb/vesa.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/sys/dev/fb/vesa.c b/sys/dev/fb/vesa.c index 6d3ffcc..5403352 100644 --- a/sys/dev/fb/vesa.c +++ b/sys/dev/fb/vesa.c @@ -1450,10 +1450,11 @@ vesa_load_state(video_adapter_t *adp, void *p) * If the current mode is not the same, probably it was powered down. * Try BIOS POST to restore a sane state. */ - mode = vesa_bios_get_current_mode(); - if (mode >= 0 && (mode & 0x1ff) != adp->va_mode && - VESA_MODE(adp->va_mode)) - (void)vesa_bios_post(); + if (VESA_MODE(adp->va_mode)) { + mode = vesa_bios_get_current_mode(); + if (mode >= 0 && (mode & 0x1ff) != adp->va_mode) + (void)vesa_bios_post(); + } ret = vesa_bios_save_restore(STATE_LOAD, ((adp_state_t *)p)->regs, vesa_state_buf_size); @@ -1461,9 +1462,10 @@ vesa_load_state(video_adapter_t *adp, void *p) /* * If the desired mode is not restored, force setting the mode. */ - mode = vesa_bios_get_current_mode(); - if (mode >= 0 && (mode & 0x1ff) != adp->va_mode && - VESA_MODE(adp->va_mode)) { + if (VESA_MODE(adp->va_mode)) { + mode = vesa_bios_get_current_mode(); + if (mode < 0 || (mode & 0x1ff) == adp->va_mode) + return (ret); mode = adp->va_mode; flags = adp->va_info.vi_flags; if ((flags & V_INFO_GRAPHICS) != 0 && |