diff options
author | jkim <jkim@FreeBSD.org> | 2009-09-24 20:10:00 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2009-09-24 20:10:00 +0000 |
commit | f5566212dcd57dc91adbe46c8d4db8bac0d55160 (patch) | |
tree | f8545d85347c9c8beb613d85cc8134284f35a569 /sys/dev/fb | |
parent | 0ff0c1c38fc4bdb3d6c2ffc812e10068420d8886 (diff) | |
download | FreeBSD-src-f5566212dcd57dc91adbe46c8d4db8bac0d55160.zip FreeBSD-src-f5566212dcd57dc91adbe46c8d4db8bac0d55160.tar.gz |
Some broken VESA BIOSes, e.g., IBM T23, return wrong value from
vesa_bios_get_line_length() in graphics mode. Always calculate the value
from known video info instead.
Submitted by: paradox (ddkprog yahoo com)
Diffstat (limited to 'sys/dev/fb')
-rw-r--r-- | sys/dev/fb/vesa.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/dev/fb/vesa.c b/sys/dev/fb/vesa.c index fca4eb0..17dd8da 100644 --- a/sys/dev/fb/vesa.c +++ b/sys/dev/fb/vesa.c @@ -1132,10 +1132,8 @@ vesa_set_mode(video_adapter_t *adp, int mode) vesa_adp->va_window_gran = info.vi_window_gran; } vesa_adp->va_window_orig = 0; - len = vesa_bios_get_line_length(); - if (len > 0) { - vesa_adp->va_line_width = len; - } else if (info.vi_flags & V_INFO_GRAPHICS) { + + if (info.vi_flags & V_INFO_GRAPHICS) { switch (info.vi_depth/info.vi_planes) { case 1: vesa_adp->va_line_width = info.vi_width/8; @@ -1161,6 +1159,9 @@ vesa_set_mode(video_adapter_t *adp, int mode) } } else { vesa_adp->va_line_width = info.vi_width; + len = vesa_bios_get_line_length(); + if (len > 0) + vesa_adp->va_line_width = len; } vesa_adp->va_disp_start.x = 0; vesa_adp->va_disp_start.y = 0; |