Commit in reactos/drivers/video/displays/vga on MAIN
objects/screen.c+28-61.1 -> 1.2
main/enable.c+3-51.2 -> 1.3
vgaddi.h+11.1 -> 1.2
+32-11
3 modified files

- Use the miniport services to map the frame buffer.

reactos/drivers/video/displays/vga/objects
screen.c 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- screen.c	10 Jan 2004 14:39:20 -0000	1.1
+++ screen.c	16 Mar 2004 21:11:44 -0000	1.2
@@ -1,4 +1,5 @@
 #include "../vgaddi.h"
+#include "../vgavideo/vgavideo.h"
 
 static WORD PaletteBuffer[] = {
    16, 0, // 16 entries, start with 0
@@ -101,9 +102,33 @@
   return modes.NumModes;
 }
 
+BOOL DeinitVGA(PPDEV ppdev)
+{
+  VIDEO_MEMORY VideoMemory;
+  ULONG ReturnedDataLength;
+
+  VideoMemory.RequestedVirtualAddress = (PVOID)ppdev->fbScreen;
+
+  if (EngDeviceIoControl(ppdev->KMDriver,
+			 IOCTL_VIDEO_UNMAP_VIDEO_MEMORY,
+			 (PVOID)&VideoMemory,
+			 sizeof(VIDEO_MEMORY),
+			 NULL,
+			 0,
+			 &ReturnedDataLength))
+    {
+      DbgPrint("Failed to unmap video memory.\n");
+      DbgBreakPoint();
+      return(FALSE);
+    }
+  return(TRUE);
+}
+
 BOOL InitVGA(PPDEV ppdev, BOOL bFirst)
 {
   ULONG ReturnedDataLength;
+  VIDEO_MEMORY VideoMemory;
+  VIDEO_MEMORY_INFORMATION VideoMemoryInfo;
 
   ppdev->sizeSurf.cx = 640;
   ppdev->sizeSurf.cy = 480;
@@ -142,11 +167,7 @@
     return(FALSE);
   }
 
-/*
-
-gotta fix this up.. it prevents drawing to vidmem right now
-
-    if (bFirst) {
+  if (bFirst) {
       // map video memory into virtual memory
       VideoMemory.RequestedVirtualAddress = NULL;
 
@@ -162,7 +183,8 @@
       }
 
       ppdev->fbScreen = VideoMemoryInfo.FrameBufferBase;
+      vidmem = (PUCHAR)ppdev->fbScreen;
    }
-*/
+
   return TRUE;
 }

reactos/drivers/video/displays/vga/main
enable.c 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- enable.c	4 Mar 2004 23:11:43 -0000	1.2
+++ enable.c	16 Mar 2004 21:11:44 -0000	1.3
@@ -1,9 +1,9 @@
 /*
  * entry.c
  *
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
  * $Author: dwelch $
- * $Date: 2004/03/04 23:11:43 $
+ * $Date: 2004/03/16 21:11:44 $
  *
  */
 
@@ -189,9 +189,6 @@
 
   vgaPreCalc();
 
-  // FIXME: Use Vidport to map the memory properly
-  vidmem = (char *)(0xd0000000 + 0xa0000);
-
   VGADDI_InitializeOffScreenMem((640 * 480) >> 3, 65536 - ((640 * 480) >> 3));
 
   DriveEnableData->pdrvfn = FuncList;
@@ -367,6 +364,7 @@
   PDEVSURF pdsurf = ppdev->AssociatedSurf;
   CHECKPOINT;
   DPRINT( "KMDriver: %x\n", ppdev->KMDriver );
+  DeinitVGA(ppdev);
   //  EngFreeMem(pdsurf->BankSelectInfo);
   CHECKPOINT;
   if (pdsurf->BankInfo != NULL) {

reactos/drivers/video/displays/vga
vgaddi.h 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- vgaddi.h	10 Jan 2004 14:39:20 -0000	1.1
+++ vgaddi.h	16 Mar 2004 21:11:44 -0000	1.2
@@ -201,6 +201,7 @@
 #define DEVSURF_IDENT   ('V' + ('S' << 8) + ('R' << 16) + ('F' << 24))
 
 BOOL InitVGA(PPDEV ppdev, BOOL bFirst); // screen.c: initialize VGA mode
+BOOL DeinitVGA(PPDEV ppdev); // screen.c: Free resources allocated in InitVGA
 
 #define DRIVER_EXTRA_SIZE 0
 #define ALLOC_TAG  TAG('D', 'v', 'g', 'a') // Dvga tag
CVSspam 0.2.8