VirtualBox

Ignore:
Timestamp:
Oct 15, 2010 11:10:10 PM (14 years ago)
Author:
vboxsync
Message:

wddm/3d: chromium hgsmi fixes

File:
1 edited

Legend:

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

    r33165 r33171  
    6060    {
    6161        pInfo->offAlloc = (VBOXVIDEOOFFSET)pDmaAlloc->PhysicalAddress.QuadPart;
     62        pInfo->segmentIdAlloc = pDmaAlloc->SegmentId;
     63    }
     64    else
     65        pInfo->segmentIdAlloc = 0;
     66    pInfo->srcId = pAlloc->SurfDesc.VidPnSourceId;
     67}
     68
     69static void vboxWddmPopulateDmaAllocInfoWithOffset(PVBOXWDDM_DMA_ALLOCINFO pInfo, PVBOXWDDM_ALLOCATION pAlloc, DXGK_ALLOCATIONLIST *pDmaAlloc, uint32_t offStart)
     70{
     71    pInfo->pAlloc = pAlloc;
     72    if (pDmaAlloc->SegmentId)
     73    {
     74        pInfo->offAlloc = (VBOXVIDEOOFFSET)pDmaAlloc->PhysicalAddress.QuadPart + offStart;
    6275        pInfo->segmentIdAlloc = pDmaAlloc->SegmentId;
    6376    }
     
    14371450        case VBOXWDDM_ALLOC_TYPE_UMD_HGSMI_BUFFER:
    14381451        {
    1439             ObDereferenceObject(pAllocation->pSynchEvent);
     1452            if (pAllocation->pSynchEvent)
     1453            {
     1454                ObDereferenceObject(pAllocation->pSynchEvent);
     1455            }
    14401456            break;
    14411457        }
     
    15771593                    pAllocation->SurfDesc.cbSize = pAllocInfo->cbBuffer;
    15781594                    pAllocationInfo->Flags.CpuVisible = 1;
    1579                     pAllocationInfo->Flags.SynchronousPaging = 1;
     1595//                    pAllocationInfo->Flags.SynchronousPaging = 1;
    15801596                    pAllocationInfo->AllocationPriority = D3DDDI_ALLOCATIONPRIORITY_MAXIMUM;
    15811597                    switch (pAllocInfo->enmSynchType)
     
    15951611                        case VBOXUHGSMI_SYNCHOBJECT_TYPE_NONE:
    15961612                            pAllocation->pSynchEvent = NULL;
    1597                             Status == STATUS_SUCCESS;
     1613                            Status = STATUS_SUCCESS;
    15981614                            break;
    15991615                        default:
     
    20332049                        DXGK_ALLOCATIONLIST *pAllocation2Patch = (DXGK_ALLOCATIONLIST*)(pPrivateBuf + pPatchList->PatchOffset);
    20342050                        pAllocation2Patch->SegmentId = pAllocationList->SegmentId;
    2035                         pAllocation2Patch->PhysicalAddress = pAllocationList->PhysicalAddress;
     2051                        pAllocation2Patch->PhysicalAddress.QuadPart = pAllocationList->PhysicalAddress.QuadPart + pPatchList->AllocationOffset;
     2052                        Assert(!(pAllocationList->PhysicalAddress.QuadPart & 0xfffUL)); /* <- just a check to ensure allocation offset does not go here */
    20362053                    }
    20372054                }
     
    25432560
    25442561    NTSTATUS Status = STATUS_SUCCESS;
     2562    PDEVICE_EXTENSION pDevExt = (PDEVICE_EXTENSION)hAdapter;
    25452563
    25462564    dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", hAdapter));
     
    25512569        case DXGK_OPERATION_TRANSFER:
    25522570        {
     2571            PVBOXWDDM_ALLOCATION pAlloc = (PVBOXWDDM_ALLOCATION)pBuildPagingBuffer->Transfer.hAllocation;
     2572            uint8_t* pvVramBase = pDevExt->pvVisibleVram;
     2573            SIZE_T cbSize = pBuildPagingBuffer->Transfer.TransferSize;
     2574            uint8_t *pvSrc, *pvDst;
     2575            if (pBuildPagingBuffer->Transfer.Source.SegmentId)
     2576            {
     2577#ifdef DEBUG_misha
     2578                Assert(pBuildPagingBuffer->Transfer.Source.SegmentAddress.QuadPart);
     2579#endif
     2580                pvSrc  = pvVramBase + pBuildPagingBuffer->Transfer.Source.SegmentAddress.QuadPart;
     2581                pvSrc += pBuildPagingBuffer->Transfer.TransferOffset;
     2582            }
     2583            else
     2584            {
     2585                pvSrc  = (uint8_t*)MmGetMdlVirtualAddress(pBuildPagingBuffer->Transfer.Source.pMdl);
     2586                pvSrc += pBuildPagingBuffer->Transfer.MdlOffset * 0x1000 /* page size */;
     2587            }
     2588
     2589            if (pBuildPagingBuffer->Transfer.Destination.SegmentId)
     2590            {
     2591#ifdef DEBUG_misha
     2592                Assert(pBuildPagingBuffer->Transfer.Destination.SegmentAddress.QuadPart);
     2593#endif
     2594                pvDst  = pvVramBase + pBuildPagingBuffer->Transfer.Destination.SegmentAddress.QuadPart;
     2595                pvDst += pBuildPagingBuffer->Transfer.TransferOffset;
     2596            }
     2597            else
     2598            {
     2599                pvDst  = (uint8_t*)MmGetMdlVirtualAddress(pBuildPagingBuffer->Transfer.Destination.pMdl);
     2600                pvDst += pBuildPagingBuffer->Transfer.MdlOffset * 0x1000 /* page size */;
     2601            }
     2602
     2603            memcpy(pvDst, pvSrc, cbSize);
    25532604//            pBuildPagingBuffer->pDmaBuffer = (uint8_t*)pBuildPagingBuffer->pDmaBuffer + VBOXVDMACMD_SIZE(VBOXVDMACMD_DMA_BPB_TRANSFER);
    25542605            break;
     
    40674118            {
    40684119                PVBOXWDDM_ALLOCATION pAlloc = vboxWddmGetAllocationFromAllocList(pDevExt, pAllocationList);
    4069                 vboxWddmPopulateDmaAllocInfo(&pSubmInfo->Alloc, pAlloc, pAllocationList);
     4120                vboxWddmPopulateDmaAllocInfoWithOffset(&pSubmInfo->Alloc, pAlloc, pAllocationList, pSubmUmInfo->offData);
    40704121
    40714122                pSubmInfo->cbData = pSubmUmInfo->cbData;
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