]> xenbits.xensource.com Git - seabios.git/commitdiff
vgabios: Check for relocatable windows before advertising support for it.
authorKevin O'Connor <kevin@koconnor.net>
Tue, 4 Sep 2012 17:16:36 +0000 (13:16 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Tue, 4 Sep 2012 17:16:36 +0000 (13:16 -0400)
Use the VBE_win_granularity field to determine if the memory windows
are relocatable.  (Bochs and Cirrus vga support relocatable windows
while the standard vga controller does not.)

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

index 2a8aeb1865951970c86a81e7dcb264fc1eedb0e9..938dba07c8ce1cabb7997d0f92c365b3a9bfe06f 100644 (file)
@@ -364,6 +364,7 @@ bochsvga_init(void)
     SET_VGA(VBE_framebuffer, lfb_addr);
     u32 totalmem = dispi_read(VBE_DISPI_INDEX_VIDEO_MEMORY_64K) * 64 * 1024;
     SET_VGA(VBE_total_memory, totalmem);
+    SET_VGA(VBE_win_granularity, 64);
     SET_VGA(VBE_capabilities, VBE_CAPABILITY_8BIT_DAC);
 
     dprintf(1, "VBE DISPI: lfb_addr=%x, size %d MB\n",
index 01c80719621cd20881ac2d084ea4157daec6f167..f44231bb58c8cd29b68ace95e8a31ab58c23adc0 100644 (file)
@@ -17,7 +17,7 @@
 u32 VBE_total_memory VAR16 = 256 * 1024;
 u32 VBE_capabilities VAR16;
 u32 VBE_framebuffer VAR16;
-u16 VBE_win_granularity VAR16 = 64;
+u16 VBE_win_granularity VAR16;
 
 static void
 vbe_104f00(struct bregs *regs)
@@ -91,12 +91,13 @@ vbe_104f01(struct bregs *regs)
     if (framebuffer)
         mode_attr |= VBE_MODE_ATTRIBUTE_LINEAR_FRAME_BUFFER_MODE;
     SET_FARVAR(seg, info->mode_attributes, mode_attr);
+    u32 win_granularity = GET_GLOBAL(VBE_win_granularity);
     SET_FARVAR(seg, info->winA_attributes,
-               VBE_WINDOW_ATTRIBUTE_RELOCATABLE |
+               (win_granularity ? VBE_WINDOW_ATTRIBUTE_RELOCATABLE : 0) |
                VBE_WINDOW_ATTRIBUTE_READABLE |
                VBE_WINDOW_ATTRIBUTE_WRITEABLE);
     SET_FARVAR(seg, info->winB_attributes, 0);
-    SET_FARVAR(seg, info->win_granularity, GET_GLOBAL(VBE_win_granularity));
+    SET_FARVAR(seg, info->win_granularity, win_granularity);
     SET_FARVAR(seg, info->win_size, 64); /* Bank size 64K */
     SET_FARVAR(seg, info->winA_seg, GET_GLOBAL(vmode_g->sstart));
     SET_FARVAR(seg, info->winB_seg, 0x0);