aboutsummaryrefslogtreecommitdiffstats
path: root/com32/lib/sys/vesa/initvesa.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-02-13 22:37:33 -0800
committerH. Peter Anvin <hpa@zytor.com>2008-02-13 22:37:33 -0800
commit545ef8479f39a162be3d37ac1253bbaa394e9681 (patch)
treef69314a56bb7901a908f1cbd72d2755ca5a26061 /com32/lib/sys/vesa/initvesa.c
parent0fa01cf03cfd6274518d82dfd0b5fc12ae6c4e48 (diff)
downloadsyslinux-545ef8479f39a162be3d37ac1253bbaa394e9681.tar.gz
syslinux-545ef8479f39a162be3d37ac1253bbaa394e9681.tar.xz
syslinux-545ef8479f39a162be3d37ac1253bbaa394e9681.zip
VESA: Minor cleanupssyslinux-3.62-pre6
Minor cleanups for clarity
Diffstat (limited to 'com32/lib/sys/vesa/initvesa.c')
-rw-r--r--com32/lib/sys/vesa/initvesa.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/com32/lib/sys/vesa/initvesa.c b/com32/lib/sys/vesa/initvesa.c
index 98888d32..0ad882b0 100644
--- a/com32/lib/sys/vesa/initvesa.c
+++ b/com32/lib/sys/vesa/initvesa.c
@@ -75,13 +75,14 @@ static int vesacon_paged_mode_ok(const struct vesa_mode_info *mi)
{
int i;
+ if (!is_power_of_2(mi->win_size) ||
+ !is_power_of_2(mi->win_grain) ||
+ mi->win_grain > mi->win_size)
+ return 0; /* Impossible... */
+
for (i = 0; i < 2; i++) {
- if ((mi->win_attr[i] & 0x05) == 0x05 &&
- mi->win_seg[i] &&
- is_power_of_2(mi->win_size) &&
- is_power_of_2(mi->win_grain) &&
- mi->win_grain <= mi->win_size)
- return 1; /* We can deal with this... */
+ if ((mi->win_attr[i] & 0x05) == 0x05 && mi->win_seg[i])
+ return 1; /* Usable window */
}
return 0; /* Nope... */
@@ -121,7 +122,8 @@ static int vesacon_set_mode(void)
/* Copy general info */
memcpy(&__vesa_info.gi, gi, sizeof *gi);
- /* Search for a 640x480 32-bit linear frame buffer mode */
+ /* Search for a 640x480 mode with a suitable color and memory model... */
+
mode_ptr = GET_PTR(gi->video_mode_ptr);
bestmode = 0;
bestpxf = PXF_NONE;