Changeset 22549 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Miniport
- Timestamp:
- Aug 28, 2009 11:24:07 AM (15 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Miniport
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.cpp
r22548 r22549 1151 1151 #ifdef VBOX_WITH_HGSMI 1152 1152 VBoxSetupVideoPortFunctions((PDEVICE_EXTENSION)HwDeviceExtension, &((PDEVICE_EXTENSION)HwDeviceExtension)->u.primary.VideoPortProcs, ConfigInfo); 1153 ((PDEVICE_EXTENSION)HwDeviceExtension)->u.primary.VideoPortProcs.pfnCreateSpinLock(HwDeviceExtension, &((PDEVICE_EXTENSION)HwDeviceExtension)->u.primary.pGHRWLock);1154 1153 #endif 1155 1154 … … 1810 1809 { 1811 1810 /* The display driver must have prepared the monitor information. */ 1812 #ifndef VBOX_WITH_HGSMI1813 1811 VideoPortWritePortUshort((PUSHORT)VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_VBOX_VIDEO); 1814 1812 VideoPortWritePortUlong((PULONG)VBE_DISPI_IOPORT_DATA, VBOX_VIDEO_INTERPRET_DISPLAY_MEMORY_BASE + pDevExt->iDevice); 1815 #else1816 VBoxVideoVBEWriteUlong(((PDEVICE_EXTENSION)HwDeviceExtension)->pPrimary, VBE_DISPI_INDEX_VBOX_VIDEO, VBOX_VIDEO_INTERPRET_DISPLAY_MEMORY_BASE + pDevExt->iDevice);1817 #endif1818 1813 } 1819 1814 else … … 2104 2099 } 2105 2100 2106 #ifndef VBOX_WITH_HGSMI2107 2101 VideoPortWritePortUshort((PUSHORT)VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_ENABLE); 2108 2102 VideoPortWritePortUshort((PUSHORT)VBE_DISPI_IOPORT_DATA, VBE_DISPI_DISABLED); 2109 #else2110 VBoxVideoVBEWriteUshort(((PDEVICE_EXTENSION)HwDeviceExtension)->pPrimary, VBE_DISPI_INDEX_ENABLE, VBE_DISPI_DISABLED);2111 #endif2112 2103 2113 2104 if (pDevExt->u.primary.pvReqFlush != NULL) … … 2211 2202 2212 2203 /* set the mode characteristics */ 2213 #ifndef VBOX_WITH_HGSMI2214 2204 VideoPortWritePortUshort((PUSHORT)VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_XRES); 2215 2205 VideoPortWritePortUshort((PUSHORT)VBE_DISPI_IOPORT_DATA, (USHORT)ModeInfo->VisScreenWidth); … … 2222 2212 VideoPortWritePortUshort((PUSHORT)VBE_DISPI_IOPORT_DATA, VBE_DISPI_ENABLED | VBE_DISPI_LFB_ENABLED); 2223 2213 /** @todo read from the port to see if the mode switch was successful */ 2224 #else2225 VBoxVideoVBEWriteUshort(DeviceExtension->pPrimary, VBE_DISPI_INDEX_XRES, (USHORT)ModeInfo->VisScreenWidth);2226 VBoxVideoVBEWriteUshort(DeviceExtension->pPrimary, VBE_DISPI_INDEX_YRES, (USHORT)ModeInfo->VisScreenHeight);2227 VBoxVideoVBEWriteUshort(DeviceExtension->pPrimary, VBE_DISPI_INDEX_BPP, (USHORT)ModeInfo->BitsPerPlane);2228 VBoxVideoVBEWriteUshort(DeviceExtension->pPrimary, VBE_DISPI_INDEX_ENABLE, VBE_DISPI_ENABLED | VBE_DISPI_LFB_ENABLED);2229 #endif2230 2214 2231 2215 /* Tell the host that we now support graphics in the additions. -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.h
r22548 r22549 143 143 HGSMIHEAP hgsmiAdapterHeap; 144 144 145 PSPIN_LOCK pGHRWLock; /* lock for making guest->host read/writes atomic */146 147 145 /* The IO Port Number for host commands. */ 148 146 RTIOPORT IOPortHost; … … 277 275 #ifdef VBOX_WITH_HGSMI 278 276 279 DECLINLINE(void) VBoxVideoVBEWriteUlongLocked(USHORT dataType, ULONG data)280 {281 VideoPortWritePortUshort((PUSHORT)VBE_DISPI_IOPORT_INDEX, dataType);282 VideoPortWritePortUlong((PULONG)VBE_DISPI_IOPORT_DATA, data);283 }284 285 DECLINLINE(void) VBoxVideoVBEWriteUshortLocked(USHORT dataType, USHORT data)286 {287 VideoPortWritePortUshort((PUSHORT)VBE_DISPI_IOPORT_INDEX, dataType);288 VideoPortWritePortUshort((PUSHORT)VBE_DISPI_IOPORT_DATA, data);289 }290 291 DECLINLINE(ULONG) VBoxVideoVBEReadUlongLocked (USHORT dataType)292 {293 VideoPortWritePortUshort((PUSHORT)VBE_DISPI_IOPORT_INDEX, dataType);294 return VideoPortReadPortUlong((PULONG)VBE_DISPI_IOPORT_DATA);295 }296 297 DECLINLINE(void) VBoxVideoVBEWriteUlong(PDEVICE_EXTENSION PrimaryExtension, USHORT dataType, ULONG data)298 {299 UCHAR oldIrql;300 PrimaryExtension->u.primary.VideoPortProcs.pfnAcquireSpinLock(PrimaryExtension,301 PrimaryExtension->u.primary.pGHRWLock,302 &oldIrql);303 VBoxVideoVBEWriteUlongLocked(dataType, data);304 PrimaryExtension->u.primary.VideoPortProcs.pfnReleaseSpinLock(PrimaryExtension,305 PrimaryExtension->u.primary.pGHRWLock,306 oldIrql);307 }308 309 DECLINLINE(void) VBoxVideoVBEWriteUshort(PDEVICE_EXTENSION PrimaryExtension, USHORT dataType, USHORT data)310 {311 UCHAR oldIrql;312 PrimaryExtension->u.primary.VideoPortProcs.pfnAcquireSpinLock(PrimaryExtension,313 PrimaryExtension->u.primary.pGHRWLock,314 &oldIrql);315 VBoxVideoVBEWriteUshortLocked(dataType, data);316 PrimaryExtension->u.primary.VideoPortProcs.pfnReleaseSpinLock(PrimaryExtension,317 PrimaryExtension->u.primary.pGHRWLock,318 oldIrql);319 }320 321 DECLINLINE(ULONG) VBoxVideoVBEReadUlong(PDEVICE_EXTENSION PrimaryExtension, USHORT dataType)322 {323 ULONG data;324 UCHAR oldIrql;325 PrimaryExtension->u.primary.VideoPortProcs.pfnAcquireSpinLock(PrimaryExtension,326 PrimaryExtension->u.primary.pGHRWLock,327 &oldIrql);328 data = VBoxVideoVBEReadUlongLocked(dataType);329 PrimaryExtension->u.primary.VideoPortProcs.pfnReleaseSpinLock(PrimaryExtension,330 PrimaryExtension->u.primary.pGHRWLock,331 oldIrql);332 return data;333 }334 335 277 /* 336 278 * Host and Guest port IO helpers.
Note:
See TracChangeset
for help on using the changeset viewer.