Link video miniports to videoprt library only
authorHervé Poussineau <hpoussin@reactos.org>
Thu, 1 Dec 2005 19:51:08 +0000 (19:51 +0000)
committerHervé Poussineau <hpoussin@reactos.org>
Thu, 1 Dec 2005 19:51:08 +0000 (19:51 +0000)
svn path=/trunk/; revision=19801

reactos/drivers/video/miniport/vbe/vbemp.c
reactos/drivers/video/miniport/vbe/vbemp.h
reactos/drivers/video/miniport/vbe/vbemp.xml
reactos/drivers/video/miniport/vga/vgamp.c
reactos/drivers/video/miniport/vga/vgamp.h
reactos/drivers/video/miniport/vga/vgamp.xml
reactos/drivers/video/videoprt/videoprt.c
reactos/drivers/video/videoprt/videoprt.h

index d71f020..0b97194 100644 (file)
@@ -29,9 +29,6 @@
 
 #include "vbemp.h"
 
-#define NDEBUG
-#include <debug.h>
-
 /* PUBLIC AND PRIVATE FUNCTIONS ***********************************************/
 
 VP_STATUS STDCALL
@@ -80,7 +77,7 @@ VBEFindAdapter(
 static int
 VBESortModesCallback(PVBE_MODEINFO VbeModeInfoA, PVBE_MODEINFO VbeModeInfoB)
 {
-   DPRINT("VBESortModesCallback: %dx%dx%d / %dx%dx%d\n",
+   VideoPortDebugPrint(Info, "VBESortModesCallback: %dx%dx%d / %dx%dx%d\n",
       VbeModeInfoA->XResolution, VbeModeInfoA->YResolution,
       VbeModeInfoA->BitsPerPixel,
       VbeModeInfoB->XResolution, VbeModeInfoB->YResolution,
@@ -190,7 +187,7 @@ VBEInitialize(PVOID HwDeviceExtension)
 
    if (Status != NO_ERROR)
    {
-      DPRINT1("Failed to get Int 10 service functions (Status %x)\n", Status);
+      VideoPortDebugPrint(Error, "Failed to get Int 10 service functions (Status %x)\n", Status);
       return FALSE;
    }
 
@@ -209,7 +206,7 @@ VBEInitialize(PVOID HwDeviceExtension)
 
    if (Status != NO_ERROR)
    {
-      DPRINT1("Failed to allocate virtual memory (Status %x)\n", Status);
+      VideoPortDebugPrint(Error, "Failed to allocate virtual memory (Status %x)\n", Status);
       return FALSE;
    }
 
@@ -242,9 +239,9 @@ VBEInitialize(PVOID HwDeviceExtension)
          sizeof(VBEDeviceExtension->VbeInfo));
 
          /* Verify VBE is found and not anýthing else */
-         if (strncmp(VBEDeviceExtension->VbeInfo.Signature,"VESA",4) != 0)
+         if (VideoPortCompareMemory(VBEDeviceExtension->VbeInfo.Signature, "VESA", 4) != 4)
          {
-         DPRINT("No VBE BIOS present\n");
+         VideoPortDebugPrint(Warn, "No VBE BIOS present\n");
          return FALSE;
          }
       
@@ -254,7 +251,7 @@ VBEInitialize(PVOID HwDeviceExtension)
          VBEDeviceExtension->VbeInfo.Version = 0x102;
          }
                
-      DPRINT("VBE BIOS Present (%d.%d, %8ld Kb)\n",
+      VideoPortDebugPrint(Trace, "VBE BIOS Present (%d.%d, %8ld Kb)\n",
          VBEDeviceExtension->VbeInfo.Version / 0x100,
          VBEDeviceExtension->VbeInfo.Version & 0xFF,
          VBEDeviceExtension->VbeInfo.TotalMemory * 64);
@@ -265,13 +262,13 @@ VBEInitialize(PVOID HwDeviceExtension)
       if (VBEDeviceExtension->VbeInfo.Version < 0x200)
 #endif
       {
-         DPRINT("VBE BIOS present, but incompatible version.\n");
+         VideoPortDebugPrint(Warn, "VBE BIOS present, but incompatible version.\n");
          return FALSE;
       }
    }
    else
    {
-      DPRINT("No VBE BIOS found.\n");
+      VideoPortDebugPrint(Warn, "No VBE BIOS found.\n");
       return FALSE;
    }
 
@@ -308,9 +305,9 @@ VBEInitialize(PVOID HwDeviceExtension)
     */
 
    VBEDeviceExtension->ModeInfo =
-      ExAllocatePool(PagedPool, ModeCount * sizeof(VBE_MODEINFO));
+      VideoPortAllocatePool(HwDeviceExtension, VpPagedPool, ModeCount * sizeof(VBE_MODEINFO), TAG_VBE);
    VBEDeviceExtension->ModeNumbers =
-      ExAllocatePool(PagedPool, ModeCount * sizeof(WORD));
+      VideoPortAllocatePool(HwDeviceExtension, VpPagedPool, ModeCount * sizeof(WORD), TAG_VBE);
 
    /*
     * Get the actual mode infos.
@@ -372,7 +369,7 @@ VBEInitialize(PVOID HwDeviceExtension)
 
    if (SuitableModeCount == 0)
    {
-      DPRINT("VBEMP: No video modes supported\n");
+      VideoPortDebugPrint(Warn, "VBEMP: No video modes supported\n");
       return FALSE;
    }
 
@@ -388,17 +385,15 @@ VBEInitialize(PVOID HwDeviceExtension)
     * Print the supported video modes when NDEBUG is not set.
     */
 
-#ifndef NDEBUG
    for (CurrentMode = 0;
         CurrentMode < SuitableModeCount;
         CurrentMode++)
    {
-      DPRINT("%dx%dx%d\n",
+      VideoPortDebugPrint(Trace, "%dx%dx%d\n",
          VBEDeviceExtension->ModeInfo[CurrentMode].XResolution,
          VBEDeviceExtension->ModeInfo[CurrentMode].YResolution,
          VBEDeviceExtension->ModeInfo[CurrentMode].BitsPerPixel);
    }
-#endif
 
    return TRUE;
 }
@@ -746,7 +741,7 @@ VBESetCurrentMode(
    }
    else
    {
-      DPRINT1("VBEMP: VBESetCurrentMode failed (%x)\n", BiosRegisters.Eax);
+      VideoPortDebugPrint(Error, "VBEMP: VBESetCurrentMode failed (%x)\n", BiosRegisters.Eax);
       DeviceExtension->CurrentMode = -1;
    }
 
index 5085be8..14f295c 100644 (file)
@@ -28,6 +28,9 @@
 #include <ddk/video.h>
 #include <ddk/ntddvdeo.h>
 
+#define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24))
+#define TAG_VBE TAG('V', 'B', 'E', ' ')
+
 /*
  * Compile-time define to get VBE 1.2 support. The implementation
  * is far from complete now and so it's left undefined.
index 48f142c..52f7c86 100644 (file)
@@ -1,9 +1,6 @@
 <module name="vbemp" type="kernelmodedriver" installbase="system32/drivers" installname="vbemp.sys">
        <include base="vbemp">.</include>
-       <include base="ntoskrnl">include</include>
        <define name="__USE_W32API" />
-       <library>ntoskrnl</library>
-       <library>hal</library>
        <library>videoprt</library>
        <file>vbemp.c</file>
        <file>vbemp.rc</file>
index fcc2642..a45cc41 100644 (file)
@@ -526,7 +526,7 @@ BOOL  VGASetCurrentMode(IN PVIDEO_MODE  RequestedMode,
     InitVGAMode();
     return TRUE;
   } else {
-    DPRINT1("Unrecognised mode for VGASetCurrentMode\n");
+    VideoPortDebugPrint(Warn, "Unrecognised mode for VGASetCurrentMode\n");
     return FALSE;
   }
 }
index aafddf4..ac003d7 100644 (file)
@@ -27,7 +27,9 @@
 #include <ddk/miniport.h>
 #include <ddk/video.h>
 #include <ddk/ntddvdeo.h>
-#include <debug.h>
+
+#define UNIMPLEMENTED \
+   VideoPortDebugPrint(Error, "WARNING:  %s at %s:%d is UNIMPLEMENTED!\n",__FUNCTION__,__FILE__,__LINE__);
 
 void
 InitVGAMode();
index 650d1cf..0a058be 100644 (file)
@@ -1,9 +1,6 @@
 <module name="vgamp" type="kernelmodedriver" installbase="system32/drivers" installname="vgamp.sys">
        <include base="vgamp">.</include>
-       <include base="ntoskrnl">include</include>
        <define name="__USE_W32API" />
-       <library>ntoskrnl</library>
-       <library>hal</library>
        <library>videoprt</library>
        <file>initvga.c</file>
        <file>vgamp.c</file>
index 19f10f9..a958b79 100644 (file)
@@ -658,7 +658,7 @@ VideoPortDebugPrint(
    vsprintf(Buffer, DebugMessage, ap);
    va_end(ap);
 
-   DbgPrint(Buffer);
+   DbgPrintEx(DPFLTR_IHVVIDEO_ID, DebugPrintLevel, Buffer);
 }
 
 /*
index a21f752..73d214d 100644 (file)
@@ -39,6 +39,8 @@
 
 #define TAG_VIDEO_PORT  TAG('V', 'I', 'D', 'P')
 
+#define DPFLTR_IHVVIDEO_ID 0 /* FIXME */
+
 typedef struct _VIDEO_PORT_ADDRESS_MAPPING
 {
    LIST_ENTRY List;