VirtualBox

Changeset 55795 in vbox


Ignore:
Timestamp:
May 10, 2015 5:43:38 PM (9 years ago)
Author:
vboxsync
Message:

VMSVGA: Hack to make the 2dmark results appear. Extended 'info vga'.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA.h

    r53201 r55795  
    2727/** Maximum nr of GMR ids. */
    2828#define VMSVGA_MAX_GMR_IDS              0x100
    29 /** Size of the region to backup when switching into svga mode. */
    30 #define VMSVGA_FRAMEBUFFER_BACKUP_SIZE  (32*1024)
    3129
    3230#define VMSVGA_VAL_UNINITIALIZED        (unsigned)-1
  • trunk/src/VBox/Devices/Graphics/DevVGA.cpp

    r55767 r55795  
    103103    } while (0)
    104104#endif
     105
     106/** @def VBOX_WITH_VMSVGA_BACKUP_VGA_FB
     107 * Enables correct VGA MMIO read/write handling when VMSVGA is enabled.  It
     108 * is SLOW and probably not entirely right, but it helps with getting 3dmark
     109 * output and other stuff. */
     110#define VBOX_WITH_VMSVGA_BACKUP_VGA_FB 1
    105111
    106112
     
    11931199#endif
    11941200
     1201#if !defined(IN_RING3) && defined(VBOX_WITH_VMSVGA) && defined(VBOX_WITH_VMSVGA_BACKUP_VGA_FB) /** @todo figure out the right way */
     1202    /* Ugly hack to get result from 2dmark and other vmsvga examples. */
     1203    if (pThis->svga.fEnabled)
     1204        return VINF_IOM_R3_MMIO_READ;
     1205#endif
     1206
    11951207    addr &= 0x1ffff;
    11961208    switch(memory_map_mode) {
     
    12321244# endif /* IN_RC */
    12331245        VERIFY_VRAM_READ_OFF_RETURN(pThis, addr, *prc);
    1234         ret = pThis->CTX_SUFF(vram_ptr)[addr];
     1246#if defined(IN_RING3) && defined(VBOX_WITH_VMSVGA) && defined(VBOX_WITH_VMSVGA_BACKUP_VGA_FB) /** @todo figure out the right way */
     1247        if (pThis->svga.fEnabled && addr < _32K)
     1248            ret = ((uint8_t *)pThis->svga.pFrameBufferBackup)[addr];
     1249        else
     1250#endif
     1251            ret = pThis->CTX_SUFF(vram_ptr)[addr];
    12351252    } else if (!(pThis->sr[4] & 0x04)) {    /* Host access is controlled by SR4, not GR5! */
    12361253        /* odd/even mode (aka text mode mapping) */
     
    12391256        RTGCPHYS off = ((addr & ~1) << 2) | plane;
    12401257        VERIFY_VRAM_READ_OFF_RETURN(pThis, off, *prc);
    1241         ret = pThis->CTX_SUFF(vram_ptr)[off];
     1258#if defined(IN_RING3) && defined(VBOX_WITH_VMSVGA) && defined(VBOX_WITH_VMSVGA_BACKUP_VGA_FB) /** @todo figure out the right way */
     1259        if (pThis->svga.fEnabled && off < _32K)
     1260            ret = ((uint8_t *)pThis->svga.pFrameBufferBackup)[off];
     1261        else
     1262#endif
     1263            ret = pThis->CTX_SUFF(vram_ptr)[off];
    12421264    } else {
    12431265        /* standard VGA latched access */
    1244         VERIFY_VRAM_READ_OFF_RETURN(pThis, addr, *prc);
    1245         pThis->latch = ((uint32_t *)pThis->CTX_SUFF(vram_ptr))[addr];
     1266        VERIFY_VRAM_READ_OFF_RETURN(pThis, addr, *prc); /** @todo wrong check! Missing addr*4.  */
     1267#if defined(IN_RING3) && defined(VBOX_WITH_VMSVGA) && defined(VBOX_WITH_VMSVGA_BACKUP_VGA_FB) /** @todo figure out the right way */
     1268        if (pThis->svga.fEnabled && addr * 4 + 3 < _32K)
     1269            pThis->latch = ((uint32_t *)pThis->svga.pFrameBufferBackup)[addr];
     1270        else
     1271#endif
     1272            pThis->latch = ((uint32_t *)pThis->CTX_SUFF(vram_ptr))[addr];
    12461273
    12471274        if (!(pThis->gr[5] & 0x08)) {
     
    12721299#ifndef IN_RC
    12731300    RTGCPHYS GCPhys = addr; /* save original address */
     1301#endif
     1302
     1303#if !defined(IN_RING3) && defined(VBOX_WITH_VMSVGA) && defined(VBOX_WITH_VMSVGA_BACKUP_VGA_FB) /** @todo figure out the right way */
     1304    /* Ugly hack to get result from 2dmark and other vmsvga examples. */
     1305    if (pThis->svga.fEnabled)
     1306        return VINF_IOM_R3_MMIO_WRITE;
    12741307#endif
    12751308
     
    13141347
    13151348            VERIFY_VRAM_WRITE_OFF_RETURN(pThis, addr);
    1316             pThis->CTX_SUFF(vram_ptr)[addr] = val;
     1349#if defined(IN_RING3) && defined(VBOX_WITH_VMSVGA) && defined(VBOX_WITH_VMSVGA_BACKUP_VGA_FB) /** @todo figure out the right way */
     1350            if (pThis->svga.fEnabled && addr < _32K)
     1351                ((uint8_t *)pThis->svga.pFrameBufferBackup)[addr] = val;
     1352            else
     1353#endif
     1354                pThis->CTX_SUFF(vram_ptr)[addr] = val;
    13171355            Log3(("vga: chain4: [0x%x]\n", addr));
    13181356            pThis->plane_updated |= mask; /* only used to detect font change */
     
    13311369            addr = ((addr & ~1) << 2) | plane;
    13321370            VERIFY_VRAM_WRITE_OFF_RETURN(pThis, addr);
    1333             pThis->CTX_SUFF(vram_ptr)[addr] = val;
     1371#if defined(IN_RING3) && defined(VBOX_WITH_VMSVGA) && defined(VBOX_WITH_VMSVGA_BACKUP_VGA_FB) /** @todo figure out the right way */
     1372            if (pThis->svga.fEnabled && addr < _32K)
     1373                ((uint8_t *)pThis->svga.pFrameBufferBackup)[addr] = val;
     1374            else
     1375#endif
     1376                pThis->CTX_SUFF(vram_ptr)[addr] = val;
    13341377            Log3(("vga: odd/even: [0x%x]\n", addr));
    13351378            pThis->plane_updated |= mask; /* only used to detect font change */
     
    14421485        pThis->plane_updated |= mask; /* only used to detect font change */
    14431486        write_mask = mask16[mask];
    1444         ((uint32_t *)pThis->CTX_SUFF(vram_ptr))[addr] =
    1445             (((uint32_t *)pThis->CTX_SUFF(vram_ptr))[addr] & ~write_mask) |
     1487#if defined(IN_RING3) && defined(VBOX_WITH_VMSVGA) && defined(VBOX_WITH_VMSVGA_BACKUP_VGA_FB) /** @todo figure out the right way */
     1488        if (pThis->svga.fEnabled && addr * 4 + 3U < _32K)
     1489            ((uint32_t *)pThis->svga.pFrameBufferBackup)[addr] =
     1490                (((uint32_t *)pThis->svga.pFrameBufferBackup)[addr] & ~write_mask) | (val & write_mask);
     1491        else
     1492#endif
     1493            ((uint32_t *)pThis->CTX_SUFF(vram_ptr))[addr] =
     1494                (((uint32_t *)pThis->CTX_SUFF(vram_ptr))[addr] & ~write_mask) |
    14461495            (val & write_mask);
    14471496            Log3(("vga: latch: [0x%x] mask=0x%08x val=0x%08x\n",
     
    41064155        pHlp->pfnPrintf(pHlp, "char height %d\n", val);
    41074156        pHlp->pfnPrintf(pHlp, "text mode %dx%d\n", w / char_dots, h / (char_height << double_scan));
     4157
     4158        uint32_t cbLine;
     4159        uint32_t offStart;
     4160        uint32_t uLineCompareIgn;
     4161        vga_get_offsets(pThis, &cbLine, &offStart, &uLineCompareIgn);
     4162        if (!cbLine)
     4163            cbLine = 80 * 8;
     4164        offStart *= 8;
     4165        pHlp->pfnPrintf(pHlp, "cbLine:   %#x\n", cbLine);
     4166        pHlp->pfnPrintf(pHlp, "offStart: %#x (line %#x)\n", offStart, offStart / cbLine);
    41084167    }
    41094168    if (pThis->fRealRetrace)
     
    41264185    }
    41274186    pHlp->pfnPrintf(pHlp, "display refresh interval: %u ms\n", pThis->cMilliesRefreshInterval);
     4187
     4188#ifdef VBOX_WITH_VMSVGA
     4189    if (pThis->svga.fEnabled) {
     4190        pHlp->pfnPrintf(pHlp, pThis->svga.f3DEnabled ? "VMSVGA 3D enabled: %ux%ux%u\n" : "VMSVGA enabled: %ux%ux%u",
     4191                        pThis->svga.uWidth, pThis->svga.uHeight, pThis->svga.uBpp);
     4192    }
     4193#endif
    41284194}
    41294195
     
    42634329             *       frame buffer is done intentionally so that we're more
    42644330             *       likely to obtain the full scrollback of a linux panic.
     4331             * windbg> .printf "------ start -----\n"; .for (r $t0 = 0; @$t0 < 25; r $t0 = @$t0 + 1) { .for (r $t1 = 0; @$t1 < 80; r $t1 = @$t1 + 1) { .printf "%c", by( (@$t0 * 80 + @$t1) * 8 + 100f0000) }; .printf "\n" }; .printf "------ end -----\n";
    42654332             */
    42664333            uint32_t cbLine;
  • trunk/src/VBox/Devices/Graphics/DevVGA.h

    r55493 r55795  
    219219#define VMSVGA_FIFO_EXTCMD_LOADSTATE            3
    220220#define VMSVGA_FIFO_EXTCMD_RESET                4
     221
     222/** Size of the region to backup when switching into svga mode. */
     223#define VMSVGA_FRAMEBUFFER_BACKUP_SIZE  (32*1024)
    221224
    222225typedef struct
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