Changeset 17583 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Miniport
- Timestamp:
- Mar 9, 2009 3:17:42 PM (16 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Miniport
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/Makefile.kmk
r12446 r17583 54 54 $(VBOX_LIB_IPRT_GUEST_R0_NT4) 55 55 56 ifdef VBOX_WITH_HGSMI 57 VBoxVideo_SOURCES += \ 58 VBoxVideoHGSMI.cpp 59 VBoxVideo_LIBS += \ 60 $(VBOX_PATH_ADDITIONS_LIB)/HGSMIGuestR0Lib$(VBOX_SUFF_LIB) 61 endif 62 56 63 include $(KBUILD_PATH)/subfooter.kmk 57 64 -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.cpp
r13837 r17583 730 730 731 731 /* Computes the size of a framebuffer. DualView has a few framebuffers of the computed size. */ 732 static void vboxComputeFrameBufferSizes (PDEVICE_EXTENSION PrimaryExtension)732 void VBoxComputeFrameBufferSizes (PDEVICE_EXTENSION PrimaryExtension) 733 733 { 734 734 ULONG ulAvailable = PrimaryExtension->u.primary.cbVRAM … … 743 743 ulSize &= ~0xFFF; 744 744 745 dprintf(("VBoxVideo:: vboxComputeFrameBufferSizes: cbVRAM = 0x%08X, cDisplays = %d, ulSize = 0x%08X, ulSize * cDisplays = 0x%08X, slack = 0x%08X\n",745 dprintf(("VBoxVideo::VBoxComputeFrameBufferSizes: cbVRAM = 0x%08X, cDisplays = %d, ulSize = 0x%08X, ulSize * cDisplays = 0x%08X, slack = 0x%08X\n", 746 746 PrimaryExtension->u.primary.cbVRAM, PrimaryExtension->u.primary.cDisplays, 747 747 ulSize, ulSize * PrimaryExtension->u.primary.cDisplays, … … 772 772 Extension->ulFrameBufferSize = 0; 773 773 774 dprintf(("VBoxVideo:: vboxComputeFrameBufferSizes: [%d] ulFrameBufferOffset 0x%08X\n",774 dprintf(("VBoxVideo::VBoxComputeFrameBufferSizes: [%d] ulFrameBufferOffset 0x%08X\n", 775 775 Extension->iDevice, ulFrameBufferOffset)); 776 776 … … 782 782 } 783 783 784 static int vboxMapAdapterMemory (PDEVICE_EXTENSION PrimaryExtension, void **ppv, ULONG ulOffset, ULONG ulSize)785 { 786 dprintf(("VBoxVideo:: vboxMapAdapterMemory 0x%08X[0x%X]\n", ulOffset, ulSize));784 int VBoxMapAdapterMemory (PDEVICE_EXTENSION PrimaryExtension, void **ppv, ULONG ulOffset, ULONG ulSize) 785 { 786 dprintf(("VBoxVideo::VBoxMapAdapterMemory 0x%08X[0x%X]\n", ulOffset, ulSize)); 787 787 788 788 if (!ulSize) … … 808 808 } 809 809 810 dprintf(("VBoxVideo:: vboxMapAdapterMemory rc = %d\n", Status));810 dprintf(("VBoxVideo::VBoxMapAdapterMemory rc = %d\n", Status)); 811 811 812 812 return Status; 813 813 } 814 814 815 static void vboxUnmapAdapterMemory (PDEVICE_EXTENSION PrimaryExtension, void **ppv)816 { 817 dprintf(("VBoxVideo:: vboxMapAdapterMemory\n"));815 void VBoxUnmapAdapterMemory (PDEVICE_EXTENSION PrimaryExtension, void **ppv) 816 { 817 dprintf(("VBoxVideo::VBoxMapAdapterMemory\n")); 818 818 819 819 if (*ppv) … … 963 963 { 964 964 /* Map the adapter information. It will be needed to query some configuration values. */ 965 rc = vboxMapAdapterMemory (PrimaryExtension,965 rc = VBoxMapAdapterMemory (PrimaryExtension, 966 966 &PrimaryExtension->u.primary.pvAdapterInformation, 967 967 PrimaryExtension->u.primary.cbVRAM - VBOX_VIDEO_ADAPTER_INFORMATION_SIZE, … … 970 970 if (rc != NO_ERROR) 971 971 { 972 dprintf(("VBoxVideo::VBoxSetupDisplays: vboxMapAdapterMemory pvAdapterInfoirrmation failed rc = %d\n",972 dprintf(("VBoxVideo::VBoxSetupDisplays: VBoxMapAdapterMemory pvAdapterInfoirrmation failed rc = %d\n", 973 973 rc)); 974 974 … … 1006 1006 * 1007 1007 */ 1008 rc = vboxMapAdapterMemory (PrimaryExtension,1008 rc = VBoxMapAdapterMemory (PrimaryExtension, 1009 1009 &PrimaryExtension->u.primary.pvMiniportHeap, 1010 1010 PrimaryExtension->u.primary.cbVRAM … … 1090 1090 * calculate the layout of framebuffers. 1091 1091 */ 1092 vboxComputeFrameBufferSizes (PrimaryExtension);1092 VBoxComputeFrameBufferSizes (PrimaryExtension); 1093 1093 1094 1094 if (PrimaryExtension->u.primary.bVBoxVideoSupported) … … 1100 1100 { 1101 1101 /* Unmap the memory if VBoxVideo is not supported. */ 1102 vboxUnmapAdapterMemory (PrimaryExtension, &PrimaryExtension->u.primary.pvMiniportHeap);1103 vboxUnmapAdapterMemory (PrimaryExtension, &PrimaryExtension->u.primary.pvAdapterInformation);1102 VBoxUnmapAdapterMemory (PrimaryExtension, &PrimaryExtension->u.primary.pvMiniportHeap); 1103 VBoxUnmapAdapterMemory (PrimaryExtension, &PrimaryExtension->u.primary.pvAdapterInformation); 1104 1104 } 1105 1105 … … 1182 1182 rc = NO_ERROR; 1183 1183 1184 #ifndef VBOX_WITH_HGSMI 1184 1185 /* Initialize VBoxGuest library */ 1185 1186 rc = VbglInit (); … … 1189 1190 /* Setup the Device Extension and if possible secondary displays. */ 1190 1191 VBoxSetupDisplays((PDEVICE_EXTENSION)HwDeviceExtension, ConfigInfo, AdapterMemorySize); 1192 #else 1193 if (VBoxHGSMIIsSupported ()) 1194 { 1195 LogRel(("VBoxVideo: using HGSMI\n")); 1196 1197 VBoxSetupDisplaysHGSMI((PDEVICE_EXTENSION)HwDeviceExtension, ConfigInfo, AdapterMemorySize); 1198 } 1199 else 1200 { 1201 /* Initialize VBoxGuest library */ 1202 rc = VbglInit (); 1203 1204 dprintf(("VBoxVideo::VBoxVideoFindAdapter: VbglInit returned 0x%x\n", rc)); 1205 1206 /* Setup the Device Extension and if possible secondary displays. */ 1207 VBoxSetupDisplays((PDEVICE_EXTENSION)HwDeviceExtension, ConfigInfo, AdapterMemorySize); 1208 } 1209 #endif /* VBOX_WITH_HGSMI */ 1191 1210 1192 1211 // pretend success to make the driver work. … … 1785 1804 } 1786 1805 1806 #ifdef VBOX_WITH_HGSMI 1807 case IOCTL_VIDEO_QUERY_HGSMI_INFO: 1808 { 1809 dprintf(("VBoxVideo::VBoxVideoStartIO: IOCTL_VIDEO_QUERY_HGSMI_INFO\n")); 1810 1811 if (RequestPacket->OutputBufferLength < sizeof(QUERYHGSMIRESULT)) 1812 { 1813 dprintf(("VBoxVideo::VBoxVideoStartIO: Output buffer too small: %d needed: %d!!!\n", 1814 RequestPacket->OutputBufferLength, sizeof(QUERYHGSMIRESULT))); 1815 RequestPacket->StatusBlock->Status = ERROR_INSUFFICIENT_BUFFER; 1816 return FALSE; 1817 } 1818 1819 if (!pDevExt->pPrimary->u.primary.bHGSMI) 1820 { 1821 RequestPacket->StatusBlock->Status = ERROR_INVALID_FUNCTION; 1822 return FALSE; 1823 } 1824 1825 QUERYHGSMIRESULT *pInfo = (QUERYHGSMIRESULT *)RequestPacket->OutputBuffer; 1826 1827 pInfo->iDevice = pDevExt->iDevice; 1828 pInfo->ulFlags = 0; 1829 1830 /* Describes VRAM chunk for this display device. */ 1831 pInfo->areaDisplay = pDevExt->areaDisplay; 1832 1833 RequestPacket->StatusBlock->Information = sizeof(QUERYHGSMIRESULT); 1834 Result = TRUE; 1835 1836 break; 1837 } 1838 #endif /* VBOX_WITH_HGSMI */ 1839 1787 1840 default: 1788 1841 dprintf(("VBoxVideo::VBoxVideoStartIO: Unsupported %p, fn %d(0x%x)\n", … … 1833 1886 VbglTerminate (); 1834 1887 1835 vboxUnmapAdapterMemory (pDevExt, &pDevExt->u.primary.pvMiniportHeap);1836 vboxUnmapAdapterMemory (pDevExt, &pDevExt->u.primary.pvAdapterInformation);1888 VBoxUnmapAdapterMemory (pDevExt, &pDevExt->u.primary.pvMiniportHeap); 1889 VBoxUnmapAdapterMemory (pDevExt, &pDevExt->u.primary.pvAdapterInformation); 1837 1890 1838 1891 return TRUE; … … 2018 2071 /* Save the new framebuffer size */ 2019 2072 DeviceExtension->ulFrameBufferSize = MapInformation->FrameBufferLength; 2073 #ifdef VBOX_WITH_HGSMI 2074 HGSMIAreaInitialize (&DeviceExtension->areaDisplay, 2075 MapInformation->FrameBufferBase, 2076 MapInformation->FrameBufferLength, 2077 DeviceExtension->ulFrameBufferOffset); 2078 #endif /* VBOX_WITH_HGSMI */ 2020 2079 return TRUE; 2021 2080 } … … 2034 2093 { 2035 2094 dprintf(("VBoxVideo::VBoxVideoUnmapVideoMemory\n")); 2095 #ifdef VBOX_WITH_HGSMI 2096 HGSMIAreaClear (&DeviceExtension->areaDisplay); 2097 #endif /* VBOX_WITH_HGSMI */ 2036 2098 VideoPortUnmapMemory(DeviceExtension, VideoMemory->RequestedVirtualAddress, NULL); 2037 2099 return TRUE; -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.h
r8433 r17583 24 24 #include <iprt/assert.h> 25 25 26 #ifdef VBOX_WITH_HGSMI 27 #include <VBox/HGSMI/HGSMI.h> 28 #endif /* VBOX_WITH_HGSMI */ 29 26 30 __BEGIN_DECLS 27 31 #include "dderror.h" … … 43 47 #define VBE_DISPI_INDEX_VIRT_HEIGHT 0x7 44 48 #define VBE_DISPI_INDEX_VBOX_VIDEO 0xa 49 #ifdef VBOX_WITH_HGSMI 50 #define VBE_DISPI_INDEX_VBVA_HOST 0xb 51 #define VBE_DISPI_INDEX_VBVA_GUEST 0xc 52 #endif /* VBOX_WITH_HGSMI */ 53 45 54 #define VBE_DISPI_ID2 0xB0C2 46 55 /* The VBOX interface id. Indicates support for VBE_DISPI_INDEX_VBOX_VIDEO. */ 47 56 #define VBE_DISPI_ID_VBOX_VIDEO 0xBE00 57 #ifdef VBOX_WITH_HGSMI 58 #define VBE_DISPI_ID_HGSMI 0xBE01 59 #endif /* VBOX_WITH_HGSMI */ 48 60 #define VBE_DISPI_DISABLED 0x00 49 61 #define VBE_DISPI_ENABLED 0x01 … … 109 121 */ 110 122 123 #ifdef VBOX_WITH_HGSMI 124 BOOLEAN bHGSMI; /* Whether HGSMI is enabled. */ 125 126 HGSMIAREA areaHostHeap; /* Host heap VRAM area. */ 127 128 HGSMIHEAP hgsmiAdapterHeap; 129 #endif /* VBOX_WITH_HGSMI */ 111 130 } primary; 112 131 … … 116 135 } secondary; 117 136 } u; 137 138 #ifdef VBOX_WITH_HGSMI 139 HGSMIAREA areaDisplay; /* Entire VRAM chunk for this display device. */ 140 #endif /* VBOX_WITH_HGSMI */ 118 141 } DEVICE_EXTENSION, *PDEVICE_EXTENSION; 119 142 … … 201 224 PULONG pUnused); 202 225 226 int VBoxMapAdapterMemory (PDEVICE_EXTENSION PrimaryExtension, 227 void **ppv, 228 ULONG ulOffset, 229 ULONG ulSize); 230 231 void VBoxUnmapAdapterMemory (PDEVICE_EXTENSION PrimaryExtension, 232 void **ppv); 233 234 void VBoxComputeFrameBufferSizes (PDEVICE_EXTENSION PrimaryExtension); 235 236 #ifdef VBOX_WITH_HGSMI 237 BOOLEAN VBoxHGSMIIsSupported (void); 238 239 VOID VBoxSetupDisplaysHGSMI (PDEVICE_EXTENSION PrimaryExtension, 240 PVIDEO_PORT_CONFIG_INFO pConfigInfo, 241 ULONG AdapterMemorySize); 242 #endif /* VBOX_WITH_HGSMI */ 203 243 } /* extern "C" */ 204 244 -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/vboxioctl.h
r8155 r17583 25 25 #include <VBox/VBoxGuest.h> 26 26 27 #ifdef VBOX_WITH_HGSMI 28 #include <VBox/HGSMI/HGSMI.h> 29 #endif /* VBOX_WITH_HGSMI */ 30 27 31 #define IOCTL_VIDEO_INTERPRET_DISPLAY_MEMORY \ 28 32 CTL_CODE(FILE_DEVICE_VIDEO, 0x420, METHOD_BUFFERED, FILE_ANY_ACCESS) … … 40 44 #define IOCTL_VIDEO_VBVA_ENABLE \ 41 45 CTL_CODE(FILE_DEVICE_VIDEO, 0x400, METHOD_BUFFERED, FILE_ANY_ACCESS) 46 47 #ifdef VBOX_WITH_HGSMI 48 #define IOCTL_VIDEO_QUERY_HGSMI_INFO \ 49 CTL_CODE(FILE_DEVICE_VIDEO, 0x430, METHOD_BUFFERED, FILE_ANY_ACCESS) 50 #endif /* VBOX_WITH_HGSMI */ 42 51 43 52 #pragma pack(1) … … 77 86 uint32_t u32DisplayInfoSize; 78 87 } QUERYDISPLAYINFORESULT; 88 89 #ifdef VBOX_WITH_HGSMI 90 /** 91 * Data returned by IOCTL_VIDEO_QUERY_HGSMI_INFO. 92 * 93 */ 94 typedef struct _QUERYHGSMIRESULT 95 { 96 /* Device index (0 for primary) */ 97 ULONG iDevice; 98 99 /* Flags. Currently none are defined and the field must be initialized to 0. */ 100 ULONG ulFlags; 101 102 /* Describes VRAM chunk for this display device. */ 103 HGSMIAREA areaDisplay; 104 105 } QUERYHGSMIRESULT; 106 #endif /* VBOX_WITH_HGSMI */ 79 107 #pragma pack() 80 108
Note:
See TracChangeset
for help on using the changeset viewer.