VirtualBox

Changeset 80486 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Aug 28, 2019 8:24:03 PM (5 years ago)
Author:
vboxsync
Message:

WDDM: removed obsolete VBOXVDMA code. bugref:9529

Location:
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPTypes.h

    r80422 r80486  
    255255} VBOXWDDM_CONTEXT, *PVBOXWDDM_CONTEXT;
    256256
    257 typedef struct VBOXWDDM_DMA_PRIVATEDATA_PRESENTHDR
    258 {
    259     VBOXWDDM_DMA_PRIVATEDATA_BASEHDR BaseHdr;
    260 }VBOXWDDM_DMA_PRIVATEDATA_PRESENTHDR, *PVBOXWDDM_DMA_PRIVATEDATA_PRESENTHDR;
    261 
    262 #ifdef VBOXWDDM_RENDER_FROM_SHADOW
    263 
    264 typedef struct VBOXWDDM_DMA_PRIVATEDATA_SHADOW2PRIMARY
    265 {
    266     VBOXWDDM_DMA_PRIVATEDATA_PRESENTHDR Hdr;
    267     VBOXVDMA_SHADOW2PRIMARY Shadow2Primary;
    268 } VBOXWDDM_DMA_PRIVATEDATA_SHADOW2PRIMARY, *PVBOXWDDM_DMA_PRIVATEDATA_SHADOW2PRIMARY;
    269 
    270 #endif
    271 
    272 typedef struct VBOXWDDM_DMA_PRIVATEDATA_BLT
    273 {
    274     VBOXWDDM_DMA_PRIVATEDATA_PRESENTHDR Hdr;
    275     VBOXVDMA_BLT Blt;
    276 } VBOXWDDM_DMA_PRIVATEDATA_BLT, *PVBOXWDDM_DMA_PRIVATEDATA_BLT;
    277 
    278 typedef struct VBOXWDDM_DMA_PRIVATEDATA_FLIP
    279 {
    280     VBOXWDDM_DMA_PRIVATEDATA_PRESENTHDR Hdr;
    281     VBOXVDMA_FLIP Flip;
    282 } VBOXWDDM_DMA_PRIVATEDATA_FLIP, *PVBOXWDDM_DMA_PRIVATEDATA_FLIP;
    283 
    284 typedef struct VBOXWDDM_DMA_PRIVATEDATA_CLRFILL
    285 {
    286     VBOXWDDM_DMA_PRIVATEDATA_PRESENTHDR Hdr;
    287     VBOXVDMA_CLRFILL ClrFill;
    288 } VBOXWDDM_DMA_PRIVATEDATA_CLRFILL, *PVBOXWDDM_DMA_PRIVATEDATA_CLRFILL;
    289 
    290 typedef struct VBOXWDDM_UHGSMI_BUFFER_SUBMIT_INFO
    291 {
    292     VBOXWDDM_DMA_ALLOCINFO Alloc;
    293     uint32_t cbData;
    294     uint32_t bDoNotSignalCompletion;
    295 } VBOXWDDM_UHGSMI_BUFFER_SUBMIT_INFO, *PVBOXWDDM_UHGSMI_BUFFER_SUBMIT_INFO;
    296 
    297 typedef struct VBOXWDDM_DMA_PRIVATEDATA_ALLOCINFO_ON_SUBMIT
    298 {
    299     VBOXWDDM_DMA_PRIVATEDATA_BASEHDR Base;
    300     VBOXWDDM_DMA_ALLOCINFO aInfos[1];
    301 } VBOXWDDM_DMA_PRIVATEDATA_ALLOCINFO_ON_SUBMIT, *PVBOXWDDM_DMA_PRIVATEDATA_ALLOCINFO_ON_SUBMIT;
    302 
    303257typedef struct VBOXWDDM_OPENALLOCATION
    304258{
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVdma.cpp

    r80422 r80486  
    2323#include <iprt/mem.h>
    2424
    25 static NTSTATUS vboxVdmaCrCtlGetDefaultClientId(PVBOXMP_DEVEXT pDevExt, uint32_t *pu32ClienID);
    26 
    27 NTSTATUS vboxVdmaPipeConstruct(PVBOXVDMAPIPE pPipe)
    28 {
    29     KeInitializeSpinLock(&pPipe->SinchLock);
    30     KeInitializeEvent(&pPipe->Event, SynchronizationEvent, FALSE);
    31     InitializeListHead(&pPipe->CmdListHead);
    32     pPipe->enmState = VBOXVDMAPIPE_STATE_CREATED;
    33     pPipe->bNeedNotify = true;
    34     return STATUS_SUCCESS;
    35 }
    36 
    37 NTSTATUS vboxVdmaPipeSvrOpen(PVBOXVDMAPIPE pPipe)
    38 {
    39     NTSTATUS Status = STATUS_SUCCESS;
    40     KIRQL OldIrql;
    41     KeAcquireSpinLock(&pPipe->SinchLock, &OldIrql);
    42     Assert(pPipe->enmState == VBOXVDMAPIPE_STATE_CREATED);
    43     switch (pPipe->enmState)
    44     {
    45         case VBOXVDMAPIPE_STATE_CREATED:
    46             pPipe->enmState = VBOXVDMAPIPE_STATE_OPENNED;
    47             pPipe->bNeedNotify = false;
    48             break;
    49         case VBOXVDMAPIPE_STATE_OPENNED:
    50             pPipe->bNeedNotify = false;
    51             break;
    52         default:
    53             AssertBreakpoint();
    54             Status = STATUS_INVALID_PIPE_STATE;
    55             break;
    56     }
    57 
    58     KeReleaseSpinLock(&pPipe->SinchLock, OldIrql);
    59     return Status;
    60 }
    61 
    62 NTSTATUS vboxVdmaPipeSvrClose(PVBOXVDMAPIPE pPipe)
    63 {
    64     NTSTATUS Status = STATUS_SUCCESS;
    65     KIRQL OldIrql;
    66     KeAcquireSpinLock(&pPipe->SinchLock, &OldIrql);
    67     Assert(pPipe->enmState == VBOXVDMAPIPE_STATE_CLOSED
    68             || pPipe->enmState == VBOXVDMAPIPE_STATE_CLOSING);
    69     switch (pPipe->enmState)
    70     {
    71         case VBOXVDMAPIPE_STATE_CLOSING:
    72             pPipe->enmState = VBOXVDMAPIPE_STATE_CLOSED;
    73             break;
    74         case VBOXVDMAPIPE_STATE_CLOSED:
    75             break;
    76         default:
    77             AssertBreakpoint();
    78             Status = STATUS_INVALID_PIPE_STATE;
    79             break;
    80     }
    81 
    82     KeReleaseSpinLock(&pPipe->SinchLock, OldIrql);
    83     return Status;
    84 }
    85 
    86 NTSTATUS vboxVdmaPipeCltClose(PVBOXVDMAPIPE pPipe)
    87 {
    88     NTSTATUS Status = STATUS_SUCCESS;
    89     KIRQL OldIrql;
    90     KeAcquireSpinLock(&pPipe->SinchLock, &OldIrql);
    91     bool bNeedNotify = false;
    92     Assert(pPipe->enmState == VBOXVDMAPIPE_STATE_OPENNED
    93                 || pPipe->enmState == VBOXVDMAPIPE_STATE_CREATED
    94                 ||  pPipe->enmState == VBOXVDMAPIPE_STATE_CLOSED);
    95     switch (pPipe->enmState)
    96     {
    97         case VBOXVDMAPIPE_STATE_OPENNED:
    98             pPipe->enmState = VBOXVDMAPIPE_STATE_CLOSING;
    99             bNeedNotify = pPipe->bNeedNotify;
    100             pPipe->bNeedNotify = false;
    101             break;
    102         case VBOXVDMAPIPE_STATE_CREATED:
    103             pPipe->enmState = VBOXVDMAPIPE_STATE_CLOSED;
    104             pPipe->bNeedNotify = false;
    105             break;
    106         case VBOXVDMAPIPE_STATE_CLOSED:
    107             break;
    108         default:
    109             AssertBreakpoint();
    110             Status = STATUS_INVALID_PIPE_STATE;
    111             break;
    112     }
    113 
    114     KeReleaseSpinLock(&pPipe->SinchLock, OldIrql);
    115 
    116     if (bNeedNotify)
    117     {
    118         KeSetEvent(&pPipe->Event, 0, FALSE);
    119     }
    120     return Status;
    121 }
    122 
    123 NTSTATUS vboxVdmaPipeDestruct(PVBOXVDMAPIPE pPipe)
    124 {
    125     Assert(pPipe->enmState == VBOXVDMAPIPE_STATE_CLOSED
    126             || pPipe->enmState == VBOXVDMAPIPE_STATE_CREATED);
    127     /* ensure the pipe is closed */
    128     NTSTATUS Status = vboxVdmaPipeCltClose(pPipe);
    129     AssertNtStatusSuccess(Status);
    130 
    131     Assert(pPipe->enmState == VBOXVDMAPIPE_STATE_CLOSED);
    132 
    133     return Status;
    134 }
    135 
    136 NTSTATUS vboxVdmaPipeSvrCmdGetList(PVBOXVDMAPIPE pPipe, PLIST_ENTRY pDetachHead)
    137 {
    138     KIRQL OldIrql;
    139     NTSTATUS Status = STATUS_SUCCESS;
    140     VBOXVDMAPIPE_STATE enmState = VBOXVDMAPIPE_STATE_CLOSED;
    141     do
    142     {
    143         bool bListEmpty = true;
    144         KeAcquireSpinLock(&pPipe->SinchLock, &OldIrql);
    145         Assert(pPipe->enmState == VBOXVDMAPIPE_STATE_OPENNED
    146                 || pPipe->enmState == VBOXVDMAPIPE_STATE_CLOSING);
    147         Assert(pPipe->enmState >= VBOXVDMAPIPE_STATE_OPENNED);
    148         enmState = pPipe->enmState;
    149         if (enmState >= VBOXVDMAPIPE_STATE_OPENNED)
    150         {
    151             vboxVideoLeDetach(&pPipe->CmdListHead, pDetachHead);
    152             bListEmpty = !!(IsListEmpty(pDetachHead));
    153             pPipe->bNeedNotify = bListEmpty;
    154         }
    155         else
    156         {
    157             KeReleaseSpinLock(&pPipe->SinchLock, OldIrql);
    158             Status = STATUS_INVALID_PIPE_STATE;
    159             break;
    160         }
    161 
    162         KeReleaseSpinLock(&pPipe->SinchLock, OldIrql);
    163 
    164         if (!bListEmpty)
    165         {
    166             AssertNtStatusSuccess(Status);
    167             break;
    168         }
    169 
    170         if (enmState == VBOXVDMAPIPE_STATE_OPENNED)
    171         {
    172             Status = KeWaitForSingleObject(&pPipe->Event, Executive, KernelMode, FALSE, NULL /* PLARGE_INTEGER Timeout */);
    173             AssertNtStatusSuccess(Status);
    174             if (Status != STATUS_SUCCESS)
    175                 break;
    176         }
    177         else
    178         {
    179             Assert(enmState == VBOXVDMAPIPE_STATE_CLOSING);
    180             Status = STATUS_PIPE_CLOSING;
    181             break;
    182         }
    183     } while (1);
    184 
    185     return Status;
    186 }
    187 
    188 NTSTATUS vboxVdmaPipeCltCmdPut(PVBOXVDMAPIPE pPipe, PVBOXVDMAPIPE_CMD_HDR pCmd)
    189 {
    190     NTSTATUS Status = STATUS_SUCCESS;
    191     KIRQL OldIrql;
    192     bool bNeedNotify = false;
    193 
    194     KeAcquireSpinLock(&pPipe->SinchLock, &OldIrql);
    195 
    196     Assert(pPipe->enmState == VBOXVDMAPIPE_STATE_OPENNED);
    197     if (pPipe->enmState == VBOXVDMAPIPE_STATE_OPENNED)
    198     {
    199         bNeedNotify = pPipe->bNeedNotify;
    200         InsertHeadList(&pPipe->CmdListHead, &pCmd->ListEntry);
    201         pPipe->bNeedNotify = false;
    202     }
    203     else
    204         Status = STATUS_INVALID_PIPE_STATE;
    205 
    206     KeReleaseSpinLock(&pPipe->SinchLock, OldIrql);
    207 
    208     if (bNeedNotify)
    209     {
    210         KeSetEvent(&pPipe->Event, 0, FALSE);
    211     }
    212 
    213     return Status;
    214 }
    215 
    216 DECLINLINE(void) vboxVdmaDirtyRectsCalcIntersection(const RECT *pArea, const VBOXWDDM_RECTS_INFO *pRects, PVBOXWDDM_RECTS_INFO pResult)
    217 {
    218     uint32_t cRects = 0;
    219     for (uint32_t i = 0; i < pRects->cRects; ++i)
    220     {
    221         if (vboxWddmRectIntersection(pArea, &pRects->aRects[i], &pResult->aRects[cRects]))
    222         {
    223             ++cRects;
    224         }
    225     }
    226 
    227     pResult->cRects = cRects;
    228 }
    229 
    230 DECLINLINE(bool) vboxVdmaDirtyRectsHasIntersections(const RECT *paRects1, uint32_t cRects1, const RECT *paRects2, uint32_t cRects2)
    231 {
    232     RECT tmpRect;
    233     for (uint32_t i = 0; i < cRects1; ++i)
    234     {
    235         const RECT * pRect1 = &paRects1[i];
    236         for (uint32_t j = 0; j < cRects2; ++j)
    237         {
    238             const RECT * pRect2 = &paRects2[j];
    239             if (vboxWddmRectIntersection(pRect1, pRect2, &tmpRect))
    240                 return true;
    241         }
    242     }
    243     return false;
    244 }
    245 
    246 DECLINLINE(bool) vboxVdmaDirtyRectsIsCover(const RECT *paRects, uint32_t cRects, const RECT *paRectsCovered, uint32_t cRectsCovered)
    247 {
    248     for (uint32_t i = 0; i < cRectsCovered; ++i)
    249     {
    250         const RECT * pRectCovered = &paRectsCovered[i];
    251         uint32_t j = 0;
    252         for (; j < cRects; ++j)
    253         {
    254             const RECT * pRect = &paRects[j];
    255             if (vboxWddmRectIsCoveres(pRect, pRectCovered))
    256                 break;
    257         }
    258         if (j == cRects)
    259             return false;
    260     }
    261     return true;
    262 }
    263 
    264 static VOID vboxWddmBltPipeRectsTranslate(VBOXVDMAPIPE_RECTS *pRects, int x, int y)
    265 {
    266     vboxWddmRectTranslate(&pRects->ContextRect, x, y);
    267 
    268     for (UINT i = 0; i < pRects->UpdateRects.cRects; ++i)
    269     {
    270         vboxWddmRectTranslate(&pRects->UpdateRects.aRects[i], x, y);
    271     }
    272 }
    273 
    274 static VBOXVDMAPIPE_RECTS * vboxWddmBltPipeRectsDup(const VBOXVDMAPIPE_RECTS *pRects)
    275 {
    276     const size_t cbDup = RT_UOFFSETOF_DYN(VBOXVDMAPIPE_RECTS, UpdateRects.aRects[pRects->UpdateRects.cRects]);
    277     VBOXVDMAPIPE_RECTS *pDup = (VBOXVDMAPIPE_RECTS*)vboxWddmMemAllocZero(cbDup);
    278     if (!pDup)
    279     {
    280         WARN(("vboxWddmMemAllocZero failed"));
    281         return NULL;
    282     }
    283     memcpy(pDup, pRects, cbDup);
    284     return pDup;
    285 }
    286 
    287 static NTSTATUS vboxVdmaGgDmaColorFill(PVBOXMP_DEVEXT pDevExt, VBOXVDMA_CLRFILL *pCF)
    288 {
    289     NTSTATUS Status = STATUS_UNSUCCESSFUL;
    290     Assert (pDevExt->pvVisibleVram);
    291     if (pDevExt->pvVisibleVram)
    292     {
    293         PVBOXWDDM_ALLOCATION pAlloc = pCF->Alloc.pAlloc;
    294         if (pAlloc->AllocData.Addr.SegmentId && pAlloc->AllocData.Addr.SegmentId != 1)
    295         {
    296             WARN(("request to collor fill invalid allocation"));
    297             return STATUS_INVALID_PARAMETER;
    298         }
    299 
    300         VBOXVIDEOOFFSET offVram = vboxWddmAddrFramOffset(&pAlloc->AllocData.Addr);
    301         if (offVram != VBOXVIDEOOFFSET_VOID)
    302         {
    303             RECT UnionRect = {0};
    304             uint8_t *pvMem = pDevExt->pvVisibleVram + offVram;
    305             UINT bpp = pAlloc->AllocData.SurfDesc.bpp;
    306             Assert(bpp);
    307             Assert(((bpp * pAlloc->AllocData.SurfDesc.width) >> 3) == pAlloc->AllocData.SurfDesc.pitch);
    308             switch (bpp)
    309             {
    310                 case 32:
    311                 {
    312                     uint8_t bytestPP = bpp >> 3;
    313                     for (UINT i = 0; i < pCF->Rects.cRects; ++i)
    314                     {
    315                         RECT *pRect = &pCF->Rects.aRects[i];
    316                         for (LONG ir = pRect->top; ir < pRect->bottom; ++ir)
    317                         {
    318                             uint32_t * pvU32Mem = (uint32_t*)(pvMem + (ir * pAlloc->AllocData.SurfDesc.pitch) + (pRect->left * bytestPP));
    319                             uint32_t cRaw = pRect->right - pRect->left;
    320                             Assert(pRect->left >= 0);
    321                             Assert(pRect->right <= (LONG)pAlloc->AllocData.SurfDesc.width);
    322                             Assert(pRect->top >= 0);
    323                             Assert(pRect->bottom <= (LONG)pAlloc->AllocData.SurfDesc.height);
    324                             for (UINT j = 0; j < cRaw; ++j)
    325                             {
    326                                 *pvU32Mem = pCF->Color;
    327                                 ++pvU32Mem;
    328                             }
    329                         }
    330                         vboxWddmRectUnited(&UnionRect, &UnionRect, pRect);
    331                     }
    332                     Status = STATUS_SUCCESS;
    333                     break;
    334                 }
    335                 case 16:
    336                 case 8:
    337                 default:
    338                     AssertBreakpoint();
    339                     break;
    340             }
    341 
    342             if (Status == STATUS_SUCCESS)
    343             {
    344                 if (pAlloc->AllocData.SurfDesc.VidPnSourceId != D3DDDI_ID_UNINITIALIZED
    345                         && VBOXWDDM_IS_FB_ALLOCATION(pDevExt, pAlloc)
    346                         && pAlloc->bVisible
    347                         )
    348                 {
    349                     if (!vboxWddmRectIsEmpty(&UnionRect))
    350                     {
    351                         PVBOXWDDM_SOURCE pSource = &pDevExt->aSources[pCF->Alloc.pAlloc->AllocData.SurfDesc.VidPnSourceId];
    352                         uint32_t cUnlockedVBVADisabled = ASMAtomicReadU32(&pDevExt->cUnlockedVBVADisabled);
    353                         if (!cUnlockedVBVADisabled)
    354                         {
    355                             VBOXVBVA_OP(ReportDirtyRect, pDevExt, pSource, &UnionRect);
    356                         }
    357                         else
    358                         {
    359                             VBOXVBVA_OP_WITHLOCK(ReportDirtyRect, pDevExt, pSource, &UnionRect);
    360                         }
    361                     }
    362                 }
    363                 else
    364                 {
    365                     AssertBreakpoint();
    366                 }
    367             }
    368         }
    369         else
    370             WARN(("invalid offVram"));
    371     }
    372 
    373     return Status;
    374 }
    375 
    37625NTSTATUS vboxVdmaGgDmaBltPerform(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_ALLOC_DATA pSrcAlloc, RECT* pSrcRect,
    37726        PVBOXWDDM_ALLOC_DATA pDstAlloc, RECT* pDstRect)
     
    467116}
    468117
    469 /*
    470  * @return on success the number of bytes the command contained, otherwise - VERR_xxx error code
    471  */
    472 static NTSTATUS vboxVdmaGgDmaBlt(PVBOXMP_DEVEXT pDevExt, PVBOXVDMA_BLT pBlt)
    473 {
    474     /* we do not support stretching for now */
    475     Assert(pBlt->SrcRect.right - pBlt->SrcRect.left == pBlt->DstRects.ContextRect.right - pBlt->DstRects.ContextRect.left);
    476     Assert(pBlt->SrcRect.bottom - pBlt->SrcRect.top == pBlt->DstRects.ContextRect.bottom - pBlt->DstRects.ContextRect.top);
    477     if (pBlt->SrcRect.right - pBlt->SrcRect.left != pBlt->DstRects.ContextRect.right - pBlt->DstRects.ContextRect.left)
    478         return STATUS_INVALID_PARAMETER;
    479     if (pBlt->SrcRect.bottom - pBlt->SrcRect.top != pBlt->DstRects.ContextRect.bottom - pBlt->DstRects.ContextRect.top)
    480         return STATUS_INVALID_PARAMETER;
    481     Assert(pBlt->DstRects.UpdateRects.cRects);
    482 
    483     NTSTATUS Status = STATUS_SUCCESS;
    484 
    485     if (pBlt->DstRects.UpdateRects.cRects)
    486     {
    487         for (uint32_t i = 0; i < pBlt->DstRects.UpdateRects.cRects; ++i)
    488         {
    489             RECT SrcRect;
    490             vboxWddmRectTranslated(&SrcRect, &pBlt->DstRects.UpdateRects.aRects[i], -pBlt->DstRects.ContextRect.left, -pBlt->DstRects.ContextRect.top);
    491 
    492             Status = vboxVdmaGgDmaBltPerform(pDevExt, &pBlt->SrcAlloc.pAlloc->AllocData, &SrcRect,
    493                     &pBlt->DstAlloc.pAlloc->AllocData, &pBlt->DstRects.UpdateRects.aRects[i]);
    494             AssertNtStatusSuccess(Status);
    495             if (Status != STATUS_SUCCESS)
    496                 return Status;
    497         }
    498     }
    499     else
    500     {
    501         Status = vboxVdmaGgDmaBltPerform(pDevExt, &pBlt->SrcAlloc.pAlloc->AllocData, &pBlt->SrcRect,
    502                 &pBlt->DstAlloc.pAlloc->AllocData, &pBlt->DstRects.ContextRect);
    503         AssertNtStatusSuccess(Status);
    504         if (Status != STATUS_SUCCESS)
    505             return Status;
    506     }
    507 
    508     return Status;
    509 }
    510 
    511 
    512 static void vboxVdmaBltDirtyRectsUpdate(PVBOXMP_DEVEXT pDevExt, VBOXWDDM_SOURCE *pSource, uint32_t cRects, const RECT *paRects)
    513 {
    514     if (!cRects)
    515     {
    516         WARN(("vboxVdmaBltDirtyRectsUpdate: no rects specified"));
    517         return;
    518     }
    519 
    520     RECT rect;
    521     rect = paRects[0];
    522     for (UINT i = 1; i < cRects; ++i)
    523     {
    524         vboxWddmRectUnited(&rect, &rect, &paRects[i]);
    525     }
    526 
    527     uint32_t cUnlockedVBVADisabled = ASMAtomicReadU32(&pDevExt->cUnlockedVBVADisabled);
    528     if (!cUnlockedVBVADisabled)
    529     {
    530         VBOXVBVA_OP(ReportDirtyRect, pDevExt, pSource, &rect);
    531     }
    532     else
    533     {
    534         VBOXVBVA_OP_WITHLOCK_ATDPC(ReportDirtyRect, pDevExt, pSource, &rect);
    535     }
    536 }
    537 
    538 
    539118
    540119#ifdef VBOX_WITH_VDMA
     
    545124 */
    546125
    547 #ifdef VBOXVDMA_WITH_VBVA
    548 static int vboxWddmVdmaSubmitVbva(PVBOXMP_DEVEXT pDevExt, PVBOXVDMAINFO pInfo, HGSMIOFFSET offDr)
    549 {
    550     int rc;
    551     if (vboxVbvaBufferBeginUpdate (pDevExt, &pDevExt->u.primary.Vbva))
    552     {
    553         rc = vboxVbvaReportCmdOffset(pDevExt, &pDevExt->u.primary.Vbva, offDr);
    554         vboxVbvaBufferEndUpdate (pDevExt, &pDevExt->u.primary.Vbva);
    555     }
    556     else
    557     {
    558         AssertBreakpoint();
    559         rc = VERR_INVALID_STATE;
    560     }
    561     return rc;
    562 }
    563 # define vboxWddmVdmaSubmit vboxWddmVdmaSubmitVbva
    564 #else
    565126static int vboxWddmVdmaSubmitHgsmi(PVBOXMP_DEVEXT pDevExt, PVBOXVDMAINFO pInfo, HGSMIOFFSET offDr)
    566127{
     
    571132    return VINF_SUCCESS;
    572133}
    573 # define vboxWddmVdmaSubmit vboxWddmVdmaSubmitHgsmi
    574 #endif
     134#define vboxWddmVdmaSubmit vboxWddmVdmaSubmitHgsmi
    575135
    576136static int vboxVdmaInformHost(PVBOXMP_DEVEXT pDevExt, PVBOXVDMAINFO pInfo, VBOXVDMA_CTL_TYPE enmCtl)
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVdma.h

    r80422 r80486  
    115115}
    116116
    117 #if 0
    118 typedef DECLCALLBACK(int) FNVBOXVDMASUBMIT(struct _DEVICE_EXTENSION* pDevExt, struct VBOXVDMAINFO * pInfo, HGSMIOFFSET offDr, PVOID pvContext);
    119 typedef FNVBOXVDMASUBMIT *PFNVBOXVDMASUBMIT;
    120 
    121 typedef struct VBOXVDMASUBMIT
    122 {
    123     PFNVBOXVDMASUBMIT pfnSubmit;
    124     PVOID pvContext;
    125 } VBOXVDMASUBMIT, *PVBOXVDMASUBMIT;
    126 #endif
    127 
    128 /* start */
    129 typedef enum
    130 {
    131     VBOXVDMAPIPE_STATE_CLOSED    = 0,
    132     VBOXVDMAPIPE_STATE_CREATED   = 1,
    133     VBOXVDMAPIPE_STATE_OPENNED   = 2,
    134     VBOXVDMAPIPE_STATE_CLOSING   = 3
    135 } VBOXVDMAPIPE_STATE;
    136 
    137 typedef struct VBOXVDMAPIPE
    138 {
    139     KSPIN_LOCK SinchLock;
    140     KEVENT Event;
    141     LIST_ENTRY CmdListHead;
    142     VBOXVDMAPIPE_STATE enmState;
    143     /* true iff the other end needs Event notification */
    144     bool bNeedNotify;
    145 } VBOXVDMAPIPE, *PVBOXVDMAPIPE;
    146 
    147 typedef struct VBOXVDMAPIPE_CMD_HDR
    148 {
    149     LIST_ENTRY ListEntry;
    150 } VBOXVDMAPIPE_CMD_HDR, *PVBOXVDMAPIPE_CMD_HDR;
    151 
    152 #define VBOXVDMAPIPE_CMD_HDR_FROM_ENTRY(_pE)  ( (PVBOXVDMAPIPE_CMD_HDR)((uint8_t *)(_pE) - RT_UOFFSETOF(VBOXVDMAPIPE_CMD_HDR, ListEntry)) )
    153 
    154 typedef enum
    155 {
    156     VBOXVDMAPIPE_CMD_TYPE_UNDEFINED = 0,
    157     VBOXVDMAPIPE_CMD_TYPE_RECTSINFO,
    158     VBOXVDMAPIPE_CMD_TYPE_DMACMD,
    159     VBOXVDMAPIPE_CMD_TYPE_FINISH, /* ensures all previously submitted commands are completed */
    160     VBOXVDMAPIPE_CMD_TYPE_CANCEL
    161 } VBOXVDMAPIPE_CMD_TYPE;
    162 
    163 typedef struct VBOXVDMAPIPE_CMD_DR
    164 {
    165     VBOXVDMAPIPE_CMD_HDR PipeHdr;
    166     VBOXVDMAPIPE_CMD_TYPE enmType;
    167     volatile uint32_t cRefs;
    168 } VBOXVDMAPIPE_CMD_DR, *PVBOXVDMAPIPE_CMD_DR;
    169 
    170 #define VBOXVDMAPIPE_CMD_DR_FROM_ENTRY(_pE)  ( (PVBOXVDMAPIPE_CMD_DR)VBOXVDMAPIPE_CMD_HDR_FROM_ENTRY(_pE) )
    171 
    172 typedef struct VBOXWDDM_DMA_ALLOCINFO
    173 {
    174     PVBOXWDDM_ALLOCATION pAlloc;
    175     VBOXVIDEOOFFSET offAlloc;
    176     UINT segmentIdAlloc : 31;
    177     UINT fWriteOp : 1;
    178     D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId;
    179 } VBOXWDDM_DMA_ALLOCINFO, *PVBOXWDDM_DMA_ALLOCINFO;
    180 
    181 typedef struct VBOXVDMAPIPE_RECTS
    182 {
    183     RECT ContextRect;
    184     VBOXWDDM_RECTS_INFO UpdateRects;
    185 } VBOXVDMAPIPE_RECTS, *PVBOXVDMAPIPE_RECTS;
    186 
    187 typedef struct VBOXVDMAPIPE_CMD_RECTSINFO
    188 {
    189     VBOXVDMAPIPE_CMD_DR Hdr;
    190     PVBOXWDDM_CONTEXT pContext;
    191     struct VBOXWDDM_SWAPCHAIN *pSwapchain;
    192     VBOXVDMAPIPE_RECTS ContextsRects;
    193 } VBOXVDMAPIPE_CMD_RECTSINFO, *PVBOXVDMAPIPE_CMD_RECTSINFO;
    194 
    195 typedef struct VBOXVDMAPIPE_CMD_DMACMD
    196 {
    197     VBOXVDMAPIPE_CMD_DR Hdr;
    198 #ifndef VBOX_WDDM_IRQ_COMPLETION
    199     VBOXVDMADDI_CMD DdiCmd;
    200 #endif
    201     PVBOXWDDM_CONTEXT pContext;
    202     VBOXVDMACMD_TYPE enmCmd;
    203 //    VBOXVDMAPIPE_FLAGS_DMACMD fFlags;
    204 } VBOXVDMAPIPE_CMD_DMACMD, *PVBOXVDMAPIPE_CMD_DMACMD;
    205 
    206 typedef struct VBOXVDMA_CLRFILL
    207 {
    208     VBOXWDDM_DMA_ALLOCINFO Alloc;
    209     UINT Color;
    210     VBOXWDDM_RECTS_INFO Rects;
    211 } VBOXVDMA_CLRFILL, *PVBOXVDMA_CLRFILL;
    212 
    213 typedef struct VBOXVDMAPIPE_CMD_DMACMD_CLRFILL
    214 {
    215     VBOXVDMAPIPE_CMD_DMACMD Hdr;
    216     VBOXVDMA_CLRFILL ClrFill;
    217 } VBOXVDMAPIPE_CMD_DMACMD_CLRFILL, *PVBOXVDMAPIPE_CMD_DMACMD_CLRFILL;
    218 
    219 typedef struct VBOXVDMA_BLT
    220 {
    221     VBOXWDDM_DMA_ALLOCINFO SrcAlloc;
    222     VBOXWDDM_DMA_ALLOCINFO DstAlloc;
    223     RECT SrcRect;
    224     VBOXVDMAPIPE_RECTS DstRects;
    225 } VBOXVDMA_BLT, *PVBOXVDMA_BLT;
    226 
    227 typedef struct VBOXVDMAPIPE_CMD_DMACMD_BLT
    228 {
    229     VBOXVDMAPIPE_CMD_DMACMD Hdr;
    230     VBOXVDMA_BLT Blt;
    231 } VBOXVDMAPIPE_CMD_DMACMD_BLT, *PVBOXVDMAPIPE_CMD_DMACMD_BLT;
    232 
    233 typedef struct VBOXVDMA_FLIP
    234 {
    235     VBOXWDDM_DMA_ALLOCINFO Alloc;
    236 } VBOXVDMA_FLIP, *PVBOXVDMA_FLIP;
    237 
    238 typedef struct VBOXVDMAPIPE_CMD_DMACMD_FLIP
    239 {
    240     VBOXVDMAPIPE_CMD_DMACMD Hdr;
    241     VBOXVDMA_FLIP Flip;
    242 } VBOXVDMAPIPE_CMD_DMACMD_FLIP, *PVBOXVDMAPIPE_CMD_DMACMD_FLIP;
    243 
    244 typedef struct VBOXVDMA_SHADOW2PRIMARY
    245 {
    246     VBOXWDDM_DMA_ALLOCINFO ShadowAlloc;
    247     RECT SrcRect;
    248     D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId;
    249 } VBOXVDMA_SHADOW2PRIMARY, *PVBOXVDMA_SHADOW2PRIMARY;
    250 
    251 typedef struct VBOXVDMAGG
    252 {
    253     VBOXVDMAPIPE CmdPipe;
    254     PKTHREAD pThread;
    255 } VBOXVDMAGG, *PVBOXVDMAGG;
    256 
    257117/* DMA commands are currently submitted over HGSMI */
    258118typedef struct VBOXVDMAINFO
     
    301161#endif
    302162
    303 NTSTATUS vboxVdmaGgCmdDmaNotifyCompleted(PVBOXMP_DEVEXT pDevExt, PVBOXVDMAPIPE_CMD_DMACMD pCmd, DXGK_INTERRUPT_TYPE enmComplType);
    304 NTSTATUS vboxVdmaGgCmdDmaNotifySubmitted(PVBOXMP_DEVEXT pDevExt, PVBOXVDMAPIPE_CMD_DMACMD pCmd);
    305 VOID vboxVdmaGgCmdDmaNotifyInit(PVBOXVDMAPIPE_CMD_DMACMD pCmd,
    306         uint32_t u32NodeOrdinal, uint32_t u32FenceId,
    307         PFNVBOXVDMADDICMDCOMPLETE_DPC pfnComplete, PVOID pvComplete);
    308 
    309163NTSTATUS vboxVdmaGgDmaBltPerform(PVBOXMP_DEVEXT pDevExt, struct VBOXWDDM_ALLOC_DATA * pSrcAlloc, RECT* pSrcRect,
    310164        struct VBOXWDDM_ALLOC_DATA *pDstAlloc, RECT* pDstRect);
    311165
    312 #define VBOXVDMAPIPE_CMD_DR_FROM_DDI_CMD(_pCmd) ((PVBOXVDMAPIPE_CMD_DR)(((uint8_t*)(_pCmd)) - RT_UOFFSETOF(VBOXVDMAPIPE_CMD_DR, DdiCmd)))
    313 
    314166#endif /* !GA_INCLUDED_SRC_WINNT_Graphics_Video_mp_wddm_VBoxMPVdma_h */
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVhwa.cpp

    r80475 r80486  
    814814AssertCompile(RT_OFFSETOF(RECT, bottom) == RT_OFFSETOF(VBOXVHWA_RECTL, bottom));
    815815
    816 int vboxVhwaHlpColorFill(PVBOXWDDM_OVERLAY pOverlay, PVBOXWDDM_DMA_PRIVATEDATA_CLRFILL pCF)
    817 {
    818     PVBOXWDDM_ALLOCATION pAlloc = pCF->ClrFill.Alloc.pAlloc;
    819     Assert(pAlloc->pResource == pOverlay->pResource);
    820 
    821     if (pAlloc->AllocData.Addr.SegmentId != 1)
    822     {
    823         WARN(("invalid segment id on color fill"));
    824         return VERR_INVALID_PARAMETER;
    825     }
    826 
    827     Assert(pAlloc->hHostHandle);
    828     Assert(pAlloc->pResource);
    829     Assert(pAlloc->AllocData.Addr.offVram != VBOXVIDEOOFFSET_VOID);
    830 
    831     int rc;
    832     VBOXVHWACMD RT_UNTRUSTED_VOLATILE_HOST *pCmd =
    833         vboxVhwaCommandCreate(pOverlay->pDevExt, pOverlay->VidPnSourceId, VBOXVHWACMD_TYPE_SURF_FLIP,
    834                               RT_OFFSETOF(VBOXVHWACMD_SURF_COLORFILL, u.in.aRects[pCF->ClrFill.Rects.cRects]));
    835     Assert(pCmd);
    836     if(pCmd)
    837     {
    838         VBOXVHWACMD_SURF_COLORFILL RT_UNTRUSTED_VOLATILE_HOST *pBody = VBOXVHWACMD_BODY(pCmd, VBOXVHWACMD_SURF_COLORFILL);
    839 
    840         memset((void *)pBody, 0, sizeof(VBOXVHWACMD_SURF_COLORFILL));
    841 
    842         pBody->u.in.hSurf = pAlloc->hHostHandle;
    843         pBody->u.in.offSurface = pAlloc->AllocData.Addr.offVram;
    844         pBody->u.in.cRects = pCF->ClrFill.Rects.cRects;
    845         memcpy((void *)&pBody->u.in.aRects[0], pCF->ClrFill.Rects.aRects,
    846                pCF->ClrFill.Rects.cRects * sizeof (pCF->ClrFill.Rects.aRects[0]));
    847         vboxVhwaCommandSubmitAsynchAndComplete(pOverlay->pDevExt, pCmd);
    848 
    849         rc = VINF_SUCCESS;
    850     }
    851     else
    852         rc = VERR_OUT_OF_RESOURCES;
    853 
    854     return rc;
    855 }
    856 
    857816static void vboxVhwaHlpOverlayDstRectSet(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_OVERLAY pOverlay, const RECT *pRect)
    858817{
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVhwa.h

    r80475 r80486  
    6363int vboxVhwaHlpOverlayCreate(PVBOXMP_DEVEXT pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId, DXGK_OVERLAYINFO *pOverlayInfo, /* OUT */ PVBOXWDDM_OVERLAY pOverlay);
    6464
    65 int vboxVhwaHlpColorFill(PVBOXWDDM_OVERLAY pOverlay, PVBOXWDDM_DMA_PRIVATEDATA_CLRFILL pCF);
    66 
    6765int vboxVhwaHlpGetSurfInfo(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_ALLOCATION pSurf);
    6866
    6967BOOLEAN vboxVhwaHlpOverlayListIsEmpty(PVBOXMP_DEVEXT pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId);
    70 //void vboxVhwaHlpOverlayListAdd(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_OVERLAY pOverlay);
    71 //void vboxVhwaHlpOverlayListRemove(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_OVERLAY pOverlay);
    7268void vboxVhwaHlpOverlayDstRectUnion(PVBOXMP_DEVEXT pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId, RECT *pRect);
    7369void vboxVhwaHlpOverlayDstRectGet(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_OVERLAY pOverlay, RECT *pRect);
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