Changeset 32876 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideoHGSMI.cpp
- Timestamp:
- Oct 1, 2010 8:38:01 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideoHGSMI.cpp
r32622 r32876 35 35 void HGSMINotifyHostCmdComplete (PDEVICE_EXTENSION PrimaryExtension, HGSMIOFFSET offt) 36 36 { 37 VBoxHGSMIHostWrite( PrimaryExtension, offt);37 VBoxHGSMIHostWrite(hgsmiFromDeviceExt(PrimaryExtension), offt); 38 38 } 39 39 40 40 void HGSMIClearIrq (PDEVICE_EXTENSION PrimaryExtension) 41 41 { 42 VBoxHGSMIHostWrite( PrimaryExtension, HGSMIOFFSET_VOID);42 VBoxHGSMIHostWrite(hgsmiFromDeviceExt(PrimaryExtension), HGSMIOFFSET_VOID); 43 43 } 44 44 45 45 static void HGSMIHostCmdComplete (PDEVICE_EXTENSION PrimaryExtension, void * pvMem) 46 46 { 47 HGSMIOFFSET offMem = HGSMIPointerToOffset (& PrimaryExtension->u.primary.areaHostHeap, HGSMIBufferHeaderFromData (pvMem));47 HGSMIOFFSET offMem = HGSMIPointerToOffset (&hgsmiFromDeviceExt(PrimaryExtension)->areaHostHeap, HGSMIBufferHeaderFromData (pvMem)); 48 48 Assert(offMem != HGSMIOFFSET_VOID); 49 49 if(offMem != HGSMIOFFSET_VOID) … … 55 55 static void hgsmiHostCmdProcess(PDEVICE_EXTENSION PrimaryExtension, HGSMIOFFSET offBuffer) 56 56 { 57 int rc = HGSMIBufferProcess (& PrimaryExtension->u.primary.areaHostHeap,58 & PrimaryExtension->u.primary.channels,57 int rc = HGSMIBufferProcess (&hgsmiFromDeviceExt(PrimaryExtension)->areaHostHeap, 58 &hgsmiFromDeviceExt(PrimaryExtension)->channels, 59 59 offBuffer); 60 60 Assert(!RT_FAILURE(rc)); … … 70 70 static HGSMIOFFSET hgsmiGetHostBuffer (PDEVICE_EXTENSION PrimaryExtension) 71 71 { 72 return VBoxHGSMIHostRead( PrimaryExtension);72 return VBoxHGSMIHostRead(hgsmiFromDeviceExt(PrimaryExtension)); 73 73 } 74 74 … … 190 190 /* @todo: add synchronization */ 191 191 #endif 192 return HGSMIHeapAlloc (& PrimaryExtension->u.primary.hgsmiAdapterHeap, cbData, u8Ch, u16Op);192 return HGSMIHeapAlloc (&hgsmiFromDeviceExt(PrimaryExtension)->hgsmiAdapterHeap, cbData, u8Ch, u16Op); 193 193 } 194 194 … … 198 198 /* @todo: add synchronization */ 199 199 #endif 200 HGSMIHeapFree (& PrimaryExtension->u.primary.hgsmiAdapterHeap, pvBuffer);200 HGSMIHeapFree (&hgsmiFromDeviceExt(PrimaryExtension)->hgsmiAdapterHeap, pvBuffer); 201 201 } 202 202 … … 204 204 { 205 205 /* Initialize the buffer and get the offset for port IO. */ 206 HGSMIOFFSET offBuffer = HGSMIHeapBufferOffset (& PrimaryExtension->u.primary.hgsmiAdapterHeap, pvBuffer);206 HGSMIOFFSET offBuffer = HGSMIHeapBufferOffset (&hgsmiFromDeviceExt(PrimaryExtension)->hgsmiAdapterHeap, pvBuffer); 207 207 208 208 Assert(offBuffer != HGSMIOFFSET_VOID); … … 210 210 { 211 211 /* Submit the buffer to the host. */ 212 VBoxHGSMIGuestWrite( PrimaryExtension, offBuffer);212 VBoxHGSMIGuestWrite(hgsmiFromDeviceExt(PrimaryExtension), offBuffer); 213 213 return VINF_SUCCESS; 214 214 } … … 236 236 #endif 237 237 238 void *p = HGSMIHeapAlloc (& PrimaryExtension->u.primary.hgsmiAdapterHeap, cbData, u8Ch, u16Op);238 void *p = HGSMIHeapAlloc (&hgsmiFromDeviceExt(PrimaryExtension)->hgsmiAdapterHeap, cbData, u8Ch, u16Op); 239 239 240 240 if (!p) … … 253 253 { 254 254 /* Initialize the buffer and get the offset for port IO. */ 255 HGSMIOFFSET offBuffer = HGSMIHeapBufferOffset (& PrimaryExtension->u.primary.hgsmiAdapterHeap,255 HGSMIOFFSET offBuffer = HGSMIHeapBufferOffset (&hgsmiFromDeviceExt(PrimaryExtension)->hgsmiAdapterHeap, 256 256 p); 257 257 258 258 /* Submit the buffer to the host. */ 259 VBoxHGSMIGuestWrite( PrimaryExtension, offBuffer);259 VBoxHGSMIGuestWrite(hgsmiFromDeviceExt(PrimaryExtension), offBuffer); 260 260 261 261 if (pfnFinalize) … … 271 271 272 272 /* Free the IO buffer. */ 273 HGSMIHeapFree (& PrimaryExtension->u.primary.hgsmiAdapterHeap, p);273 HGSMIHeapFree (&hgsmiFromDeviceExt(PrimaryExtension)->hgsmiAdapterHeap, p); 274 274 } 275 275 … … 743 743 PrimaryExtension->u.primary.pHostFlags = NULL; 744 744 PrimaryExtension->u.primary.ulMaxFrameBufferSize = 0; 745 PrimaryExtension->u.primary.bHGSMI= VBoxHGSMIIsSupported (PrimaryExtension);746 VBoxVideoCmnMemZero(& PrimaryExtension->u.primary.areaHostHeap, sizeof(HGSMIAREA));745 hgsmiFromDeviceExt(PrimaryExtension)->bHGSMI = VBoxHGSMIIsSupported (PrimaryExtension); 746 VBoxVideoCmnMemZero(&hgsmiFromDeviceExt(PrimaryExtension)->areaHostHeap, sizeof(HGSMIAREA)); 747 747 VBoxVideoCmnMemZero(&PrimaryExtension->areaDisplay, sizeof(HGSMIAREA)); 748 748 749 if ( PrimaryExtension->u.primary.IOPortGuest == 0)750 { 751 PrimaryExtension->u.primary.bHGSMI = false;752 } 753 754 if ( PrimaryExtension->u.primary.bHGSMI)749 if (hgsmiFromDeviceExt(PrimaryExtension)->IOPortGuest == 0) 750 { 751 hgsmiFromDeviceExt(PrimaryExtension)->bHGSMI = false; 752 } 753 754 if (hgsmiFromDeviceExt(PrimaryExtension)->bHGSMI) 755 755 { 756 756 /* Map the adapter information. It will be needed for HGSMI IO. */ … … 765 765 rc)); 766 766 767 PrimaryExtension->u.primary.bHGSMI = FALSE;767 hgsmiFromDeviceExt(PrimaryExtension)->bHGSMI = FALSE; 768 768 } 769 769 else 770 770 { 771 771 /* Setup a HGSMI heap within the adapter information area. */ 772 rc = HGSMIHeapSetup (& PrimaryExtension->u.primary.hgsmiAdapterHeap,772 rc = HGSMIHeapSetup (&hgsmiFromDeviceExt(PrimaryExtension)->hgsmiAdapterHeap, 773 773 PrimaryExtension->u.primary.pvAdapterInformation, 774 774 VBVA_ADAPTER_INFORMATION_SIZE - sizeof(HGSMIHOSTFLAGS), … … 781 781 rc)); 782 782 783 PrimaryExtension->u.primary.bHGSMI = FALSE;783 hgsmiFromDeviceExt(PrimaryExtension)->bHGSMI = FALSE; 784 784 } 785 785 else … … 792 792 793 793 /* Setup the host heap and the adapter memory. */ 794 if ( PrimaryExtension->u.primary.bHGSMI)794 if (hgsmiFromDeviceExt(PrimaryExtension)->bHGSMI) 795 795 { 796 796 /* The miniport heap is used for the host buffers. */ … … 836 836 PrimaryExtension->u.primary.pvMiniportHeap = NULL; 837 837 PrimaryExtension->u.primary.cbMiniportHeap = 0; 838 PrimaryExtension->u.primary.bHGSMI = FALSE;838 hgsmiFromDeviceExt(PrimaryExtension)->bHGSMI = FALSE; 839 839 } 840 840 else … … 845 845 846 846 /* Init the host hap area. Buffers from the host will be placed there. */ 847 HGSMIAreaInitialize (& PrimaryExtension->u.primary.areaHostHeap,847 HGSMIAreaInitialize (&hgsmiFromDeviceExt(PrimaryExtension)->areaHostHeap, 848 848 PrimaryExtension->u.primary.pvMiniportHeap, 849 849 PrimaryExtension->u.primary.cbMiniportHeap, … … 860 860 861 861 /* Check whether the guest supports multimonitors. */ 862 if ( PrimaryExtension->u.primary.bHGSMI)862 if (hgsmiFromDeviceExt(PrimaryExtension)->bHGSMI) 863 863 { 864 864 #ifndef VBOX_WITH_WDDM … … 939 939 #endif 940 940 941 if ( PrimaryExtension->u.primary.bHGSMI)941 if (hgsmiFromDeviceExt(PrimaryExtension)->bHGSMI) 942 942 { 943 943 /* Setup the information for the host. */ … … 946 946 if (RT_FAILURE (rc)) 947 947 { 948 PrimaryExtension->u.primary.bHGSMI = FALSE;948 hgsmiFromDeviceExt(PrimaryExtension)->bHGSMI = FALSE; 949 949 } 950 950 } 951 951 952 952 #ifdef VBOX_WITH_WDDM 953 if ( PrimaryExtension->u.primary.bHGSMI)953 if (hgsmiFromDeviceExt(PrimaryExtension)->bHGSMI) 954 954 { 955 955 ULONG ulAvailable = PrimaryExtension->u.primary.cbVRAM … … 1040 1040 1041 1041 if (RT_FAILURE(rc)) 1042 PrimaryExtension->u.primary.bHGSMI = FALSE;1043 } 1044 #endif 1045 1046 if (! PrimaryExtension->u.primary.bHGSMI)1042 hgsmiFromDeviceExt(PrimaryExtension)->bHGSMI = FALSE; 1043 } 1044 #endif 1045 1046 if (!hgsmiFromDeviceExt(PrimaryExtension)->bHGSMI) 1047 1047 { 1048 1048 /* Unmap the memory if VBoxVideo is not supported. */ … … 1050 1050 VBoxUnmapAdapterInformation (PrimaryExtension); 1051 1051 1052 HGSMIHeapDestroy (& PrimaryExtension->u.primary.hgsmiAdapterHeap);1053 } 1054 1055 if ( PrimaryExtension->u.primary.bHGSMI)1052 HGSMIHeapDestroy (&hgsmiFromDeviceExt(PrimaryExtension)->hgsmiAdapterHeap); 1053 } 1054 1055 if (hgsmiFromDeviceExt(PrimaryExtension)->bHGSMI) 1056 1056 { 1057 1057 VBoxVideoCmnSpinLockCreate(PrimaryExtension, &PrimaryExtension->u.primary.pSynchLock); … … 1099 1099 */ 1100 1100 { 1101 HGSMIHeapDestroy(& PrimaryExtension->u.primary.hgsmiAdapterHeap);1101 HGSMIHeapDestroy(&hgsmiFromDeviceExt(PrimaryExtension)->hgsmiAdapterHeap); 1102 1102 1103 1103 /* Map the adapter information. It will be needed for HGSMI IO. */ … … 1369 1369 VBoxVideoHGSMIDpc(PrimaryExtension, NULL); 1370 1370 1371 HGSMICHANNEL * pChannel = HGSMIChannelFindById (& PrimaryExtension->u.primary.channels, u8Channel);1371 HGSMICHANNEL * pChannel = HGSMIChannelFindById (&hgsmiFromDeviceExt(PrimaryExtension)->channels, u8Channel); 1372 1372 if(pChannel) 1373 1373 { … … 1547 1547 { 1548 1548 VBVA_CHANNELCONTEXTS * pContexts; 1549 HGSMICHANNEL * pChannel = HGSMIChannelFindById (& PrimaryExtension->u.primary.channels, u8Channel);1549 HGSMICHANNEL * pChannel = HGSMIChannelFindById (&hgsmiFromDeviceExt(PrimaryExtension)->channels, u8Channel); 1550 1550 if(!pChannel) 1551 1551 { … … 1584 1584 if(!pChannel) 1585 1585 { 1586 rc = HGSMIChannelRegister (& PrimaryExtension->u.primary.channels,1586 rc = HGSMIChannelRegister (&hgsmiFromDeviceExt(PrimaryExtension)->channels, 1587 1587 u8Channel, 1588 1588 "VGA Miniport HGSMI channel",
Note:
See TracChangeset
for help on using the changeset viewer.