Changeset 33226 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Miniport
- Timestamp:
- Oct 19, 2010 10:37:24 AM (14 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Miniport
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.cpp
r33165 r33226 1381 1381 #endif 1382 1382 1383 int VBoxMapAdapterMemory (PDEVICE_EXTENSION PrimaryExtension, void **ppv, ULONG ulOffset, ULONG ulSize) 1384 { 1383 int VBoxMapAdapterMemory (PVBOXVIDEO_COMMON pCommon, void **ppv, ULONG ulOffset, ULONG ulSize) 1384 { 1385 PDEVICE_EXTENSION PrimaryExtension = commonToPrimaryExt(pCommon); 1385 1386 dprintf(("VBoxVideo::VBoxMapAdapterMemory 0x%08X[0x%X]\n", ulOffset, ulSize)); 1386 1387 … … 1650 1651 1651 1652 dprintf(("VBoxVideo::VBoxVideoFindAdapter: calling VideoPortGetAccessRanges\n")); 1652 1653 /* pPrimary is not yet set */1654 ((PDEVICE_EXTENSION)HwDeviceExtension)->u.primary.commonInfo.IOPortHost = (RTIOPORT)VGA_PORT_HGSMI_HOST;1655 ((PDEVICE_EXTENSION)HwDeviceExtension)->u.primary.commonInfo.IOPortGuest = (RTIOPORT)VGA_PORT_HGSMI_GUEST;1656 1653 1657 1654 VIDEO_ACCESS_RANGE tmpRanges[4]; … … 1695 1692 dprintf(("VBoxVideo::VBoxVideoFindAdapter: VbglInit returned 0x%x\n", rc)); 1696 1693 1694 /* Preinitialize the primary extension. 1695 */ 1696 ((PDEVICE_EXTENSION)HwDeviceExtension)->pNext = NULL; 1697 ((PDEVICE_EXTENSION)HwDeviceExtension)->pPrimary = (PDEVICE_EXTENSION)HwDeviceExtension; 1698 ((PDEVICE_EXTENSION)HwDeviceExtension)->iDevice = 0; 1699 ((PDEVICE_EXTENSION)HwDeviceExtension)->ulFrameBufferOffset = 0; 1700 ((PDEVICE_EXTENSION)HwDeviceExtension)->ulFrameBufferSize = 0; 1701 ((PDEVICE_EXTENSION)HwDeviceExtension)->u.primary.ulVbvaEnabled = 0; 1702 ((PDEVICE_EXTENSION)HwDeviceExtension)->u.primary.cDisplays = 1; 1703 VBoxVideoCmnMemZero(&((PDEVICE_EXTENSION)HwDeviceExtension)->areaDisplay, sizeof(HGSMIAREA)); 1697 1704 /* Guest supports only HGSMI, the old VBVA via VMMDev is not supported. Old 1698 1705 * code will be ifdef'ed and later removed. … … 2202 2209 { 2203 2210 dprintf(("VBoxVideo::VBoxVideoStartIO: IOCTL_VIDEO_INTERPRET_DISPLAY_MEMORY\n")); 2204 2205 if (pDevExt->pPrimary->u.primary.bVBoxVideoSupported) 2206 { 2207 /* The display driver must have prepared the monitor information. */ 2208 VideoPortWritePortUshort((PUSHORT)VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_VBOX_VIDEO); 2209 VideoPortWritePortUlong((PULONG)VBE_DISPI_IOPORT_DATA, VBOX_VIDEO_INTERPRET_DISPLAY_MEMORY_BASE + pDevExt->iDevice); 2210 } 2211 else 2212 { 2213 RequestPacket->StatusBlock->Status = ERROR_INVALID_FUNCTION; 2214 } 2215 Result = pDevExt->pPrimary->u.primary.bVBoxVideoSupported; 2211 /* Pre-HGSMI IOCTL */ 2212 RequestPacket->StatusBlock->Status = ERROR_INVALID_FUNCTION; 2213 Result = false; 2216 2214 break; 2217 2215 } -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.h
r33165 r33226 268 268 ULONG ulVbvaEnabled; /* Indicates that VBVA mode is enabled. */ 269 269 270 BOOLEAN bVBoxVideoSupported; /* TRUE if VBoxVideo extensions, including DualView, are supported by the host. */271 272 270 int cDisplays; /* Number of displays. */ 273 271 … … 342 340 return &pExt->u.primary.commonInfo; 343 341 #endif 342 } 343 344 static inline PDEVICE_EXTENSION commonToPrimaryExt(PVBOXVIDEO_COMMON pCommon) 345 { 346 return RT_FROM_MEMBER(pCommon, DEVICE_EXTENSION, u.primary.commonInfo); 344 347 } 345 348 … … 843 846 PSTATUS_BLOCK StatusBlock); 844 847 845 int VBoxMapAdapterMemory (P DEVICE_EXTENSION PrimaryExtension,848 int VBoxMapAdapterMemory (PVBOXVIDEO_COMMON pCommon, 846 849 void **ppv, 847 850 ULONG ulOffset, -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideoHGSMI.cpp
r33165 r33226 728 728 PrimaryExtension)); 729 729 730 /* Preinitialize the primary extension. 731 * Note: bVBoxVideoSupported is set to FALSE, because HGSMI is active instead. 732 * Note 2: shouldn't be needed for WDDM. 733 */ 734 PrimaryExtension->pNext = NULL; 735 #ifndef VBOX_WITH_WDDM 736 PrimaryExtension->pPrimary = PrimaryExtension; 737 PrimaryExtension->iDevice = 0; 738 PrimaryExtension->ulFrameBufferOffset = 0; 739 PrimaryExtension->ulFrameBufferSize = 0; 740 #endif 741 PrimaryExtension->u.primary.ulVbvaEnabled = 0; 742 PrimaryExtension->u.primary.bVBoxVideoSupported = FALSE; 743 #ifndef VBOX_WITH_WDDM 744 PrimaryExtension->u.primary.cDisplays = 1; 745 #endif 746 commonFromDeviceExt(PrimaryExtension)->cbVRAM = AdapterMemorySize; 747 commonFromDeviceExt(PrimaryExtension)->cbMiniportHeap = 0; 748 commonFromDeviceExt(PrimaryExtension)->pvMiniportHeap = NULL; 749 commonFromDeviceExt(PrimaryExtension)->pvAdapterInformation = NULL; 750 commonFromDeviceExt(PrimaryExtension)->pHostFlags = NULL; 751 PrimaryExtension->u.primary.ulMaxFrameBufferSize = 0; 752 commonFromDeviceExt(PrimaryExtension)->fCaps = fCaps; 753 commonFromDeviceExt(PrimaryExtension)->bHGSMI = VBoxHGSMIIsSupported (); 754 VBoxVideoCmnMemZero(&commonFromDeviceExt(PrimaryExtension)->areaHostHeap, sizeof(HGSMIAREA)); 755 VBoxVideoCmnMemZero(&PrimaryExtension->areaDisplay, sizeof(HGSMIAREA)); 756 757 if (commonFromDeviceExt(PrimaryExtension)->IOPortGuest == 0) 758 { 759 commonFromDeviceExt(PrimaryExtension)->bHGSMI = false; 760 } 761 730 memset(commonFromDeviceExt(PrimaryExtension), 0, 731 sizeof(*commonFromDeviceExt(PrimaryExtension))); 732 commonFromDeviceExt(PrimaryExtension)->cbVRAM = AdapterMemorySize; 733 commonFromDeviceExt(PrimaryExtension)->fCaps = fCaps; 734 commonFromDeviceExt(PrimaryExtension)->bHGSMI = VBoxHGSMIIsSupported (); 735 /* Why does this use VBoxVideoCmnMemZero? The MSDN docs say that it should 736 * only be used on mapped display adapter memory. Done with memset above. */ 737 // VBoxVideoCmnMemZero(&commonFromDeviceExt(PrimaryExtension)->areaHostHeap, sizeof(HGSMIAREA)); 762 738 if (commonFromDeviceExt(PrimaryExtension)->bHGSMI) 763 739 { 740 /** @note (michael) moved this here as it is done unconditionally in both 741 * driver branches. Feel free to fix if that is ever changed. */ 742 commonFromDeviceExt(PrimaryExtension)->IOPortHost = (RTIOPORT)VGA_PORT_HGSMI_HOST; 743 commonFromDeviceExt(PrimaryExtension)->IOPortGuest = (RTIOPORT)VGA_PORT_HGSMI_GUEST; 744 764 745 /* Map the adapter information. It will be needed for HGSMI IO. */ 765 rc = VBoxMapAdapterMemory ( PrimaryExtension,746 rc = VBoxMapAdapterMemory (commonFromDeviceExt(PrimaryExtension), 766 747 &commonFromDeviceExt(PrimaryExtension)->pvAdapterInformation, 767 commonFromDeviceExt(PrimaryExtension)->cbVRAM- VBVA_ADAPTER_INFORMATION_SIZE,748 AdapterMemorySize - VBVA_ADAPTER_INFORMATION_SIZE, 768 749 VBVA_ADAPTER_INFORMATION_SIZE 769 750 ); … … 833 814 * display drivers. 834 815 */ 835 rc = VBoxMapAdapterMemory ( PrimaryExtension,816 rc = VBoxMapAdapterMemory (commonFromDeviceExt(PrimaryExtension), 836 817 &commonFromDeviceExt(PrimaryExtension)->pvMiniportHeap, 837 818 commonFromDeviceExt(PrimaryExtension)->cbVRAM … … 1040 1021 #endif 1041 1022 1042 rc = VBoxMapAdapterMemory( PrimaryExtension, (void**)&PrimaryExtension->pvVisibleVram,1023 rc = VBoxMapAdapterMemory(commonFromDeviceExt(PrimaryExtension), (void**)&PrimaryExtension->pvVisibleVram, 1043 1024 0, 1044 1025 vboxWddmVramCpuVisibleSize(PrimaryExtension)); -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVbva.cpp
r32989 r33226 106 106 KeInitializeSpinLock(&pVbva->Lock); 107 107 108 int rc = VBoxMapAdapterMemory ( pDevExt,108 int rc = VBoxMapAdapterMemory (commonFromDeviceExt(pDevExt), 109 109 (void**)&pVbva->pVBVA, 110 110 offBuffer, -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVdma.cpp
r33216 r33226 1088 1088 PVOID pvBuffer; 1089 1089 1090 rc = VBoxMapAdapterMemory ( pDevExt,1090 rc = VBoxMapAdapterMemory (commonFromDeviceExt(pDevExt), 1091 1091 &pvBuffer, 1092 1092 offBuffer, -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp
r33223 r33226 434 434 if (VBoxHGSMIIsSupported ()) 435 435 { 436 commonFromDeviceExt(pContext)->IOPortHost = (RTIOPORT)VGA_PORT_HGSMI_HOST;437 commonFromDeviceExt(pContext)->IOPortGuest = (RTIOPORT)VGA_PORT_HGSMI_GUEST;438 439 436 PCM_RESOURCE_LIST pRcList = pDeviceInfo->TranslatedResourceList; 440 437 /* @todo: verify resources */
Note:
See TracChangeset
for help on using the changeset viewer.