Changeset 65303 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Jan 15, 2017 6:24:27 PM (8 years ago)
- Location:
- trunk/src/VBox/Devices
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA.cpp
r65298 r65303 463 463 SSMFIELD_ENTRY_IGN_GCPHYS( VMSVGAState, GCPhysFIFO), 464 464 SSMFIELD_ENTRY_IGNORE( VMSVGAState, cbFIFO), 465 SSMFIELD_ENTRY_IGNORE( VMSVGAState, cbFIFOConfig), 465 466 SSMFIELD_ENTRY( VMSVGAState, u32SVGAId), 466 467 SSMFIELD_ENTRY( VMSVGAState, fEnabled), … … 4439 4440 * Mapping the FIFO RAM. 4440 4441 */ 4442 AssertLogRelMsg(cb == pThis->svga.cbFIFO, ("cb=%#RGp cbFIFO=%#x\n", cb, pThis->svga.cbFIFO)); 4441 4443 rc = PDMDevHlpMMIOExMap(pDevIns, pPciDev, iRegion, GCPhysAddress); 4442 4444 AssertRC(rc); … … 4454 4456 { 4455 4457 pThis->svga.GCPhysFIFO = GCPhysAddress; 4456 Log(("vmsvgaR3IORegionMap: FIFO address = %RGp\n", GCPhysAddress));4458 Log(("vmsvgaR3IORegionMap: GCPhysFIFO=%RGp cbFIFO=%#x\n", GCPhysAddress, pThis->svga.cbFIFO)); 4457 4459 } 4458 4460 } -
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA.h
r65298 r65303 26 26 27 27 /** Default FIFO size. */ 28 #define VMSVGA_FIFO_SIZE _128K 28 #define VMSVGA_FIFO_SIZE _2M 29 /** The old FIFO size. */ 30 #define VMSVGA_FIFO_SIZE_OLD _128K 29 31 30 32 /** Default scratch region size. */ … … 159 161 /** Guest physical address of the FIFO memory range. */ 160 162 RTGCPHYS GCPhysFIFO; 161 /** Size in bytes of the FIFO memory range. */ 163 /** Size in bytes of the FIFO memory range. 164 * This may be smaller than cbFIFOConfig after restoring an old VM state. */ 162 165 uint32_t cbFIFO; 166 /** The configured FIFO size. */ 167 uint32_t cbFIFOConfig; 163 168 /** SVGA id. */ 164 169 uint32_t u32SVGAId; … … 176 181 /** Guest OS identifier. */ 177 182 uint32_t u32GuestId; 178 /** Scratch region size . */183 /** Scratch region size (VMSVGAState::au32ScratchRegion). */ 179 184 uint32_t cScratchRegion; 180 /** Scratch array. */181 uint32_t au32ScratchRegion[VMSVGA_SCRATCH_SIZE];182 185 /** Irq status. */ 183 186 uint32_t u32IrqStatus; … … 190 193 /** Register caps. */ 191 194 uint32_t u32RegCaps; 192 uint32_t Padding2;193 195 /** Physical address of command mmio range. */ 194 196 RTIOPORT BasePort; … … 233 235 PGMPHYSHANDLERTYPE hFifoAccessHandlerType; 234 236 #endif 237 238 /** Scratch array. 239 * Putting this at the end since it's big it probably not . */ 240 uint32_t au32ScratchRegion[VMSVGA_SCRATCH_SIZE]; 235 241 236 242 STAMCOUNTER StatRegBitsPerPixelWr; -
trunk/src/VBox/Devices/Graphics/DevVGA.cpp
r65298 r65303 5496 5496 5497 5497 5498 #ifdef VBOX_WITH_VMSVGA /* Currently not needed in the non-VMSVGA mode, but keeping it flexible for later. */ 5499 /** 5500 * @interface_method_impl{PDMPCIDEV,pfnRegionLoadChangeHookR3} 5501 */ 5502 static DECLCALLBACK(int) vgaR3PciRegionLoadChangeHook(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, uint32_t iRegion, 5503 uint64_t cbRegion, PCIADDRESSSPACE enmType, 5504 PFNPCIIOREGIONOLDSETTER pfnOldSetter) 5505 { 5506 PVGASTATE pThis = PDMINS_2_DATA(pDevIns, PVGASTATE); 5507 5508 # ifdef VBOX_WITH_VMSVGA 5509 /* 5510 * The VMSVGA changed the default FIFO size from 128KB to 2MB after 5.1. 5511 */ 5512 if (pThis->fVMSVGAEnabled) 5513 { 5514 if (iRegion == 2 /*FIFO*/) 5515 { 5516 /* Make sure it's still 32-bit memory. Ignore fluxtuations in the prefetch flag */ 5517 AssertLogRelMsgReturn(!(enmType & (PCI_ADDRESS_SPACE_IO | PCI_ADDRESS_SPACE_BAR64)), ("enmType=%#x\n", enmType), 5518 VERR_VGA_UNEXPECTED_PCI_REGION_LOAD_CHANGE); 5519 5520 /* If the size didn't change we're fine, so just return already. */ 5521 if (cbRegion == pThis->svga.cbFIFO) 5522 return VINF_SUCCESS; 5523 5524 /* If the size is larger than the current configuration, refuse to load. */ 5525 AssertLogRelMsgReturn(cbRegion <= pThis->svga.cbFIFOConfig, 5526 ("cbRegion=%#RGp cbFIFOConfig=%#x cbFIFO=%#x\n", 5527 cbRegion, pThis->svga.cbFIFOConfig, pThis->svga.cbFIFO), 5528 VERR_SSM_LOAD_CONFIG_MISMATCH); 5529 5530 /* Adjust the size down. */ 5531 int rc = PDMDevHlpMMIOExReduce(pDevIns, pPciDev, iRegion, cbRegion); 5532 AssertLogRelMsgRCReturn(rc, 5533 ("cbRegion=%#RGp cbFIFOConfig=%#x cbFIFO=%#x: %Rrc\n", 5534 cbRegion, pThis->svga.cbFIFOConfig, pThis->svga.cbFIFO, rc), 5535 rc); 5536 pThis->svga.cbFIFO = cbRegion; 5537 return rc; 5538 5539 } 5540 /* Emulate callbacks for 5.1 and older saved states by recursion. */ 5541 else if (iRegion == UINT32_MAX) 5542 { 5543 int rc = vgaR3PciRegionLoadChangeHook(pDevIns, pPciDev, 2, VMSVGA_FIFO_SIZE_OLD, PCI_ADDRESS_SPACE_MEM, NULL); 5544 if (RT_SUCCESS(rc)) 5545 rc = pfnOldSetter(pPciDev, 2, VMSVGA_FIFO_SIZE_OLD, PCI_ADDRESS_SPACE_MEM); 5546 return rc; 5547 } 5548 } 5549 # endif /* VBOX_WITH_VMSVGA */ 5550 5551 return VERR_VGA_UNEXPECTED_PCI_REGION_LOAD_CHANGE; 5552 } 5553 #endif /* VBOX_WITH_VMSVGA */ 5554 5555 5498 5556 /* -=-=-=-=-=- Ring3: Misc Wrappers & Sidekicks -=-=-=-=-=- */ 5499 5557 … … 6137 6195 AssertLogRelMsgReturn(pThis->svga.cbFIFO <= _16M, ("cbFIFO=%#x\n", pThis->svga.cbFIFO), VERR_OUT_OF_RANGE); 6138 6196 AssertLogRelMsgReturn(RT_IS_POWER_OF_TWO(pThis->svga.cbFIFO), ("cbFIFO=%#x\n", pThis->svga.cbFIFO), VERR_NOT_POWER_OF_TWO); 6197 pThis->svga.cbFIFOConfig = pThis->svga.cbFIFO; 6139 6198 Log(("VMSVGA: VMSVGAFifoSize = %#x (%'u)\n", pThis->svga.cbFIFO, pThis->svga.cbFIFO)); 6140 6199 #endif … … 6259 6318 if (RT_FAILURE(rc)) 6260 6319 return rc; 6320 pThis->Dev.pfnRegionLoadChangeHookR3 = vgaR3PciRegionLoadChangeHook; 6261 6321 } 6262 6322 else -
trunk/src/VBox/Devices/testcase/tstDeviceStructSize.cpp
r64841 r65303 366 366 CHECK_MEMBER_ALIGNMENT(VGASTATE, svga, 8); 367 367 CHECK_MEMBER_ALIGNMENT(VGASTATE, svga.u64HostWindowId, 8); 368 CHECK_MEMBER_ALIGNMENT(VGASTATE, svga.au32ScratchRegion, 8); 369 CHECK_MEMBER_ALIGNMENT(VGASTATE, svga.StatRegBitsPerPixelWr, 8); 368 370 #endif 369 371 CHECK_MEMBER_ALIGNMENT(VGASTATE, cMonitors, 8); -
trunk/src/VBox/Devices/testcase/tstDeviceStructSizeRC.cpp
r65301 r65303 323 323 GEN_CHECK_OFF(VGASTATE, svga.GCPhysFIFO); 324 324 GEN_CHECK_OFF(VGASTATE, svga.cbFIFO); 325 GEN_CHECK_OFF(VGASTATE, svga.cbFIFOConfig); 326 GEN_CHECK_OFF(VGASTATE, svga.u32SVGAId); 327 GEN_CHECK_OFF(VGASTATE, svga.fConfigured); 328 GEN_CHECK_OFF(VGASTATE, svga.fBusy); 329 GEN_CHECK_OFF(VGASTATE, svga.fTraces); 330 GEN_CHECK_OFF(VGASTATE, svga.u32GuestId); 331 GEN_CHECK_OFF(VGASTATE, svga.cScratchRegion); 332 GEN_CHECK_OFF(VGASTATE, svga.u32IrqStatus); 333 GEN_CHECK_OFF(VGASTATE, svga.u32IrqMask); 334 GEN_CHECK_OFF(VGASTATE, svga.u32PitchLock); 335 GEN_CHECK_OFF(VGASTATE, svga.u32CurrentGMRId); 336 GEN_CHECK_OFF(VGASTATE, svga.u32RegCaps); 325 337 GEN_CHECK_OFF(VGASTATE, svga.BasePort); 338 GEN_CHECK_OFF(VGASTATE, svga.u32IndexReg); 339 GEN_CHECK_OFF(VGASTATE, svga.pSupDrvSession); 340 GEN_CHECK_OFF(VGASTATE, svga.FIFORequestSem); 341 GEN_CHECK_OFF(VGASTATE, svga.FIFOExtCmdSem); 326 342 GEN_CHECK_OFF(VGASTATE, svga.pFIFOIOThread); 327 343 GEN_CHECK_OFF(VGASTATE, svga.uWidth); 344 GEN_CHECK_OFF(VGASTATE, svga.uHeight); 345 GEN_CHECK_OFF(VGASTATE, svga.uBpp); 346 GEN_CHECK_OFF(VGASTATE, svga.cbScanline); 347 GEN_CHECK_OFF(VGASTATE, svga.u32MaxWidth); 348 GEN_CHECK_OFF(VGASTATE, svga.u32MaxHeight); 349 GEN_CHECK_OFF(VGASTATE, svga.viewport); 328 350 GEN_CHECK_OFF(VGASTATE, svga.u32ActionFlags); 329 351 GEN_CHECK_OFF(VGASTATE, svga.f3DEnabled); 330 352 GEN_CHECK_OFF(VGASTATE, svga.fVRAMTracking); 353 GEN_CHECK_OFF(VGASTATE, svga.u8FIFOExtCommand); 354 GEN_CHECK_OFF(VGASTATE, svga.fFifoExtCommandWakeup); 355 GEN_CHECK_OFF(VGASTATE, svga.au32ScratchRegion); 356 GEN_CHECK_OFF(VGASTATE, svga.StatRegBitsPerPixelWr); 357 GEN_CHECK_OFF(VGASTATE, svga.StatRegWriteOnlyRd); 331 358 #endif 332 359 GEN_CHECK_OFF(VGASTATE, cMonitors);
Note:
See TracChangeset
for help on using the changeset viewer.