Changeset 77299 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Feb 13, 2019 1:57:14 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 128819
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA.cpp
r77289 r77299 5555 5555 static DECLCALLBACK(int) vgaR3PciRegionLoadChangeHook(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, uint32_t iRegion, 5556 5556 uint64_t cbRegion, PCIADDRESSSPACE enmType, 5557 PFNPCIIOREGIONOLDSETTER pfnOldSetter )5557 PFNPCIIOREGIONOLDSETTER pfnOldSetter, PFNPCIIOREGIONSWAP pfnSwapRegions) 5558 5558 { 5559 5559 PVGASTATE pThis = PDMINS_2_DATA(pDevIns, PVGASTATE); 5560 5560 5561 5561 # ifdef VBOX_WITH_VMSVGA 5562 /*5563 * The VMSVGA changed the default FIFO size from 128KB to 2MB after 5.1.5564 */5565 5562 if (pThis->fVMSVGAEnabled) 5566 5563 { 5564 /* 5565 * We messed up BAR order for the hybrid devices in 6.0 (see #9359). 5566 * It should have been compatible with the VBox VGA device and had the 5567 * VRAM region first and I/O second, but instead the I/O region ended 5568 * up first and VRAM second like the VMSVGA device. 5569 * 5570 * So, we have to detect that here and reconfigure the memory regions. 5571 * Region numbers are used in our (and the PCI bus') interfaction with 5572 * PGM, so PGM needs to be informed too. 5573 */ 5574 if ( iRegion == 0 5575 && iRegion == pThis->pciRegions.iVRAM 5576 && (enmType & PCI_ADDRESS_SPACE_IO)) 5577 { 5578 LogRel(("VGA: Detected old BAR config, making adjustments.\n")); 5579 5580 /* Update the entries. */ 5581 pThis->pciRegions.iIO = 0; 5582 pThis->pciRegions.iVRAM = 1; 5583 5584 /* Update PGM on the region number change so it won't barf when restoring state. */ 5585 AssertLogRelReturn(pDevIns->CTX_SUFF(pHlp)->pfnMMIOExChangeRegionNo, VERR_VERSION_MISMATCH); 5586 int rc = pDevIns->CTX_SUFF(pHlp)->pfnMMIOExChangeRegionNo(pDevIns, pPciDev, 0, 1); 5587 AssertLogRelRCReturn(rc, rc); 5588 5589 /* Update the calling PCI device. */ 5590 AssertLogRelReturn(pfnSwapRegions, VERR_INTERNAL_ERROR_2); 5591 rc = pfnSwapRegions(pPciDev, 0, 1); 5592 AssertLogRelRCReturn(rc, rc); 5593 5594 return rc; 5595 } 5596 5597 /* 5598 * The VMSVGA changed the default FIFO size from 128KB to 2MB after 5.1. 5599 */ 5567 5600 if (iRegion == pThis->pciRegions.iFIFO) 5568 5601 { … … 5591 5624 5592 5625 } 5626 5593 5627 /* Emulate callbacks for 5.1 and older saved states by recursion. */ 5594 elseif (iRegion == UINT32_MAX)5628 if (iRegion == UINT32_MAX) 5595 5629 { 5596 int rc = vgaR3PciRegionLoadChangeHook(pDevIns, pPciDev, pThis->pciRegions.iFIFO, VMSVGA_FIFO_SIZE_OLD, PCI_ADDRESS_SPACE_MEM, NULL); 5630 int rc = vgaR3PciRegionLoadChangeHook(pDevIns, pPciDev, pThis->pciRegions.iFIFO, VMSVGA_FIFO_SIZE_OLD, 5631 PCI_ADDRESS_SPACE_MEM, NULL, NULL); 5597 5632 if (RT_SUCCESS(rc)) 5598 5633 rc = pfnOldSetter(pPciDev, pThis->pciRegions.iFIFO, VMSVGA_FIFO_SIZE_OLD, PCI_ADDRESS_SPACE_MEM); … … 6259 6294 Log(("VMSVGA: VMSVGAPciId = %d\n", pThis->fVMSVGAPciId)); 6260 6295 6261 rc = CFGMR3QueryBoolDef(pCfg, "VMSVGAPciBarLayout", &pThis->fVMSVGAPciBarLayout, false);6296 rc = CFGMR3QueryBoolDef(pCfg, "VMSVGAPciBarLayout", &pThis->fVMSVGAPciBarLayout, pThis->fVMSVGAPciId); 6262 6297 AssertLogRelRCReturn(rc, rc); 6263 6298 Log(("VMSVGA: VMSVGAPciBarLayout = %d\n", pThis->fVMSVGAPciBarLayout)); … … 6282 6317 pThis->pciRegions.iIO = 0; 6283 6318 pThis->pciRegions.iVRAM = 1; 6284 pThis->pciRegions.iFIFO = 2;6285 6319 } 6286 6320 else … … 6288 6322 pThis->pciRegions.iVRAM = 0; 6289 6323 pThis->pciRegions.iIO = 1; 6290 pThis->pciRegions.iFIFO = 2;6291 }6324 } 6325 pThis->pciRegions.iFIFO = 2; 6292 6326 #else 6293 6327 pThis->pciRegions.iVRAM = 0;
Note:
See TracChangeset
for help on using the changeset viewer.