Changeset 32622 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Miniport
- Timestamp:
- Sep 17, 2010 8:18:39 PM (14 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Miniport
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/Helper.cpp
r29625 r32622 16 16 // enable backdoor logging 17 17 //#define LOG_ENABLED 18 #ifndef VBOX WDDM18 #ifndef VBOX_WITH_WDDM 19 19 extern "C" 20 20 { … … 29 29 #include <VBox/VBoxGuestLib.h> 30 30 31 #ifndef VBOX WDDM31 #ifndef VBOX_WITH_WDDM 32 32 /* the video miniport headers not compatible with the NT DDK headers */ 33 33 typedef struct _VIDEO_POINTER_ATTRIBUTES … … 44 44 #define VIDEO_MODE_COLOR_POINTER 0x04 // 1 if a color hardware pointer is 45 45 // supported. 46 #endif /* #ifndef VBOX WDDM */46 #endif /* #ifndef VBOX_WITH_WDDM */ 47 47 48 48 #include "Helper.h" -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/Makefile.kmk
r32496 r32622 67 67 68 68 69 ifdef VBOX WDDM69 ifdef VBOX_WITH_WDDM 70 70 # 71 71 # VBoxVideoWddm … … 79 79 VBoxVideoWddm_SDKS=WINDDKWLH 80 80 VBoxVideoWddm_DEFS += VBOX_WITH_8BPP_MODES 81 VBoxVideoWddm_DEFS += VBOX_WITH_HGSMI VBOX WDDM81 VBoxVideoWddm_DEFS += VBOX_WITH_HGSMI VBOX_WITH_WDDM 82 82 ifdef VBOX_WITH_VIDEOHWACCEL 83 83 VBoxVideoWddm_DEFS += VBOX_WITH_VIDEOHWACCEL … … 124 124 $(VBOX_LIB_IPRT_GUEST_R0_NT4) \ 125 125 $(VBOX_PATH_ADDITIONS_LIB)/HGSMIGuestR0Lib$(VBOX_SUFF_LIB) 126 endif # VBOX WDDM126 endif # VBOX_WITH_WDDM 127 127 128 128 include $(KBUILD_PATH)/subfooter.kmk -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.cpp
r32039 r32622 58 58 int vboxVbvaEnable (PDEVICE_EXTENSION pDevExt, ULONG ulEnable, VBVAENABLERESULT *pVbvaResult); 59 59 60 #ifndef VBOX WDDM60 #ifndef VBOX_WITH_WDDM 61 61 ULONG DriverEntry(IN PVOID Context1, IN PVOID Context2) 62 62 { … … 165 165 } 166 166 167 #endif /* #ifndef VBOX WDDM */167 #endif /* #ifndef VBOX_WITH_WDDM */ 168 168 169 169 /* … … 252 252 #endif /* VBOX_WITH_MULTIMONITOR_FIX */ 253 253 254 #ifdef VBOX WDDM254 #ifdef VBOX_WITH_WDDM 255 255 /* preferred mode index */ 256 256 static uint32_t gPreferredVideoMode = 0; … … 349 349 /* size of the VRAM in bytes */ 350 350 351 #ifndef VBOX WDDM351 #ifndef VBOX_WITH_WDDM 352 352 ULONG vramSize = DeviceExtension->pPrimary->u.primary.ulMaxFrameBufferSize; 353 353 #else … … 442 442 VideoModes[gNumVideoModes].BlueMask = 0xFF; 443 443 VideoModes[gNumVideoModes].AttributeFlags = VIDEO_MODE_GRAPHICS | VIDEO_MODE_COLOR | VIDEO_MODE_NO_OFF_SCREEN; 444 #ifdef VBOX WDDM444 #ifdef VBOX_WITH_WDDM 445 445 gPreferredVideoMode = gNumVideoModes; 446 446 #endif … … 487 487 488 488 /* does the host like that mode? */ 489 #ifndef VBOX WDDM489 #ifndef VBOX_WITH_WDDM 490 490 if (!vboxLikesVideoMode(DeviceExtension->iDevice, resolutionMatrix[matrixIndex].xRes, resolutionMatrix[matrixIndex].yRes - yOffset, 8)) 491 491 #else … … 553 553 554 554 /* does the host like that mode? */ 555 #ifndef VBOX WDDM555 #ifndef VBOX_WITH_WDDM 556 556 if (!vboxLikesVideoMode(DeviceExtension->iDevice, resolutionMatrix[matrixIndex].xRes, resolutionMatrix[matrixIndex].yRes - yOffset, 16)) 557 557 #else … … 618 618 619 619 /* does the host like that mode? */ 620 #ifndef VBOX WDDM620 #ifndef VBOX_WITH_WDDM 621 621 if (!vboxLikesVideoMode(DeviceExtension->iDevice, resolutionMatrix[matrixIndex].xRes, resolutionMatrix[matrixIndex].yRes - yOffset, 24)) 622 622 #else … … 682 682 683 683 /* does the host like that mode? */ 684 #ifndef VBOX WDDM684 #ifndef VBOX_WITH_WDDM 685 685 if (!vboxLikesVideoMode(DeviceExtension->iDevice, resolutionMatrix[matrixIndex].xRes, resolutionMatrix[matrixIndex].yRes - yOffset, 32)) 686 686 #else … … 724 724 */ 725 725 int curKeyNo = 0; 726 #ifdef VBOX WDDM726 #ifdef VBOX_WITH_WDDM 727 727 int fPreferredSet = 0; 728 728 #endif … … 770 770 771 771 /* third test: does the host like the video mode? */ 772 #ifndef VBOX WDDM772 #ifndef VBOX_WITH_WDDM 773 773 if (!vboxLikesVideoMode(DeviceExtension->iDevice, xres, yres, bpp)) 774 774 #else … … 779 779 dprintf(("VBoxVideo: adding mode from registry: xres = %d, yres = %d, bpp = %d\n", xres, yres, bpp)); 780 780 781 #ifdef VBOX WDDM781 #ifdef VBOX_WITH_WDDM 782 782 if (!fPreferredSet) 783 783 { … … 825 825 VideoModes[gNumVideoModes].GreenMask = 0xFF00; 826 826 VideoModes[gNumVideoModes].BlueMask = 0xFF; 827 #ifdef VBOX WDDM827 #ifdef VBOX_WITH_WDDM 828 828 /* 32-bit mode is more preferable, select it if not yet */ 829 829 if (fPreferredSet < 2) … … 945 945 #endif /* VBOX_WITH_MULTIMONITOR_FIX */ 946 946 { 947 #ifndef VBOX WDDM947 #ifndef VBOX_WITH_WDDM 948 948 dprintf(("VBoxVideo: adding custom video mode as #%d, current mode: %d \n", gNumVideoModes + 1, DeviceExtension->CurrentMode)); 949 949 /* handle the startup case */ … … 979 979 xres &= 0xfff8; 980 980 /* take the current values for the fields that are not set */ 981 #ifndef VBOX WDDM981 #ifndef VBOX_WITH_WDDM 982 982 if (DeviceExtension->CurrentMode != 0) 983 983 { … … 1006 1006 1007 1007 /* does the host like that mode? */ 1008 #ifndef VBOX WDDM1008 #ifndef VBOX_WITH_WDDM 1009 1009 if (vboxLikesVideoMode(DeviceExtension->iDevice, xres, yres, bpp)) 1010 1010 #else … … 1046 1046 BOOLEAN fAlternatedIndex = FALSE; 1047 1047 #endif /* VBOX_WITH_MULTIMONITOR_FIX */ 1048 #ifndef VBOX WDDM1048 #ifndef VBOX_WITH_WDDM 1049 1049 if (DeviceExtension->CurrentMode != 0) 1050 1050 #else … … 1080 1080 dprintf(("VBoxVideo: fNewInvocation = %d, fAlternatedIndex = %d\n", fNewInvocation, fAlternatedIndex)); 1081 1081 #endif /* VBOX_WITH_MULTIMONITOR_FIX */ 1082 #ifdef VBOX WDDM1082 #ifdef VBOX_WITH_WDDM 1083 1083 /* assign host-supplied as the most preferable */ 1084 1084 gPreferredVideoMode = gNumVideoModes; … … 1152 1152 1153 1153 /* for the startup case, we need this mode twice due to the alternating mode number */ 1154 #ifndef VBOX WDDM1154 #ifndef VBOX_WITH_WDDM 1155 1155 if (DeviceExtension->CurrentMode == 0) 1156 1156 #else … … 1239 1239 { 1240 1240 int i; 1241 #ifndef VBOX WDDM1241 #ifndef VBOX_WITH_WDDM 1242 1242 dprintf(("VBoxVideo: VideoModes (CurrentMode = %d, last #%d)\n", DeviceExtension->CurrentMode, gNumVideoModes)); 1243 1243 #endif … … 1256 1256 #endif 1257 1257 1258 #ifdef VBOX WDDM1258 #ifdef VBOX_WITH_WDDM 1259 1259 vboxWddmBuildResolutionTable(); 1260 1260 #endif … … 1263 1263 } 1264 1264 1265 #ifdef VBOX WDDM1265 #ifdef VBOX_WITH_WDDM 1266 1266 static bool g_bModesTableInitialized = false; 1267 1267 /** … … 1421 1421 ULONG VideoRamLength = ulSize; 1422 1422 VP_STATUS Status; 1423 #ifndef VBOX WDDM1423 #ifndef VBOX_WITH_WDDM 1424 1424 ULONG inIoSpace = 0; 1425 1425 … … 1468 1468 if (ppv) 1469 1469 { 1470 #ifndef VBOX WDDM1470 #ifndef VBOX_WITH_WDDM 1471 1471 /* The pHostFlags field is mapped through pvAdapterInformation. It must be cleared first, 1472 1472 * and it must be done in a way which avoids races with the interrupt handler. … … 1495 1495 if (*ppv) 1496 1496 { 1497 #ifndef VBOX WDDM1497 #ifndef VBOX_WITH_WDDM 1498 1498 VideoPortUnmapMemory(PrimaryExtension, *ppv, NULL); 1499 1499 #else … … 1509 1509 #ifndef VBOX_WITH_HGSMI 1510 1510 1511 # ifdef VBOX WDDM1511 # ifdef VBOX_WITH_WDDM 1512 1512 /* sanity check */ 1513 1513 # error WDDM is supported only for HGSMI-based driver … … 1797 1797 #endif /* !VBOX_WITH_HGSMI */ 1798 1798 1799 #ifndef VBOX WDDM1799 #ifndef VBOX_WITH_WDDM 1800 1800 1801 1801 VP_STATUS VBoxVideoFindAdapter(IN PVOID HwDeviceExtension, … … 2105 2105 } 2106 2106 # endif /* #if defined(VBOX_WITH_HGSMI) && defined(VBOX_WITH_VIDEOHWACCEL) */ 2107 #endif /* #ifndef VBOX WDDM */2107 #endif /* #ifndef VBOX_WITH_WDDM */ 2108 2108 /** 2109 2109 * Send a request to the host to make the absolute pointer visible … … 2115 2115 /* Use primary device extension, because the show pointer request should be processed 2116 2116 * in vboxUpdatePointerShape regardless of the device. */ 2117 #ifndef VBOX WDDM2117 #ifndef VBOX_WITH_WDDM 2118 2118 PDEVICE_EXTENSION PrimaryExtension = ((PDEVICE_EXTENSION)HwDeviceExtension)->pPrimary; 2119 2119 #else … … 2145 2145 } 2146 2146 2147 #ifndef VBOX WDDM2147 #ifndef VBOX_WITH_WDDM 2148 2148 /** 2149 2149 * VBoxVideoStartIO … … 2911 2911 return NO_ERROR; 2912 2912 } 2913 #endif /* #ifndef VBOX WDDM */2913 #endif /* #ifndef VBOX_WITH_WDDM */ 2914 2914 2915 2915 /** … … 2947 2947 BOOLEAN FASTCALL VBoxVideoSetCurrentModePerform(PDEVICE_EXTENSION DeviceExtension, 2948 2948 USHORT width, USHORT height, USHORT bpp 2949 #ifdef VBOX WDDM2949 #ifdef VBOX_WITH_WDDM 2950 2950 , ULONG offDisplay 2951 2951 #endif … … 2962 2962 VBoxVideoCmnPortWriteUshort((PUSHORT)VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_ENABLE); 2963 2963 VBoxVideoCmnPortWriteUshort((PUSHORT)VBE_DISPI_IOPORT_DATA, VBE_DISPI_ENABLED | VBE_DISPI_LFB_ENABLED); 2964 #ifdef VBOX WDDM2964 #ifdef VBOX_WITH_WDDM 2965 2965 /* encode linear offDisplay to xOffset & yOffset to ensure offset fits USHORT */ 2966 2966 ULONG cbLine = VBOXWDDM_ROUNDBOUND(((width * bpp) + 7) / 8, 4); … … 2986 2986 } 2987 2987 2988 #ifndef VBOX WDDM2988 #ifndef VBOX_WITH_WDDM 2989 2989 2990 2990 /** … … 3184 3184 return TRUE; 3185 3185 } 3186 #endif /* ifndef VBOX WDDM */3186 #endif /* ifndef VBOX_WITH_WDDM */ 3187 3187 /* 3188 3188 * VBoxVideoSetColorRegisters … … 3219 3219 } 3220 3220 3221 #ifndef VBOX WDDM3221 #ifndef VBOX_WITH_WDDM 3222 3222 3223 3223 VP_STATUS VBoxVideoGetChildDescriptor( -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.h
r32496 r32622 29 29 30 30 RT_C_DECLS_BEGIN 31 #ifndef VBOX WDDM31 #ifndef VBOX_WITH_WDDM 32 32 #include "dderror.h" 33 33 #include "devioctl.h" … … 106 106 107 107 /* common API types */ 108 #ifndef VBOX WDDM108 #ifndef VBOX_WITH_WDDM 109 109 typedef PSPIN_LOCK VBOXVCMNSPIN_LOCK, *PVBOXVCMNSPIN_LOCK; 110 110 typedef UCHAR VBOXVCMNIRQL, *PVBOXVCMNIRQL; … … 202 202 * The primary extension is the first one. 203 203 */ 204 #ifndef VBOX WDDM204 #ifndef VBOX_WITH_WDDM 205 205 struct _DEVICE_EXTENSION *pPrimary; /* Pointer to the primary device extension. */ 206 206 … … 240 240 * This is mapped by miniport separately. 241 241 */ 242 #ifdef VBOX WDDM242 #ifdef VBOX_WITH_WDDM 243 243 VBOXVDMAINFO Vdma; 244 244 # ifdef VBOXVDMA_WITH_VBVA … … 281 281 /* The IO Port Number for guest commands. */ 282 282 RTIOPORT IOPortGuest; 283 # ifndef VBOX WDDM283 # ifndef VBOX_WITH_WDDM 284 284 /* Video Port API dynamically picked up at runtime for binary backwards compatibility with older NT versions */ 285 285 VBOXVIDEOPORTPROCS VideoPortProcs; … … 303 303 #endif /* VBOX_WITH_HGSMI */ 304 304 305 #ifdef VBOX WDDM305 #ifdef VBOX_WITH_WDDM 306 306 PDEVICE_OBJECT pPDO; 307 307 … … 331 331 } DEVICE_EXTENSION, *PDEVICE_EXTENSION; 332 332 333 #ifndef VBOX WDDM333 #ifndef VBOX_WITH_WDDM 334 334 #define DEV_MOUSE_HIDDEN(dev) ((dev)->pPrimary->u.primary.fMouseHidden) 335 335 #define DEV_SET_MOUSE_HIDDEN(dev) \ … … 354 354 extern "C" 355 355 { 356 #ifndef VBOX WDDM356 #ifndef VBOX_WITH_WDDM 357 357 /* XPDM-WDDM common API */ 358 358 … … 801 801 BOOLEAN FASTCALL VBoxVideoSetCurrentModePerform(PDEVICE_EXTENSION DeviceExtension, 802 802 USHORT width, USHORT height, USHORT bpp 803 #ifdef VBOX WDDM803 #ifdef VBOX_WITH_WDDM 804 804 , ULONG offDisplay 805 805 #endif … … 864 864 DECLINLINE(void) VBoxHGSMIHostWrite(PDEVICE_EXTENSION PrimaryExtension, ULONG data) 865 865 { 866 #ifndef VBOX WDDM866 #ifndef VBOX_WITH_WDDM 867 867 VBoxVideoCmnPortWriteUlong((PULONG)PrimaryExtension->pPrimary->u.primary.IOPortHost, data); 868 868 #else … … 873 873 DECLINLINE(ULONG) VBoxHGSMIHostRead(PDEVICE_EXTENSION PrimaryExtension) 874 874 { 875 #ifndef VBOX WDDM875 #ifndef VBOX_WITH_WDDM 876 876 return VBoxVideoCmnPortReadUlong((PULONG)PrimaryExtension->pPrimary->u.primary.IOPortHost); 877 877 #else … … 882 882 DECLINLINE(void) VBoxHGSMIGuestWrite(PDEVICE_EXTENSION PrimaryExtension, ULONG data) 883 883 { 884 #ifndef VBOX WDDM884 #ifndef VBOX_WITH_WDDM 885 885 VBoxVideoCmnPortWriteUlong((PULONG)PrimaryExtension->pPrimary->u.primary.IOPortGuest, data); 886 886 #else … … 891 891 DECLINLINE(ULONG) VBoxHGSMIGuestRead(PDEVICE_EXTENSION PrimaryExtension) 892 892 { 893 #ifndef VBOX WDDM893 #ifndef VBOX_WITH_WDDM 894 894 return VBoxVideoCmnPortReadUlong((PULONG)PrimaryExtension->pPrimary->u.primary.IOPortGuest); 895 895 #else … … 901 901 902 902 VOID VBoxSetupDisplaysHGSMI (PDEVICE_EXTENSION PrimaryExtension, 903 #ifndef VBOX WDDM903 #ifndef VBOX_WITH_WDDM 904 904 PVIDEO_PORT_CONFIG_INFO pConfigInfo, 905 905 #endif … … 909 909 uint32_t cbLength); 910 910 911 #ifdef VBOX WDDM911 #ifdef VBOX_WITH_WDDM 912 912 int VBoxFreeDisplaysHGSMI(PDEVICE_EXTENSION PrimaryExtension); 913 913 #else -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideoHGSMI.cpp
r32241 r32622 187 187 uint16_t u16Op) 188 188 { 189 #ifdef VBOX WDDM189 #ifdef VBOX_WITH_WDDM 190 190 /* @todo: add synchronization */ 191 191 #endif … … 195 195 void vboxHGSMIBufferFree (PDEVICE_EXTENSION PrimaryExtension, void *pvBuffer) 196 196 { 197 #ifdef VBOX WDDM197 #ifdef VBOX_WITH_WDDM 198 198 /* @todo: add synchronization */ 199 199 #endif … … 228 228 229 229 /* Allocate the IO buffer. */ 230 #ifndef VBOX WDDM230 #ifndef VBOX_WITH_WDDM 231 231 if (PrimaryExtension->pPrimary != PrimaryExtension) 232 232 { … … 348 348 return rc; 349 349 } 350 #ifndef VBOX WDDM350 #ifndef VBOX_WITH_WDDM 351 351 static int vbvaInitInfoDisplay (PDEVICE_EXTENSION PrimaryExtension, void *pvContext, void *pvData) 352 352 { … … 439 439 if(RT_SUCCESS (rc)) 440 440 { 441 #ifndef VBOX WDDM441 #ifndef VBOX_WITH_WDDM 442 442 rc = vboxCallVBVA (PrimaryExtension, 443 443 VBVA_INFO_VIEW, … … 481 481 } 482 482 483 #ifndef VBOX WDDM483 #ifndef VBOX_WITH_WDDM 484 484 VP_STATUS vboxWaitForSingleObjectVoid(IN PVOID HwDeviceExtension, IN PVOID Object, IN PLARGE_INTEGER Timeout OPTIONAL) 485 485 { … … 712 712 */ 713 713 VOID VBoxSetupDisplaysHGSMI(PDEVICE_EXTENSION PrimaryExtension, 714 #ifndef VBOX WDDM714 #ifndef VBOX_WITH_WDDM 715 715 PVIDEO_PORT_CONFIG_INFO pConfigInfo, 716 716 #endif … … 726 726 */ 727 727 PrimaryExtension->pNext = NULL; 728 #ifndef VBOX WDDM728 #ifndef VBOX_WITH_WDDM 729 729 PrimaryExtension->pPrimary = PrimaryExtension; 730 730 PrimaryExtension->iDevice = 0; … … 734 734 PrimaryExtension->u.primary.ulVbvaEnabled = 0; 735 735 PrimaryExtension->u.primary.bVBoxVideoSupported = FALSE; 736 #ifndef VBOX WDDM736 #ifndef VBOX_WITH_WDDM 737 737 PrimaryExtension->u.primary.cDisplays = 1; 738 738 #endif … … 862 862 if (PrimaryExtension->u.primary.bHGSMI) 863 863 { 864 #ifndef VBOX WDDM864 #ifndef VBOX_WITH_WDDM 865 865 typedef VP_STATUS (*PFNCREATESECONDARYDISPLAY)(PVOID, PVOID *, ULONG); 866 866 PFNCREATESECONDARYDISPLAY pfnCreateSecondaryDisplay = NULL; … … 891 891 } 892 892 893 #ifndef VBOX WDDM893 #ifndef VBOX_WITH_WDDM 894 894 PDEVICE_EXTENSION pPrev = PrimaryExtension; 895 895 … … 932 932 } 933 933 934 #ifndef VBOX WDDM934 #ifndef VBOX_WITH_WDDM 935 935 /* Now when the number of monitors is known and extensions are created, 936 936 * calculate the layout of framebuffers. … … 950 950 } 951 951 952 #ifdef VBOX WDDM952 #ifdef VBOX_WITH_WDDM 953 953 if (PrimaryExtension->u.primary.bHGSMI) 954 954 { … … 1061 1061 } 1062 1062 1063 #ifdef VBOX WDDM1063 #ifdef VBOX_WITH_WDDM 1064 1064 int VBoxFreeDisplaysHGSMI(PDEVICE_EXTENSION PrimaryExtension) 1065 1065 { … … 1175 1175 uint32_t cbLength) 1176 1176 { 1177 #ifndef VBOX WDDM1177 #ifndef VBOX_WITH_WDDM 1178 1178 PDEVICE_EXTENSION PrimaryExtension = DeviceExtension->pPrimary; 1179 1179 … … 1318 1318 static int vboxVBVACreateChannelContexts(PDEVICE_EXTENSION PrimaryExtension, VBVA_CHANNELCONTEXTS ** ppContext) 1319 1319 { 1320 #ifndef VBOX WDDM1320 #ifndef VBOX_WITH_WDDM 1321 1321 uint32_t cDisplays = (uint32_t)PrimaryExtension->u.primary.cDisplays; 1322 1322 #else … … 1349 1349 } 1350 1350 1351 #ifndef VBOX WDDM1351 #ifndef VBOX_WITH_WDDM 1352 1352 DECLCALLBACK(void) hgsmiHostCmdComplete (HVBOXVIDEOHGSMI hHGSMI, struct _VBVAHOSTCMD * pCmd) 1353 1353 { … … 1447 1447 { 1448 1448 VBVAHOSTCMDEVENT *pEventCmd = VBVAHOSTCMD_BODY(pCur, VBVAHOSTCMDEVENT); 1449 #ifndef VBOX WDDM1449 #ifndef VBOX_WITH_WDDM 1450 1450 PEVENT pEvent = (PEVENT)pEventCmd->pEvent; 1451 1451 pCallbacks->PrimaryExtension->u.primary.VideoPortProcs.pfnSetEvent(
Note:
See TracChangeset
for help on using the changeset viewer.