VirtualBox

Changeset 17325 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Mar 4, 2009 8:44:25 AM (16 years ago)
Author:
vboxsync
Message:

Adjusted recompiler fallback method

Location:
trunk/src/VBox/Devices/Graphics
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Graphics/BIOS/vgabios.c

    r11982 r17325  
    670670     // Ralf Brown Interrupt list is WRONG on bh(page)
    671671     // We do output only on the current page !
     672#ifdef DEBUG
     673     printf("write_teletype %02x\n", GET_AL());
     674#endif
     675
    672676     biosfn_write_teletype(GET_AL(),0xff,GET_BL(),NO_ATTR);
    673677     break;
  • trunk/src/VBox/Devices/Graphics/DevVGA.cpp

    r17298 r17325  
    13791379
    13801380#ifdef IN_RING0
    1381         if (((++s->cLatchAccesses) & 0x3ff) == 0x3ff)
     1381        if (((++s->cLatchAccesses) & s->uMaskLatchAccess) == s->uMaskLatchAccess)
    13821382        {
     1383            static uint32_t aMask[5]  = {0x3ff, 0x1ff, 0x7f, 0x3f, 0x1f};
     1384            static uint64_t aDelta[5]  = {10000000, 5000000, 2500000, 1250000, 625000};
    13831385            uint64_t u64CurTime = RTTimeSystemNanoTS();
     1386
    13841387            /* About 1000 (or more) accesses per 10 ms will trigger a reschedule
    13851388             * to the recompiler
    13861389             */
    1387             if (u64CurTime - s->u64LastLatchedAccess < 10000000)
     1390            if (u64CurTime - s->u64LastLatchedAccess < aDelta[s->iMask])
     1391            {
     1392                s->u64LastLatchedAccess = 0;
     1393                s->iMask                = RT_MIN(s->iMask + 1, RT_ELEMENTS(aMask) - 1);
     1394                s->uMaskLatchAccess     = aMask[s->iMask];
     1395                s->cLatchAccesses       = s->uMaskLatchAccess - 1;
    13881396                return VINF_EM_RAW_EMULATE_IO_BLOCK;
    1389 
    1390             s->u64LastLatchedAccess = u64CurTime;           
     1397            }
     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;
    13911406        }
    13921407#endif
     
    52615276    if (pThis->pDrv)
    52625277        pThis->pDrv->pfnReset(pThis->pDrv);
     5278
     5279    /* Reset latched access mask. */
     5280    pThis->uMaskLatchAccess     = 0x3ff;
     5281    pThis->cLatchAccesses       = 0;
     5282    pThis->u64LastLatchedAccess = 0;
     5283
    52635284}
    52645285
     
    60926113    STAM_REG(pVM, &pThis->StatR3MemoryWrite,    STAMTYPE_PROFILE, "/Devices/VGA/R3/MMIO-Write", STAMUNIT_TICKS_PER_CALL, "Profiling of the VGAGCMemoryWrite() body.");
    60936114
     6115    /* Init latched access mask. */
     6116    pThis->uMaskLatchAccess = 0x3ff;
    60946117    return rc;
    60956118}
  • trunk/src/VBox/Devices/Graphics/DevVGA.h

    r17308 r17325  
    304304    uint64_t                    u64LastLatchedAccess;
    305305    uint32_t                    cLatchAccesses;
    306     uint32_t                    Padding10;
     306    uint16_t                    uMaskLatchAccess;
     307    uint16_t                    iMask;
    307308
    308309#ifdef VBE_BYTEWISE_IO
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette