Changeset 13402 in vbox
- Timestamp:
- Oct 20, 2008 3:47:38 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 38153
- Location:
- trunk/src/VBox/Devices/Graphics
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA.cpp
r13401 r13402 349 349 AssertMsg(offVRAM < pThis->vram_size, ("offVRAM = %p, pThis->vram_size = %p\n", offVRAM, pThis->vram_size)); 350 350 ASMBitSet(&pThis->au32DirtyBitmap[0], offVRAM >> PAGE_SHIFT); 351 pThis->fHa sDirtyBits = true;351 pThis->fHaveDirtyBits = true; 352 352 } 353 353 … … 684 684 #endif 685 685 s->sr[s->sr_index] = val & sr_mask[s->sr_index]; 686 687 #ifndef IN_GC688 /* The VGA region is (could be) affected by this change; reset all aliases we've created. */689 if ( s->sr_index == 4 /* mode */690 || s->sr_index == 2 /* plane mask */)691 {692 if (s->fRemappedVGA)693 {694 IOMMMIOResetRegion(PDMDevHlpGetVM(s->CTX_SUFF(pDevIns)), 0x000a0000);695 s->fRemappedVGA = false;696 }697 }698 #endif699 686 break; 700 687 case 0x3c7: … … 724 711 #endif 725 712 s->gr[s->gr_index] = val & gr_mask[s->gr_index]; 726 727 #ifndef IN_GC728 /* The VGA region is (could be) affected by this change; reset all aliases we've created. */729 if (s->gr_index == 6 /* memory map mode */)730 {731 if (s->fRemappedVGA)732 {733 IOMMMIOResetRegion(PDMDevHlpGetVM(s->CTX_SUFF(pDevIns)), 0x000a0000);734 s->fRemappedVGA = false;735 }736 }737 #endif738 713 break; 739 740 714 case 0x3b4: 741 715 case 0x3d4: … … 906 880 s->vbe_regs[s->vbe_index] = val; 907 881 s->bank_offset = (val << 16); 908 909 #ifndef IN_GC 910 /* The VGA region is (could be) affected by this change; reset all aliases we've created. */ 911 if (s->fRemappedVGA) 912 { 913 IOMMMIOResetRegion(PDMDevHlpGetVM(s->CTX_SUFF(pDevIns)), 0x000a0000); 914 s->fRemappedVGA = false; 915 } 916 #endif 917 break; 918 882 break; 919 883 case VBE_DISPI_INDEX_ENABLE: 920 884 #ifndef IN_RING3 … … 1037 1001 */ 1038 1002 s->pDrv->pfnLFBModeChange(s->pDrv, (val & VBE_DISPI_ENABLED) != 0); 1039 1040 /* The VGA region is (could be) affected by this change; reset all aliases we've created. */1041 if (s->fRemappedVGA)1042 {1043 IOMMMIOResetRegion(PDMDevHlpGetVM(s->CTX_SUFF(pDevIns)), 0x000a0000);1044 s->fRemappedVGA = false;1045 }1046 1003 break; 1047 1004 #endif /* IN_RING3 */ … … 1124 1081 /* convert to VGA memory offset */ 1125 1082 memory_map_mode = (s->gr[6] >> 2) & 3; 1126 #ifdef VBOX1127 RTGCPHYS GCPhys = addr; /* save original address */1128 #endif1129 1083 addr &= 0x1ffff; 1130 1084 switch(memory_map_mode) { … … 1160 1114 #else /* VBOX */ 1161 1115 ret = s->CTX_SUFF(vram_ptr)[addr]; 1162 # ifdef IN_RING01163 /* If all planes are accessible, then map the page to the frame buffer and make it writable. */1164 if ((s->sr[2] & 3) == 3)1165 {1166 IOMMMIOModifyPage(PDMDevHlpGetVM(s->CTX_SUFF(pDevIns)), GCPhys, s->GCPhysVRAM + addr, X86_PTE_RW | X86_PTE_P);1167 s->fRemappedVGA = true;1168 }1169 # endif /* IN_RING0 */1170 1116 #endif /* VBOX */ 1171 1117 } else if (!(s->sr[4] & 0x04)) { /* Host access is controlled by SR4, not GR5! */ … … 1251 1197 /* convert to VGA memory offset */ 1252 1198 memory_map_mode = (s->gr[6] >> 2) & 3; 1253 #ifdef VBOX1254 RTGCPHYS GCPhys = addr; /* save original address */1255 #endif1256 1199 addr &= 0x1ffff; 1257 1200 switch(memory_map_mode) { … … 1284 1227 s->vram_ptr[addr] = val; 1285 1228 #else /* VBOX */ 1286 # 1229 #ifdef IN_GC 1287 1230 if (addr >= VGA_MAPPING_SIZE) 1288 1231 return VINF_IOM_HC_MMIO_WRITE; 1289 # 1232 #else 1290 1233 if (addr >= s->vram_size) 1291 1234 { … … 1294 1237 return VINF_SUCCESS; 1295 1238 } 1296 # 1239 #endif 1297 1240 s->CTX_SUFF(vram_ptr)[addr] = val; 1298 1299 # ifdef IN_RING01300 /* If all planes are accessible, then map the page to the frame buffer and make it writable. */1301 if ((s->sr[2] & 3) == 3)1302 {1303 IOMMMIOModifyPage(PDMDevHlpGetVM(s->CTX_SUFF(pDevIns)), GCPhys, s->GCPhysVRAM + addr, X86_PTE_RW | X86_PTE_P);1304 s->fRemappedVGA = true;1305 }1306 # endif /* IN_RING0 */1307 1308 1241 #endif /* VBOX */ 1309 1242 #ifdef DEBUG_VGA_MEM … … 4393 4326 PVGASTATE pThis = IDISPLAYPORT_2_VGASTATE(pInterface); 4394 4327 PDMDEV_ASSERT_EMT(VGASTATE2DEVINS(pThis)); 4395 PPDMDEVINS pDevIns = pThis->CTX_SUFF(pDevIns);4396 4328 4397 4329 #ifdef DEBUG_sunlover … … 4405 4337 return rc; 4406 4338 4407 if ( pThis->fHasDirtyBits 4408 && pThis->GCPhysVRAM 4409 && pThis->GCPhysVRAM != NIL_RTGCPHYS32) 4410 { 4339 if (pThis->fHaveDirtyBits && pThis->GCPhysVRAM && pThis->GCPhysVRAM != NIL_RTGCPHYS32) 4340 { 4341 PPDMDEVINS pDevIns = pThis->CTX_SUFF(pDevIns); 4411 4342 PGMHandlerPhysicalReset(PDMDevHlpGetVM(pDevIns), pThis->GCPhysVRAM); 4412 pThis->fHasDirtyBits = false; 4413 } 4414 if (pThis->fRemappedVGA) 4415 { 4416 IOMMMIOResetRegion(PDMDevHlpGetVM(pDevIns), 0x000a0000); 4417 pThis->fRemappedVGA = false; 4343 pThis->fHaveDirtyBits = false; 4418 4344 } 4419 4345 … … 4432 4358 PVGASTATE pThis = IDISPLAYPORT_2_VGASTATE(pInterface); 4433 4359 PDMDEV_ASSERT_EMT(VGASTATE2DEVINS(pThis)); 4434 PPDMDEVINS pDevIns = pThis->CTX_SUFF(pDevIns);4435 4360 4436 4361 /* This is called both in VBVA mode and normal modes. */ … … 4445 4370 4446 4371 /* The dirty bits array has been just cleared, reset handlers as well. */ 4447 if ( pThis->GCPhysVRAM4448 && pThis->GCPhysVRAM != NIL_RTGCPHYS32)4449 {4372 if (pThis->GCPhysVRAM && pThis->GCPhysVRAM != NIL_RTGCPHYS32) 4373 { 4374 PPDMDEVINS pDevIns = pThis->CTX_SUFF(pDevIns); 4450 4375 PGMHandlerPhysicalReset(PDMDevHlpGetVM(pDevIns), pThis->GCPhysVRAM); 4451 }4452 if (pThis->fRemappedVGA)4453 {4454 IOMMMIOResetRegion(PDMDevHlpGetVM(pDevIns), 0x000a0000);4455 pThis->fRemappedVGA = false;4456 4376 } 4457 4377 … … 5065 4985 int rc = PGMHandlerPhysicalReset(PDMDevHlpGetVM(pDevIns), pThis->GCPhysVRAM); 5066 4986 AssertRC(rc); 5067 }5068 if (pThis->fRemappedVGA)5069 {5070 IOMMMIOResetRegion(PDMDevHlpGetVM(pDevIns), 0x000a0000);5071 pThis->fRemappedVGA = false;5072 4987 } 5073 4988 -
trunk/src/VBox/Devices/Graphics/DevVGA.h
r13401 r13402 261 261 bool fR0Enabled; 262 262 /** Flag indicating that there are dirty bits. This is used to optimize the handler resetting. */ 263 bool fHasDirtyBits; 264 /** Flag indicating that the VGA memory in the 0xa0000-0xbffff region has been remapped to allow direct access. */ 265 bool fRemappedVGA; 266 bool padding9[3]; 267 263 bool fHaveDirtyBits; 268 264 /** Pointer to vgaGCLFBAccessHandler(). */ 269 265 RTRCPTR RCPtrLFBHandler;
Note:
See TracChangeset
for help on using the changeset viewer.