vgabios: Minor fixes to struct vbe_info definition.
authorKevin O'Connor <kevin@koconnor.net>
Fri, 30 Dec 2011 21:37:20 +0000 (16:37 -0500)
committerKevin O'Connor <kevin@koconnor.net>
Fri, 30 Dec 2011 21:37:20 +0000 (16:37 -0500)
Although the VBE3 spec says there is 189 bytes of pad at the end of
the vbe_info struct, the spec also says the total struct size should
be 256 bytes.  The VBE2 spec uses sufficient pad to get to 256 bytes.
So, assume the spec was off by one and make the pad 190 bytes.

Also, use u32 for capabilities and 'struct segoff_s' for
win_func_ptr.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
src/vbe.h
vgasrc/vga.c

index bfcd6b4149e2db3a6a7d9cd200ff21a070866842..386613c752534062054aab725d63c2d1f08d01b1 100644 (file)
--- a/src/vbe.h
+++ b/src/vbe.h
@@ -11,7 +11,7 @@ struct vbe_info {
     u32 signature;
     u16 version;
     struct segoff_s oem_string;
     u32 signature;
     u16 version;
     struct segoff_s oem_string;
-    u8 capabilities[4];
+    u32 capabilities;
     struct segoff_s video_mode;
     u16 total_memory;
     u16 oem_revision;
     struct segoff_s video_mode;
     u16 total_memory;
     u16 oem_revision;
@@ -30,7 +30,7 @@ struct vbe_mode_info {
     u16 win_size;
     u16 winA_seg;
     u16 winB_seg;
     u16 win_size;
     u16 winA_seg;
     u16 winB_seg;
-    u32 win_func_ptr;
+    struct segoff_s win_func_ptr;
     u16 bytes_per_scanline;
     /* VBE 1.2 */
     u16 xres;
     u16 bytes_per_scanline;
     /* VBE 1.2 */
     u16 xres;
@@ -71,7 +71,7 @@ struct vbe_mode_info {
     u8 linear_alpha_size;
     u8 linear_alpha_pos;
     u32 pixclock_max;
     u8 linear_alpha_size;
     u8 linear_alpha_pos;
     u32 pixclock_max;
-    u8 reserved[189];
+    u8 reserved[190];
 } PACKED;
 
 struct vbe_crtc_info {
 } PACKED;
 
 struct vbe_crtc_info {
index 37f227c078598fb2141fa54ba8cf1b005c6e3bc5..539cd7aa959a179058bb38451972990e663fb000 100644 (file)
@@ -1226,7 +1226,7 @@ handle_104f00(struct bregs *regs)
 
     SET_FARVAR(seg, info->oem_string,
             SEGOFF(get_global_seg(), (u32)VBE_OEM_STRING));
 
     SET_FARVAR(seg, info->oem_string,
             SEGOFF(get_global_seg(), (u32)VBE_OEM_STRING));
-    SET_FARVAR(seg, info->capabilities[0], 0x1); /* 8BIT DAC */
+    SET_FARVAR(seg, info->capabilities, 0x1); /* 8BIT DAC */
 
     /* We generate our mode list in the reserved field of the info block */
     SET_FARVAR(seg, info->video_mode, SEGOFF(seg, regs->di + 34));
 
     /* We generate our mode list in the reserved field of the info block */
     SET_FARVAR(seg, info->video_mode, SEGOFF(seg, regs->di + 34));
@@ -1284,7 +1284,7 @@ handle_104f01(struct bregs *regs)
     SET_FARVAR(seg, info->win_size, 64); /* Bank size 64K */
     SET_FARVAR(seg, info->winA_seg, 0xA000);
     SET_FARVAR(seg, info->winB_seg, 0x0);
     SET_FARVAR(seg, info->win_size, 64); /* Bank size 64K */
     SET_FARVAR(seg, info->winA_seg, 0xA000);
     SET_FARVAR(seg, info->winB_seg, 0x0);
-    SET_FARVAR(seg, info->win_func_ptr, 0x0);
+    SET_FARVAR(seg, info->win_func_ptr.segoff, 0x0);
     SET_FARVAR(seg, info->bytes_per_scanline, modeinfo.linesize);
     SET_FARVAR(seg, info->xres, modeinfo.width);
     SET_FARVAR(seg, info->yres, modeinfo.height);
     SET_FARVAR(seg, info->bytes_per_scanline, modeinfo.linesize);
     SET_FARVAR(seg, info->xres, modeinfo.width);
     SET_FARVAR(seg, info->yres, modeinfo.height);