[ros-kernel] RFC: V86/VBE Patch for release branch
Filip Navara
xnavara at volny.cz
Fri Apr 23 23:15:21 CEST 2004
Hi,
since we're in code freeze now, I'm sending the patch here with request
for merging it into release branch. There was a fatal bug that caused
'inl' (read long from I/O port) instruction to not work correctly in V86
mode and that resulted in weird behaviour with the VBE driver (on some
graphics adapters). After fixing it, the VBE driver started to work even
on VMware and I found one minor issue with palettes (swapped Red and
Blue colors) in the driver. Since the VBE driver is now used by default,
I propose to apply the attached patch also for the release. Comments?
Filip
-------------- next part --------------
--- drivers/video/miniport/vbe/vbemp.c 8 Apr 2004 09:43:35 -0000 1.6
+++ drivers/video/miniport/vbe/vbemp.c 23 Apr 2004 19:50:59 -0000
@@ -761,11 +761,11 @@
PSTATUS_BLOCK StatusBlock)
{
KV86M_REGISTERS BiosRegisters;
+ ULONG Entry;
+ PULONG OutputEntry;
if (DeviceExtension->VGACompatible)
{
- ULONG Entry;
-
for (Entry = ColorLookUpTable->FirstEntry;
Entry < ColorLookUpTable->NumEntries + ColorLookUpTable->FirstEntry;
Entry++)
@@ -780,14 +780,21 @@
else
{
/*
- * FIXME:
- * This is untested code path, it's possible that it will
- * not work at all or that Red and Blue colors will be swapped.
+ * We can't just copy the values, because we need to swap the Red
+ * and Blue values.
*/
- VideoPortMoveMemory(DeviceExtension->TrampolineMemory,
- &ColorLookUpTable->LookupTable[0].RgbArray,
- sizeof(DWORD) * ColorLookUpTable->NumEntries);
+ for (Entry = ColorLookUpTable->FirstEntry,
+ OutputEntry = DeviceExtension->TrampolineMemory;
+ Entry < ColorLookUpTable->NumEntries + ColorLookUpTable->FirstEntry;
+ Entry++, OutputEntry++)
+ {
+ *OutputEntry =
+ (ColorLookUpTable->LookupTable[Entry].RgbArray.Red << 16) |
+ (ColorLookUpTable->LookupTable[Entry].RgbArray.Green << 8) |
+ (ColorLookUpTable->LookupTable[Entry].RgbArray.Blue);
+ }
+
BiosRegisters.Eax = 0x4F09;
BiosRegisters.Ebx = 0;
BiosRegisters.Ecx = ColorLookUpTable->NumEntries;
--- ntoskrnl/ke/i386/v86m.c 30 Dec 2003 18:52:05 -0000 1.16
+++ ntoskrnl/ke/i386/v86m.c 23 Apr 2004 19:49:39 -0000
@@ -367,7 +367,7 @@
else
{
ULONG v;
- v = READ_PORT_USHORT((PUSHORT)(ULONG)ip[1]);
+ v = READ_PORT_ULONG((PULONG)(ULONG)ip[1]);
DPRINT("inl %d\t%X\n", (ULONG)ip[1], v);
Tf->Eax = v;
}
@@ -420,7 +420,7 @@
{
ULONG v;
- v = READ_PORT_USHORT((PUSHORT)(Tf->Edx & 0xFFFF));
+ v = READ_PORT_ULONG((PULONG)(Tf->Edx & 0xFFFF));
DPRINT("inl %d\t%X\n", Tf->Edx & 0xFFFF, v);
Tf->Eax = v;
}
More information about the Ros-kernel
mailing list