VirtualBox

Changeset 51111 in vbox for trunk/src/VBox/Devices/Graphics


Ignore:
Timestamp:
Apr 21, 2014 6:22:49 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
93407
Message:

wddm/crOpenGL/DevVGA: impl missing CrCmd commands, some adjustments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Graphics/DevVGA_VDMA.cpp

    r51101 r51111  
    15391539}
    15401540
     1541static int8_t vboxVDMACrCmdVbvaPagingFill(PVGASTATE pVGAState, VBOXCMDVBVA_PAGING_FILL *pFill)
     1542{
     1543    VBOXCMDVBVAOFFSET offVRAM = pFill->offVRAM;
     1544    if (offVRAM & PAGE_OFFSET_MASK)
     1545    {
     1546        WARN(("offVRAM address is not on page boundary\n"));
     1547        return -1;
     1548    }
     1549
     1550    uint8_t * pu8VramBase = pVGAState->vram_ptrR3;
     1551    uint8_t *pu8VramMax = pu8VramBase + pVGAState->vram_size;
     1552    if (offVRAM >= pVGAState->vram_size)
     1553    {
     1554        WARN(("invalid vram offset"));
     1555        return -1;
     1556    }
     1557
     1558    uint32_t cbFill = pFill->u32CbFill;
     1559
     1560    if (offVRAM + cbFill >= pVGAState->vram_size)
     1561    {
     1562        WARN(("invalid cPages"));
     1563        return -1;
     1564    }
     1565
     1566    uint32_t *pu32Vram = (uint32_t*)(pu8VramBase + offVRAM);
     1567    uint32_t u32Color = pFill->u32Pattern;
     1568
     1569    Assert(!(cbFill % 4));
     1570    for (uint32_t i = 0; i < cbFill / 4; ++i)
     1571    {
     1572        pu32Vram[i] = u32Color;
     1573    }
     1574
     1575    return 0;
     1576}
     1577
    15411578static int8_t vboxVDMACrCmdVbvaProcessCmdData(struct VBOXVDMAHOST *pVdma, const VBOXCMDVBVA_HDR *pCmd, uint32_t cbCmd)
    15421579{
     
    15721609        }
    15731610        case VBOXCMDVBVA_OPTYPE_PAGING_FILL:
    1574             WARN(("VBOXCMDVBVA_OPTYPE_PAGING_FILL not implemented"));
    1575             return -1;
     1611        {
     1612            PVGASTATE pVGAState = pVdma->pVGAState;
     1613            if (cbCmd != sizeof (VBOXCMDVBVA_PAGING_FILL))
     1614            {
     1615                WARN(("cmd too small"));
     1616                return -1;
     1617            }
     1618
     1619            return vboxVDMACrCmdVbvaPagingFill(pVGAState, (VBOXCMDVBVA_PAGING_FILL*)pCmd);
     1620        }
    15761621        default:
    15771622            return pVdma->CrSrvInfo.pfnCmd(pVdma->CrSrvInfo.hSvr, pCmd, cbCmd);
Note: See TracChangeset for help on using the changeset viewer.

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