Changeset 17335 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Mar 4, 2009 9:26:52 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA.cpp
r17326 r17335 1383 1383 static uint32_t aMask[5] = {0x3ff, 0x1ff, 0x7f, 0x3f, 0x1f}; 1384 1384 static uint64_t aDelta[5] = {10000000, 5000000, 2500000, 1250000, 625000}; 1385 uint64_t u64CurTime = RTTimeSystemNanoTS(); 1386 1387 /* About 1000 (or more) accesses per 10 ms will trigger a reschedule 1388 * to the recompiler 1389 */ 1390 if (u64CurTime - s->u64LastLatchedAccess < aDelta[s->iMask]) 1385 if (PDMDevHlpCanEmulateIoBlock(s->CTX_SUFF(pDevIns))) 1386 { 1387 uint64_t u64CurTime = RTTimeSystemNanoTS(); 1388 1389 /* About 1000 (or more) accesses per 10 ms will trigger a reschedule 1390 * to the recompiler 1391 */ 1392 if (u64CurTime - s->u64LastLatchedAccess < aDelta[s->iMask]) 1393 { 1394 s->u64LastLatchedAccess = 0; 1395 s->iMask = RT_MIN(s->iMask + 1, RT_ELEMENTS(aMask) - 1); 1396 s->uMaskLatchAccess = aMask[s->iMask]; 1397 s->cLatchAccesses = s->uMaskLatchAccess - 1; 1398 return VINF_EM_RAW_EMULATE_IO_BLOCK; 1399 } 1400 if (s->u64LastLatchedAccess) 1401 { 1402 Log2(("Reset mask (was %d) delta %RX64 (limit %x)\n", s->iMask, u64CurTime - s->u64LastLatchedAccess, aDelta[s->iMask])); 1403 if (s->iMask) 1404 s->iMask--; 1405 s->uMaskLatchAccess = aMask[s->iMask]; 1406 } 1407 s->u64LastLatchedAccess = u64CurTime; 1408 } 1409 else 1391 1410 { 1392 1411 s->u64LastLatchedAccess = 0; 1393 s->iMask = RT_MIN(s->iMask + 1, RT_ELEMENTS(aMask) - 1);1412 s->iMask = 0; 1394 1413 s->uMaskLatchAccess = aMask[s->iMask]; 1395 s->cLatchAccesses = s->uMaskLatchAccess - 1; 1396 return VINF_EM_RAW_EMULATE_IO_BLOCK; 1414 s->cLatchAccesses = 0; 1397 1415 } 1398 if (s->u64LastLatchedAccess)1399 {1400 Log2(("Reset mask (was %d) delta %RX64 (limit %x)\n", s->iMask, u64CurTime - s->u64LastLatchedAccess, aDelta[s->iMask]));1401 if (s->iMask)1402 s->iMask--;1403 s->uMaskLatchAccess = aMask[s->iMask];1404 }1405 s->u64LastLatchedAccess = u64CurTime;1406 1416 } 1407 1417 #endif
Note:
See TracChangeset
for help on using the changeset viewer.