- Timestamp:
- Oct 15, 2009 9:13:56 AM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 53533
- Location:
- trunk/src/VBox
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.cpp
r23652 r23793 1208 1208 dprintf(("VBoxVideo::VBoxVideoFindAdapter: calling VideoPortGetAccessRanges\n")); 1209 1209 1210 /* Ports not yet found. */ 1211 ((PDEVICE_EXTENSION)HwDeviceExtension)->u.primary.IOPortHost = 0; 1212 ((PDEVICE_EXTENSION)HwDeviceExtension)->u.primary.IOPortGuest = 0; 1210 ((PDEVICE_EXTENSION)HwDeviceExtension)->u.primary.IOPortHost = (RTIOPORT)VGA_PORT_HGSMI_HOST; 1211 ((PDEVICE_EXTENSION)HwDeviceExtension)->u.primary.IOPortGuest = (RTIOPORT)VGA_PORT_HGSMI_GUEST; 1213 1212 1214 1213 VIDEO_ACCESS_RANGE tmpRanges[4]; … … 1247 1246 } 1248 1247 dprintf(("VBoxVideo::VBoxVideoFindAdapter: VideoPortGetAccessRanges status 0x%x\n", status)); 1249 if (status == NO_ERROR)1250 {1251 ULONG iRange = 0;1252 for (; iRange < sizeof (tmpRanges)/sizeof (tmpRanges[0]); iRange++)1253 {1254 dprintf(("VBoxVideo::VBoxVideoFindAdapter: range[%i]:\n"1255 " RangeStart = 0x%llx\n"1256 " RangeLength = %d\n"1257 " RangeInIoSpace = %d\n"1258 " RangeVisible = %d\n"1259 " RangeShareable = %d\n"1260 " RangePassive = %d\n",1261 iRange,1262 tmpRanges[iRange].RangeStart.QuadPart,1263 tmpRanges[iRange].RangeLength,1264 tmpRanges[iRange].RangeInIoSpace,1265 tmpRanges[iRange].RangeVisible,1266 tmpRanges[iRange].RangeShareable,1267 tmpRanges[iRange].RangePassive));1268 if (tmpRanges[iRange].RangeInIoSpace)1269 {1270 PVOID ioBase = VideoPortGetDeviceBase(HwDeviceExtension, tmpRanges[iRange].RangeStart, 8, VIDEO_MEMORY_SPACE_IO);1271 dprintf (("ioBase %p\n", ioBase));1272 1273 ((PDEVICE_EXTENSION)HwDeviceExtension)->u.primary.IOPortHost = (RTIOPORT)ioBase + VGA_PORT_OFF_HGSMI_HOST;1274 ((PDEVICE_EXTENSION)HwDeviceExtension)->u.primary.IOPortGuest = (RTIOPORT)ioBase + VGA_PORT_OFF_HGSMI_GUEST;1275 }1276 }1277 }1278 1248 1279 1249 /* no matter what we get with VideoPortGetAccessRanges, we assert the default ranges */ -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.h
r22549 r23793 66 66 67 67 #ifdef VBOX_WITH_HGSMI 68 #define VGA_PORT_ OFF_HGSMI_HOST069 #define VGA_PORT_ OFF_HGSMI_GUEST 468 #define VGA_PORT_HGSMI_HOST 0x3b0 69 #define VGA_PORT_HGSMI_GUEST 0x3d0 70 70 #endif /* VBOX_WITH_HGSMI */ 71 71 -
trunk/src/VBox/Devices/Graphics/DevVGA.cpp
r22793 r23793 3352 3352 #ifdef IN_RING3 3353 3353 /** 3354 * Port I/O Handler for PCI PortsOUT operations.3354 * Port I/O Handler for HGSMI OUT operations. 3355 3355 * 3356 3356 * @returns VBox status code. … … 3362 3362 * @param cb The value size in bytes. 3363 3363 */ 3364 static DECLCALLBACK(int) vgaR3IOPort PCIWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t u32, unsigned cb)3364 static DECLCALLBACK(int) vgaR3IOPortHGSMIWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t u32, unsigned cb) 3365 3365 { 3366 3366 LogFlowFunc(("Port 0x%x, u32 0x%x, cb %d\n", Port, u32, cb)); … … 3375 3375 if (cb == 4) 3376 3376 { 3377 RTIOPORT portOffset = Port - s->IOPortBase; 3378 3379 switch (portOffset) 3377 switch (Port) 3380 3378 { 3381 case VGA_PORT_OFF_HGSMI_HOST:3379 case 0x3b0: /* Host */ 3382 3380 { 3383 3381 #if defined(VBOX_WITH_VIDEOHWACCEL) … … 3394 3392 } break; 3395 3393 3396 case VGA_PORT_OFF_HGSMI_GUEST:3394 case 0x3d0: /* Guest */ 3397 3395 { 3398 3396 HGSMIGuestWrite(s->pHGSMI, u32); … … 3401 3399 default: 3402 3400 { 3403 AssertMsgFailed(("vgaR3IOPortPCIWrite: Port=%#x cb=%d u32=%#x\n", Port, cb, u32)); 3401 #ifdef DEBUG_sunlover 3402 AssertMsgFailed(("vgaR3IOPortHGSMIWrite: Port=%#x cb=%d u32=%#x\n", Port, cb, u32)); 3403 #endif 3404 3404 } break; 3405 3405 } … … 3407 3407 else 3408 3408 { 3409 AssertMsgFailed(("vgaR3IOPortPCIWrite: Port=%#x cb=%d u32=%#x\n", Port, cb, u32)); 3409 #ifdef DEBUG_sunlover 3410 AssertMsgFailed(("vgaR3IOPortHGSMIWrite: Port=%#x cb=%d u32=%#x\n", Port, cb, u32)); 3411 #endif 3410 3412 } 3411 3413 … … 3415 3417 3416 3418 /** 3417 * Port I/O Handler for PCI PortIN operations.3419 * Port I/O Handler for HGSMI IN operations. 3418 3420 * 3419 3421 * @returns VBox status code. … … 3425 3427 * @param cb Number of bytes to read. 3426 3428 */ 3427 static DECLCALLBACK(int) vgaR3IOPort PCIRead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t *pu32, unsigned cb)3429 static DECLCALLBACK(int) vgaR3IOPortHGSMIRead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t *pu32, unsigned cb) 3428 3430 { 3429 3431 LogFlowFunc(("Port 0x%x, cb %d\n", Port, cb)); … … 3438 3440 if (cb == 4) 3439 3441 { 3440 RTIOPORT portOffset = Port - s->IOPortBase; 3441 3442 switch (portOffset) 3442 switch (Port) 3443 3443 { 3444 case VGA_PORT_OFF_HGSMI_HOST:3444 case 0x3b0: /* Host */ 3445 3445 { 3446 3446 *pu32 = HGSMIHostRead(s->pHGSMI); 3447 3447 } break; 3448 case VGA_PORT_OFF_HGSMI_GUEST:3448 case 0x3d0: /* Guest */ 3449 3449 { 3450 3450 *pu32 = HGSMIGuestRead(s->pHGSMI); … … 3452 3452 default: 3453 3453 { 3454 AssertMsgFailed(("vgaR3IOPortPCIRead: Port=%#x cb=%d\n", Port, cb)); 3454 #ifdef DEBUG_sunlover 3455 AssertMsgFailed(("vgaR3IOPortHGSMIRead: Port=%#x cb=%d\n", Port, cb)); 3456 #endif 3455 3457 rc = VERR_IOM_IOPORT_UNUSED; 3456 3458 } break; … … 3459 3461 else 3460 3462 { 3461 AssertMsgFailed(("vgaR3IOPortPCIRead: Port=%#x cb=%d\n", Port, cb)); 3463 #ifdef DEBUG_sunlover 3464 AssertMsgFailed(("vgaR3IOPortHGSMIRead: Port=%#x cb=%d\n", Port, cb)); 3465 #endif 3462 3466 rc = VERR_IOM_IOPORT_UNUSED; 3463 3467 } … … 5707 5711 } 5708 5712 5709 #ifdef VBOX_WITH_HGSMI5710 #ifdef IN_RING35711 /**5712 * Callback function for mapping a PCI I/O region.5713 *5714 * @return VBox status code.5715 * @param pPciDev Pointer to PCI device. Use pPciDev->pDevIns to get the device instance.5716 * @param iRegion The region number.5717 * @param GCPhysAddress Physical address of the region. If iType is PCI_ADDRESS_SPACE_IO, this is an5718 * I/O port, else it's a physical address.5719 * This address is *NOT* relative to pci_mem_base like earlier!5720 * @param enmType One of the PCI_ADDRESS_SPACE_* values.5721 */5722 static DECLCALLBACK(int) vgaR3IOPortRegionMap(PPCIDEVICE pPciDev, /*unsigned*/ int iRegion, RTGCPHYS GCPhysAddress, uint32_t cb, PCIADDRESSSPACE enmType)5723 {5724 VGAState *pThis = PCIDEV_2_VGASTATE(pPciDev);5725 int rc = VINF_SUCCESS;5726 5727 Assert(enmType == PCI_ADDRESS_SPACE_IO);5728 Assert(iRegion == 1);5729 AssertMsg(RT_ALIGN(GCPhysAddress, 8) == GCPhysAddress, ("Expected 8 byte alignment. GCPhysAddress=%#x\n", GCPhysAddress));5730 5731 /*5732 * Save the base port address to simplify Port offset calculations.5733 */5734 pThis->IOPortBase = (RTIOPORT)GCPhysAddress;5735 5736 /*5737 * Register port IO handlers.5738 */5739 rc = PDMDevHlpIOPortRegister(pPciDev->pDevIns,5740 (RTIOPORT)GCPhysAddress, cb,5741 (void*)pThis, vgaR3IOPortPCIWrite, vgaR3IOPortPCIRead,5742 NULL, NULL, "VGA PCI IO Ports");5743 AssertRC(rc);5744 return rc;5745 }5746 #endif /* IN_RING3 */5747 #endif /* VBOX_WITH_HGSMI */5748 5749 5713 /** 5750 5714 * Construct a VGA device instance for a VM. … … 5924 5888 if (RT_FAILURE(rc)) 5925 5889 return rc; 5890 #ifdef VBOX_WITH_HGSMI 5891 /* Use reserved VGA IO ports for HGSMI. */ 5892 rc = PDMDevHlpIOPortRegister(pDevIns, 0x3b0, 4, NULL, vgaR3IOPortHGSMIWrite, vgaR3IOPortHGSMIRead, NULL, NULL, "VGA - 3b0 (HGSMI host)"); 5893 if (RT_FAILURE(rc)) 5894 return rc; 5895 rc = PDMDevHlpIOPortRegister(pDevIns, 0x3d0, 4, NULL, vgaR3IOPortHGSMIWrite, vgaR3IOPortHGSMIRead, NULL, NULL, "VGA - 3d0 (HGSMI guest)"); 5896 if (RT_FAILURE(rc)) 5897 return rc; 5898 #endif /* VBOX_WITH_HGSMI */ 5926 5899 5927 5900 #ifdef CONFIG_BOCHS_VBE … … 6085 6058 if (RT_FAILURE(rc)) 6086 6059 return rc; 6087 #ifdef VBOX_WITH_HGSMI6088 rc = PDMDevHlpPCIIORegionRegister(pDevIns, 1, 0x10, PCI_ADDRESS_SPACE_IO, vgaR3IOPortRegionMap);6089 if (RT_FAILURE(rc))6090 return rc;6091 #endif /* VBOX_WITH_HGSMI */6092 6060 6093 6061 /* Initialize the PDM lock. */ -
trunk/src/VBox/Devices/Graphics/DevVGA.h
r22841 r23793 47 47 #ifdef VBOX_WITH_HGSMI 48 48 #include "HGSMI/HGSMIHost.h" 49 50 #define VGA_PORT_OFF_HGSMI_HOST 051 #define VGA_PORT_OFF_HGSMI_GUEST 452 49 #endif /* VBOX_WITH_HGSMI */ 53 50 -
trunk/src/VBox/Devices/Graphics/DevVGA_VBVA.cpp
r23118 r23793 1062 1062 * New VBVA uses a new interface id: #define VBE_DISPI_ID_VBOX_VIDEO 0xBE01 1063 1063 * 1064 * VBVA uses two 32 bits PCIIO ports to write VRAM offsets of shared memory blocks for commands.1065 * IOPortBase+Read Write1066 * VGA_PORT_OFF_HGSMI_GUEST control value? to process1067 * VGA_PORT_OFF_HGSMI_HOST to process completed1064 * VBVA uses two 32 bits IO ports to write VRAM offsets of shared memory blocks for commands. 1065 * Read Write 1066 * Host port 0x3b0 to process completed 1067 * Guest port 0x3d0 control value? to process 1068 1068 * 1069 1069 */
Note:
See TracChangeset
for help on using the changeset viewer.