aboutsummaryrefslogtreecommitdiffstats
path: root/vgasrc/bochsvga.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2012-01-29 11:42:44 -0500
committerKevin O'Connor <kevin@koconnor.net>2012-02-01 21:58:38 -0500
commit3524453b5d5eca4ec352f099e0cc8419a1ac778d (patch)
treec4af2defabb540731dfec3f07c41d49c4b8cf4c0 /vgasrc/bochsvga.c
parent2af8ba1ab23d01006b080e57900325e35f464481 (diff)
downloadseabios-3524453b5d5eca4ec352f099e0cc8419a1ac778d.tar.gz
vgabios: Fix linelength calculations in bochsvga and vbe.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'vgasrc/bochsvga.c')
-rw-r--r--vgasrc/bochsvga.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/vgasrc/bochsvga.c b/vgasrc/bochsvga.c
index e40a1fd5..36688324 100644
--- a/vgasrc/bochsvga.c
+++ b/vgasrc/bochsvga.c
@@ -171,7 +171,8 @@ static int mode_valid(struct vgamode_s *vmode_g)
u16 width = GET_GLOBAL(vmode_g->width);
u16 height = GET_GLOBAL(vmode_g->height);
u8 depth = GET_GLOBAL(vmode_g->depth);
- u32 mem = width * height * DIV_ROUND_UP(depth, 8);
+ u32 mem = (height * DIV_ROUND_UP(width * vga_bpp(vmode_g), 8)
+ * 4 / stdvga_bpp_factor(vmode_g));
return width <= max_xres && depth <= max_bpp && mem <= max_mem;
}