Changeset 21490 in vbox for trunk/src/VBox/Additions/WINNT/Graphics
- Timestamp:
- Jul 10, 2009 5:29:38 PM (15 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Display
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Display/dd.c
r21253 r21490 1386 1386 DWORD APIENTRY DdSetColorKey(PDD_SETCOLORKEYDATA lpSetColorKey) 1387 1387 { 1388 PPDEV pDev = (PPDEV)lpSetColorKey->lpDD->dhpdev; 1389 DD_SURFACE_LOCAL* lpSurfaceLocal = lpSetColorKey->lpDDSurface; 1390 DD_SURFACE_GLOBAL* lpSurfaceGlobal = lpSurfaceLocal->lpGbl; 1391 VBOXVHWACMD* pCmd; 1392 1388 1393 DISPDBG((0, "%s\n", __FUNCTION__)); 1389 lpSetColorKey->ddRVal = DD_OK; 1394 1395 pCmd = vboxVHWACommandCreate (pDev, VBOXVHWACMD_TYPE_SURF_COLORKEY_SET, sizeof(VBOXVHWACMD_SURF_COLORKEY_SET)); 1396 // int rc = VERR_GENERAL_FAILURE; 1397 if(pCmd) 1398 { 1399 VBOXVHWACMD_SURF_COLORKEY_SET * pBody = VBOXVHWACMD_BODY(pCmd, VBOXVHWACMD_SURF_COLORKEY_SET); 1400 PVBOXVHWASURFDESC pDesc = (PVBOXVHWASURFDESC)lpSurfaceGlobal->dwReserved1; 1401 memset(pBody, 0, sizeof(VBOXVHWACMD_SURF_COLORKEY_SET)); 1402 1403 pBody->u.in.offSurface = (uint64_t)lpSurfaceGlobal->fpVidMem; 1404 pBody->u.in.hSurf = pDesc->hHostHandle; 1405 pBody->u.in.flags = vboxVHWAFromDDCKEYs(lpSetColorKey->dwFlags); 1406 vboxVHWAFromDDCOLORKEY(&pBody->u.in.CKey, &lpSetColorKey->ckNew); 1407 1408 vboxVHWACommandSubmitAsynch(pDev, pCmd, vboxVHWAFreeCmdCompletion, NULL); 1409 lpSetColorKey->ddRVal = DD_OK; 1410 } 1390 1411 return DDHAL_DRIVER_HANDLED; 1391 1412 } … … 1400 1421 DWORD APIENTRY DdBlt(PDD_BLTDATA lpBlt) 1401 1422 { 1402 #ifdef VBOX_WITH_VIDEOHWACCEL1403 1423 PPDEV pDev = (PPDEV)lpBlt->lpDD->dhpdev; 1404 1424 DISPDBG((0, "%s\n", __FUNCTION__)); … … 1457 1477 1458 1478 return DDHAL_DRIVER_HANDLED; 1459 #else1460 lpBlt->ddRVal = DDERR_GENERIC;1461 return DDHAL_DRIVER_NOTHANDLED;1462 #endif1463 1479 } 1464 1480 … … 1472 1488 DWORD APIENTRY DdFlip(PDD_FLIPDATA lpFlip) 1473 1489 { 1474 #ifdef VBOX_WITH_VIDEOHWACCEL1475 1490 PPDEV pDev = (PPDEV)lpFlip->lpDD->dhpdev; 1476 1491 DD_SURFACE_LOCAL* lpTargSurfaceLocal = lpFlip->lpSurfTarg; … … 1524 1539 ASMAtomicIncU32(&pTargDesc->cPendingFlipsTarg); 1525 1540 1526 // if(VBOXDD_CHECKFLAG(lpBlt->dwFlags, DDBLT_ASYNC)) 1527 // { 1528 vboxVHWACommandSubmitAsynch(pDev, pCmd, vboxVHWASurfFlipCompletion, NULL); 1529 // } 1530 // else 1531 // { 1532 // vboxVHWACommandSubmit(pDev, pCmd); 1533 // } 1541 vboxVHWACommandSubmitAsynch(pDev, pCmd, vboxVHWASurfFlipCompletion, NULL); 1542 1534 1543 lpFlip->ddRVal = DD_OK; 1535 1544 } … … 1539 1548 } 1540 1549 return DDHAL_DRIVER_HANDLED; 1541 #else1542 DISPDBG((0, "%s\n", __FUNCTION__));1543 lpFlip->ddRVal = DDERR_GENERIC;1544 return DDHAL_DRIVER_NOTHANDLED;1545 #endif1546 1550 } 1547 1551 … … 1624 1628 DWORD APIENTRY DdSetOverlayPosition(PDD_SETOVERLAYPOSITIONDATA lpSetOverlayPosition) 1625 1629 { 1630 PPDEV pDev = (PPDEV)lpSetOverlayPosition->lpDD->dhpdev; 1631 DD_SURFACE_LOCAL* lpDestSurfaceLocal = lpSetOverlayPosition->lpDDDestSurface; 1632 DD_SURFACE_GLOBAL* lpDestSurfaceGlobal = lpDestSurfaceLocal->lpGbl; 1633 DD_SURFACE_LOCAL* lpSrcSurfaceLocal = lpSetOverlayPosition->lpDDSrcSurface; 1634 DD_SURFACE_GLOBAL* lpSrcSurfaceGlobal = lpSrcSurfaceLocal->lpGbl; 1635 VBOXVHWACMD* pCmd; 1636 PVBOXVHWASURFDESC pSrcDesc = (PVBOXVHWASURFDESC)lpSrcSurfaceGlobal->dwReserved1; 1637 PVBOXVHWASURFDESC pDestDesc = (PVBOXVHWASURFDESC)lpDestSurfaceGlobal->dwReserved1; 1638 1626 1639 DISPDBG((0, "%s\n", __FUNCTION__)); 1627 1640 1628 lpSetOverlayPosition->ddRVal = DD_OK; 1641 if(pSrcDesc->bHidden) 1642 { 1643 lpSetOverlayPosition->ddRVal = DDERR_GENERIC; 1644 return DDHAL_DRIVER_HANDLED; 1645 } 1646 1647 pCmd = vboxVHWACommandCreate (pDev, VBOXVHWACMD_TYPE_SURF_OVERLAY_SETPOSITION, sizeof(VBOXVHWACMD_SURF_OVERLAY_SETPOSITION)); 1648 // int rc = VERR_GENERAL_FAILURE; 1649 if(pCmd) 1650 { 1651 VBOXVHWACMD_SURF_OVERLAY_SETPOSITION * pBody = VBOXVHWACMD_BODY(pCmd, VBOXVHWACMD_SURF_OVERLAY_SETPOSITION); 1652 1653 memset(pBody, 0, sizeof(VBOXVHWACMD_SURF_OVERLAY_SETPOSITION)); 1654 1655 pBody->u.in.offSrcSurface = (uint64_t)lpSrcSurfaceGlobal->fpVidMem; 1656 pBody->u.in.offDstSurface = (uint64_t)lpDestSurfaceGlobal->fpVidMem; 1657 1658 pBody->u.in.hDstSurf = pDestDesc->hHostHandle; 1659 pBody->u.in.hSrcSurf = pSrcDesc->hHostHandle; 1660 1661 pBody->u.in.xPos = lpSetOverlayPosition->lXPos; 1662 pBody->u.in.yPos = lpSetOverlayPosition->lYPos; 1663 1664 vboxVHWACommandSubmitAsynch(pDev, pCmd, vboxVHWAFreeCmdCompletion, NULL); 1665 lpSetOverlayPosition->ddRVal = DD_OK; 1666 } 1667 1629 1668 return DDHAL_DRIVER_HANDLED; 1630 1669 } … … 1632 1671 DWORD APIENTRY DdUpdateOverlay(PDD_UPDATEOVERLAYDATA lpUpdateOverlay) 1633 1672 { 1673 PPDEV pDev = (PPDEV)lpUpdateOverlay->lpDD->dhpdev; 1674 DD_SURFACE_LOCAL* lpDestSurfaceLocal = lpUpdateOverlay->lpDDDestSurface; 1675 DD_SURFACE_GLOBAL* lpDestSurfaceGlobal = lpDestSurfaceLocal->lpGbl; 1676 DD_SURFACE_LOCAL* lpSrcSurfaceLocal = lpUpdateOverlay->lpDDSrcSurface; 1677 DD_SURFACE_GLOBAL* lpSrcSurfaceGlobal = lpSrcSurfaceLocal->lpGbl; 1678 VBOXVHWACMD* pCmd; 1679 PVBOXVHWASURFDESC pSrcDesc = (PVBOXVHWASURFDESC)lpSrcSurfaceGlobal->dwReserved1; 1680 PVBOXVHWASURFDESC pDestDesc = (PVBOXVHWASURFDESC)lpDestSurfaceGlobal->dwReserved1; 1681 1634 1682 DISPDBG((0, "%s\n", __FUNCTION__)); 1635 1683 1636 lpUpdateOverlay->ddRVal = DD_OK; 1684 if(pSrcDesc->bHidden) 1685 { 1686 lpUpdateOverlay->ddRVal = DDERR_GENERIC; 1687 return DDHAL_DRIVER_HANDLED; 1688 } 1689 1690 pCmd = vboxVHWACommandCreate (pDev, VBOXVHWACMD_TYPE_SURF_OVERLAY_UPDATE, sizeof(VBOXVHWACMD_SURF_OVERLAY_UPDATE)); 1691 // int rc = VERR_GENERAL_FAILURE; 1692 if(pCmd) 1693 { 1694 VBOXVHWACMD_SURF_OVERLAY_UPDATE * pBody = VBOXVHWACMD_BODY(pCmd, VBOXVHWACMD_SURF_OVERLAY_UPDATE); 1695 1696 memset(pBody, 0, sizeof(VBOXVHWACMD_SURF_OVERLAY_UPDATE)); 1697 1698 pBody->u.in.offSrcSurface = (uint64_t)lpSrcSurfaceGlobal->fpVidMem; 1699 pBody->u.in.offDstSurface = (uint64_t)lpDestSurfaceGlobal->fpVidMem; 1700 1701 pBody->u.in.hDstSurf = pDestDesc->hHostHandle; 1702 pBody->u.in.hSrcSurf = pSrcDesc->hHostHandle; 1703 1704 vboxVHWAFromRECTL(&pBody->u.in.dstRect, &lpUpdateOverlay->rDest); 1705 vboxVHWAFromRECTL(&pBody->u.in.srcRect, &lpUpdateOverlay->rSrc); 1706 1707 pBody->u.in.flags = vboxVHWAFromDDOVERs(lpUpdateOverlay->dwFlags); 1708 vboxVHWAFromDDOVERLAYFX(&pBody->u.in.desc, &lpUpdateOverlay->overlayFX); 1709 1710 vboxVHWACommandSubmitAsynch(pDev, pCmd, vboxVHWAFreeCmdCompletion, NULL); 1711 lpUpdateOverlay->ddRVal = DD_OK; 1712 } 1713 1637 1714 return DDHAL_DRIVER_HANDLED; 1638 1715 } … … 1780 1857 // 3. Mirroring in X and Y 1781 1858 // 4. ColorKeying from a source color and a source color space 1782 if( (VBOXVHWA_CAP(pDev, VBOXVHWA_CAPS_BLT) || VBOXVHWA_CAP(pDev, VBOXVHWA_CAPS_OVERLAY))1859 if(VBOXVHWA_CAP(pDev, VBOXVHWA_CAPS_BLT) 1783 1860 && VBOXVHWA_CAP(pDev, VBOXVHWA_CAPS_BLTSTRETCH)) 1784 1861 { … … 1794 1871 DDFXCAPS_BLTSHRINKXN; 1795 1872 1796 1797 //mirroring with blitting 1798 pHALInfo->ddCaps.dwFXCaps |= DDFXCAPS_BLTMIRRORUPDOWN 1799 | DDFXCAPS_BLTMIRRORLEFTRIGHT; 1873 // DDFXCAPS_BLTARITHSTRETCHY 1874 // DDFXCAPS_BLTARITHSTRETCHYN 1875 // DDFXCAPS_BLTMIRRORLEFTRIGHT 1876 // DDFXCAPS_BLTMIRRORUPDOWN 1877 // DDFXCAPS_BLTROTATION90 1878 } 1879 1880 if(VBOXVHWA_CAP(pDev, VBOXVHWA_CAPS_OVERLAY) 1881 && VBOXVHWA_CAP(pDev, VBOXVHWA_CAPS_OVERLAYSTRETCH)) 1882 { 1883 // Special effects caps 1884 //TODO: filter them out 1885 pHALInfo->ddCaps.dwFXCaps |= DDFXCAPS_OVERLAYSTRETCHY | 1886 DDFXCAPS_OVERLAYSTRETCHX | 1887 DDFXCAPS_OVERLAYSTRETCHYN | 1888 DDFXCAPS_OVERLAYSTRETCHXN | 1889 DDFXCAPS_OVERLAYSHRINKY | 1890 DDFXCAPS_OVERLAYSHRINKX | 1891 DDFXCAPS_OVERLAYSHRINKYN | 1892 DDFXCAPS_OVERLAYSHRINKXN; 1893 1894 // DDFXCAPS_OVERLAYARITHSTRETCHY 1895 // DDFXCAPS_OVERLAYARITHSTRETCHYN 1896 // DDFXCAPS_OVERLAYMIRRORLEFTRIGHT 1897 // DDFXCAPS_OVERLAYMIRRORUPDOWN 1800 1898 1801 1899 } -
trunk/src/VBox/Additions/WINNT/Graphics/Display/driver.h
r21253 r21490 109 109 volatile uint32_t cPendingFlipsTarg; 110 110 uint32_t cBitsPerPixel; 111 bool bHidden; 112 VBOXVHWAREGION DirtyRegion; 111 113 }VBOXVHWASURFDESC, *PVBOXVHWASURFDESC; 112 114 … … 326 328 327 329 void vboxVHWAFromDDCOLORKEY(VBOXVHWA_COLORKEY *pVHWACKey, DDCOLORKEY *pDdCKey); 330 331 uint32_t vboxVHWAFromDDOVERs(uint32_t caps); 332 uint32_t vboxVHWAToDDOVERs(uint32_t caps); 333 uint32_t vboxVHWAFromDDCKEYs(uint32_t caps); 334 uint32_t vboxVHWAToDDCKEYs(uint32_t caps); 335 336 void vboxVHWAFromDDOVERLAYFX(VBOXVHWA_OVERLAYFX *pVHWAOverlay, DDOVERLAYFX *pDdOverlay); 328 337 329 338 uint32_t vboxVHWAFromDDCAPS(uint32_t caps);
Note:
See TracChangeset
for help on using the changeset viewer.