VirtualBox

Changeset 26661 in vbox for trunk/src/VBox/Additions


Ignore:
Timestamp:
Feb 19, 2010 3:08:15 PM (15 years ago)
Author:
vboxsync
Message:

wddm: more impl

Location:
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVdma.cpp

    r26556 r26661  
    165165}
    166166
    167 PVBOXVDMACBUF_DR vboxVdmaCBufDrCreate (PVBOXVDMAINFO pInfo, PVBOXVDMACMDBUF_INFO pBufInfo, uint32_t u32FenceId)
     167PVBOXVDMACBUF_DR vboxVdmaCBufDrCreate (PVBOXVDMAINFO pInfo, PVBOXVDMACMDBUF_INFO pBufInfo)
    168168{
    169169    PVBOXVDMACBUF_DR pCmdDr;
     
    188188
    189189        if (!(pBufInfo->fFlags & VBOXVDMACBUF_FLAG_BUF_VRAM_OFFSET))
    190             pCmdDr->phBuf = pBufInfo->Location.phBuf;
     190            pCmdDr->Location.phBuf = pBufInfo->Location.phBuf;
    191191        else
    192             pCmdDr->phBuf = pBufInfo->Location.offVramBuf;
     192            pCmdDr->Location.offVramBuf = pBufInfo->Location.offVramBuf;
    193193    }
    194194
    195195    pCmdDr->fFlags = pBufInfo->fFlags;
    196196    pCmdDr->cbBuf = pBufInfo->cbBuf;
    197     pCmdDr->u32FenceId = u32FenceId;
     197    pCmdDr->u32FenceId = pBufInfo->u32FenceId;
    198198
    199199    return pCmdDr;
     
    259259}
    260260
    261 int vboxVdmaCBufSubmit (PDEVICE_EXTENSION pDevExt, PVBOXVDMAINFO pInfo, PVBOXVDMACMDBUF_INFO pBufInfo, uint32_t u32FenceId)
    262 {
    263     dfprintf((__FUNCTION__"\n"));
    264 
    265     PVBOXVDMACBUF_DR pdr = vboxVdmaCBufDrCreate (pInfo, pBufInfo, u32FenceId);
     261int vboxVdmaCBufSubmit (PDEVICE_EXTENSION pDevExt, PVBOXVDMAINFO pInfo, PVBOXVDMACMDBUF_INFO pBufInfo)
     262{
     263    dfprintf((__FUNCTION__"\n"));
     264
     265    PVBOXVDMACBUF_DR pdr = vboxVdmaCBufDrCreate (pInfo, pBufInfo);
    266266    if (!pdr)
    267267        return VERR_OUT_OF_RESOURCES;
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVdma.h

    r26556 r26661  
    3838        void *pvBuf;
    3939    } Location;
     40    uint32_t u32FenceId;
    4041} VBOXVDMACMDBUF_INFO, *PVBOXVDMACMDBUF_INFO;
    4142
     
    4546int vboxVdmaFlush (struct _DEVICE_EXTENSION* pDevExt, PVBOXVDMAINFO pInfo);
    4647int vboxVdmaDestroy (struct _DEVICE_EXTENSION* pDevExt, PVBOXVDMAINFO pInfo);
    47 int vboxVdmaCBufSubmit (struct _DEVICE_EXTENSION* pDevExt, PVBOXVDMAINFO pInfo, PVBOXVDMACMDBUF_INFO pBufInfo, uint32_t u32FenceId);
     48int vboxVdmaCBufSubmit (struct _DEVICE_EXTENSION* pDevExt, PVBOXVDMAINFO pInfo, PVBOXVDMACMDBUF_INFO pBufInfo);
    4849
    4950#endif /* #ifndef ___VBoxVideoVdma_h___ */
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp

    r26630 r26661  
    12021202                            PVBOXWDDM_ALLOCATION_SHAREDPRIMARYSURFACE pAlloc = VBOXWDDM_ALLOCATION_BODY(pAllocInfo, VBOXWDDM_ALLOCATION_SHAREDPRIMARYSURFACE);
    12031203                            PVBOXWDDM_ALLOCINFO_SHAREDPRIMARYSURFACE pAllocI = VBOXWDDM_ALLOCINFO_BODY(pAllocInfo, VBOXWDDM_ALLOCINFO_SHAREDPRIMARYSURFACE);
    1204 //                            memcpy(&pAlloc->AllocInfo, pInfo, sizeof (pAlloc->AllocInfo));
    12051204                            pAlloc->RefreshRate = pAllocI->RefreshRate;
    12061205                            pAlloc->VidPnSourceId = pAllocI->VidPnSourceId;
    1207                             pAlloc->offAddress = VBOXVIDEOOFFSET_VOID;
     1206//                            pAlloc->offAddress = VBOXVIDEOOFFSET_VOID;
    12081207                            pAlloc->bVisible = FALSE;
    12091208
     
    15001499    CONST DXGKARG_PATCH*  pPatch)
    15011500{
    1502     return STATUS_NOT_IMPLEMENTED;
     1501    /* DxgkDdiPatch should be made pageable. */
     1502    PAGED_CODE();
     1503
     1504    NTSTATUS Status = STATUS_SUCCESS;
     1505
     1506    dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", hAdapter));
     1507
     1508    /* Value == 2 is Present
     1509     * Value == 4 is RedirectedPresent
     1510     * we do not expect any other flags to be set here */
     1511    Assert(pPatch->Flags.Value == 2 || pPatch->Flags.Value == 4);
     1512
     1513    uint8_t *pBuf = ((uint8_t *)pPatch->pDmaBuffer) + pPatch->DmaBufferPrivateDataSubmissionStartOffset;
     1514    for (UINT i = pPatch->PatchLocationListSubmissionStart; i < pPatch->PatchLocationListSubmissionLength; ++i)
     1515    {
     1516        const D3DDDI_PATCHLOCATIONLIST* pPatchList = &pPatch->pPatchLocationList[i];
     1517        Assert(pPatchList->AllocationIndex < pPatch->AllocationListSize);
     1518        const DXGK_ALLOCATIONLIST *pAllocationList = &pPatch->pAllocationList[pPatchList->AllocationIndex];
     1519        if (pAllocationList->PhysicalAddress.QuadPart)
     1520        {
     1521            Assert(pPatchList->PatchOffset < (pPatch->DmaBufferPrivateDataSubmissionEndOffset - pPatch->DmaBufferPrivateDataSubmissionStartOffset));
     1522            *((PHYSICAL_ADDRESS*)(pBuf+pPatchList->PatchOffset)) = pAllocationList->PhysicalAddress;
     1523        }
     1524        else
     1525        {
     1526            /* sanity */
     1527            if (pPatch->Flags.Value == 2 || pPatch->Flags.Value == 4)
     1528                Assert(i == 0);
     1529        }
     1530    }
     1531
     1532    dfprintf(("<== "__FUNCTION__ ", context(0x%x)\n", hAdapter));
     1533
     1534    return Status;
    15031535}
    15041536
     
    15091541    CONST DXGKARG_SUBMITCOMMAND*  pSubmitCommand)
    15101542{
    1511     return STATUS_NOT_IMPLEMENTED;
     1543    /* DxgkDdiSubmitCommand runs at dispatch, should not be pageable. */
     1544    NTSTATUS Status = STATUS_SUCCESS;
     1545
     1546    dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", hAdapter));
     1547
     1548    PDEVICE_EXTENSION pDevExt = (PDEVICE_EXTENSION)hAdapter;
     1549    VBOXVDMACMDBUF_INFO BufInfo = {0};
     1550
     1551    Assert(pSubmitCommand->DmaBufferSegmentId);
     1552
     1553    /* the DMA command buffer is located in system RAM, the host will need to pick it from there */
     1554    //BufInfo.fFlags = 0; /* see VBOXVDMACBUF_FLAG_xx */
     1555    BufInfo.cbBuf =  pSubmitCommand->DmaBufferPrivateDataSubmissionEndOffset - pSubmitCommand->DmaBufferPrivateDataSubmissionStartOffset;
     1556    BufInfo.Location.phBuf = pSubmitCommand->DmaBufferPhysicalAddress.QuadPart + pSubmitCommand->DmaBufferPrivateDataSubmissionStartOffset;
     1557    BufInfo.u32FenceId = pSubmitCommand->SubmissionFenceId;
     1558
     1559    int rc = vboxVdmaCBufSubmit (pDevExt, &pDevExt->u.primary.Vdma, &BufInfo);
     1560    AssertRC(rc);
     1561    if (!RT_SUCCESS(rc))
     1562    {
     1563        switch (rc)
     1564        {
     1565            case VERR_OUT_OF_RESOURCES:
     1566                /* @todo: try flushing.. */
     1567                Status = STATUS_INSUFFICIENT_RESOURCES;
     1568                break;
     1569            default:
     1570                Status = STATUS_UNSUCCESSFUL;
     1571                break;
     1572        }
     1573    }
     1574
     1575    dfprintf(("<== "__FUNCTION__ ", context(0x%x)\n", hAdapter));
     1576
     1577    return Status;
    15121578}
    15131579
     
    15271593    DXGKARG_BUILDPAGINGBUFFER*  pBuildPagingBuffer)
    15281594{
    1529     return STATUS_NOT_IMPLEMENTED;
     1595    /* DxgkDdiBuildPagingBuffer should be made pageable. */
     1596    PAGED_CODE();
     1597
     1598    NTSTATUS Status = STATUS_SUCCESS;
     1599
     1600    dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", hAdapter));
     1601
     1602    dfprintf(("<== "__FUNCTION__ ", context(0x%x)\n", hAdapter));
     1603
     1604    return Status;
     1605
    15301606}
    15311607
     
    22252301                    if (vboxWddmPixFormatConversionSupported(pSrcAlloc->u.SurfInfo.format, pDstAlloc->u.SurfInfo.format))
    22262302                    {
    2227                         memset(pPresent->pPatchLocationListOut, 0, 2*sizeof (D3DDDI_PATCHLOCATIONLIST));
    2228                         pPresent->pPatchLocationListOut->PatchOffset = VBOXVDMACMD_BODY_FIELD_OFFSET(UINT, VBOXVDMACMD_DMA_PRESENT_BLT, offSrc);
     2303                        memset(pPresent->pPatchLocationListOut, 0, 3*sizeof (D3DDDI_PATCHLOCATIONLIST));
     2304                        pPresent->pPatchLocationListOut->PatchOffset = 0;
    22292305                        ++pPresent->pPatchLocationListOut;
    2230                         pPresent->pPatchLocationListOut->PatchOffset = VBOXVDMACMD_BODY_FIELD_OFFSET(UINT, VBOXVDMACMD_DMA_PRESENT_BLT, offDst);
    2231                         pPresent->pPatchLocationListOut->AllocationIndex = 1;
     2306                        pPresent->pPatchLocationListOut->PatchOffset = VBOXVDMACMD_BODY_FIELD_OFFSET(UINT, VBOXVDMACMD_DMA_PRESENT_BLT, phSrc);
     2307                        pPresent->pPatchLocationListOut->AllocationIndex = DXGK_PRESENT_SOURCE_INDEX;
     2308                        ++pPresent->pPatchLocationListOut;
     2309                        pPresent->pPatchLocationListOut->PatchOffset = VBOXVDMACMD_BODY_FIELD_OFFSET(UINT, VBOXVDMACMD_DMA_PRESENT_BLT, phDst);
     2310                        pPresent->pPatchLocationListOut->AllocationIndex = DXGK_PRESENT_DESTINATION_INDEX;
    22322311                        ++pPresent->pPatchLocationListOut;
    22332312
     
    22352314                        pCmd->u32CmdSpecific = 0;
    22362315                        PVBOXVDMACMD_DMA_PRESENT_BLT pTransfer = VBOXVDMACMD_BODY(pCmd, VBOXVDMACMD_DMA_PRESENT_BLT);
    2237                         pTransfer->offSrc = vboxWddmOffsetFromPhAddress(pSrc->PhysicalAddress);
    2238                         pTransfer->offDst = vboxWddmOffsetFromPhAddress(pDst->PhysicalAddress);
     2316                        pTransfer->phSrc = pSrc->PhysicalAddress.QuadPart;
     2317                        pTransfer->phDst = pDst->PhysicalAddress.QuadPart;
    22392318                        vboxWddmSurfDescFromAllocation(pSrcAlloc, &pTransfer->srcDesc);
    22402319                        vboxWddmSurfDescFromAllocation(pDstAlloc, &pTransfer->dstDesc);
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.h

    r26630 r26661  
    6767{
    6868    VBOXWDDM_ALLOC_TYPE enmType;
     69    PHYSICAL_ADDRESS phAddress;
     70    BOOLEAN bPagedIn;
    6971    union
    7072    {
     
    8385    D3DDDI_RATIONAL RefreshRate;
    8486    D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId;
    85     VBOXVIDEOOFFSET offAddress;
     87//    VBOXVIDEOOFFSET offAddress;
    8688    BOOLEAN bVisible;
    8789} VBOXWDDM_ALLOCATION_SHAREDPRIMARYSURFACE, *PVBOXWDDM_ALLOCATION_SHAREDPRIMARYSURFACE;
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