Changeset 30484 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Miniport
- Timestamp:
- Jun 28, 2010 9:16:59 PM (14 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Miniport
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.h
r30441 r30484 120 120 #include "wddm/VBoxVideoShgsmi.h" 121 121 #include "wddm/VBoxVideoCm.h" 122 #include "wddm/VBoxVideoVdma.h" 122 123 #include "wddm/VBoxVideoWddm.h" 123 #include "wddm/VBoxVideoVdma.h"124 124 #include "wddm/VBoxVideoVidPn.h" 125 125 #ifdef VBOXWDDM_WITH_VBVA -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoCm.cpp
r30462 r30484 71 71 cbSize = VBOXWDDM_ROUNDBOUND(cbSize, 8); 72 72 73 Assert(pContext->pSession); 73 74 if (!pContext->pSession) 74 75 return NULL; … … 86 87 pCmd->CmdHdr.cbCmd = pCmd->cbMaxCmdSize; 87 88 } 88 return pCmd;89 return VBOXVIDEOCM_BODY(pCmd, void); 89 90 } 90 91 -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVdma.cpp
r30441 r30484 149 149 else 150 150 { 151 KeReleaseSpinLock(&pPipe->SinchLock, OldIrql); 151 152 Status = STATUS_INVALID_PIPE_STATE; 152 153 break; … … 172 173 break; 173 174 } 174 Assert(enmState > VBOXVDMAPIPE_STATE_OPENNED); 175 Status = STATUS_PIPE_CLOSING; 175 else 176 { 177 Assert(enmState == VBOXVDMAPIPE_STATE_CLOSING); 178 Status = STATUS_PIPE_CLOSING; 179 break; 180 } 176 181 } while (1); 177 182 … … 207 212 } 208 213 209 PVBOXVDMAPIPE_CMD_DR vboxVdmaGgCmdCreate(PVBOXVDMAGG pVdma, uint32_t cbCmd) 210 { 211 return (PVBOXVDMAPIPE_CMD_DR)vboxWddmMemAllocZero(cbCmd); 214 PVBOXVDMAPIPE_CMD_DR vboxVdmaGgCmdCreate(PVBOXVDMAGG pVdma, VBOXVDMAPIPE_CMD_TYPE enmType, uint32_t cbCmd) 215 { 216 PVBOXVDMAPIPE_CMD_DR pHdr = (PVBOXVDMAPIPE_CMD_DR)vboxWddmMemAllocZero(cbCmd); 217 Assert(pHdr); 218 if (pHdr) 219 { 220 pHdr->enmType = enmType; 221 return pHdr; 222 } 223 return NULL; 212 224 } 213 225 … … 262 274 PVBOXWDDM_CONTEXT pContext = pRectsInfo->pContext; 263 275 PDEVICE_EXTENSION pDevExt = pContext->pDevice->pAdapter; 264 RECT * pContextRect = &pRectsInfo->Context Rect;265 PVBOXWDDM_RECTS_INFO pRects = &pRectsInfo-> UpdateRects;276 RECT * pContextRect = &pRectsInfo->ContextsRects.ContextRect; 277 PVBOXWDDM_RECTS_INFO pRects = &pRectsInfo->ContextsRects.UpdateRects; 266 278 NTSTATUS Status = STATUS_SUCCESS; 267 279 PVBOXVIDEOCM_CMD_RECTS pCmd = NULL; … … 355 367 } 356 368 } 357 InsertHeadList(&pDevExt->ContextList3D, &pContext->ListEntry);358 369 ExReleaseFastMutex(&pDevExt->ContextMutex); 359 370 … … 450 461 } 451 462 452 NTSTATUS vboxVdmaGgCmd Post(PVBOXVDMAGG pVdma, PVBOXVDMAPIPE_CMD_DR pCmd)463 NTSTATUS vboxVdmaGgCmdSubmit(PVBOXVDMAGG pVdma, PVBOXVDMAPIPE_CMD_DR pCmd) 453 464 { 454 465 return vboxVdmaPipeCltCmdPut(&pVdma->CmdPipe, &pCmd->PipeHdr); -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVdma.h
r30441 r30484 69 69 #define VBOXVDMAPIPE_CMD_DR_FROM_ENTRY(_pE) ( (PVBOXVDMAPIPE_CMD_DR)VBOXVDMAPIPE_CMD_HDR_FROM_ENTRY(_pE) ) 70 70 71 typedef struct VBOXVDMAPIPE_RECTS 72 { 73 RECT ContextRect; 74 VBOXWDDM_RECTS_INFO UpdateRects; 75 } VBOXVDMAPIPE_RECTS, *PVBOXVDMAPIPE_RECTS; 76 71 77 typedef struct VBOXVDMAPIPE_CMD_RECTSINFO 72 78 { 73 79 VBOXVDMAPIPE_CMD_DR Hdr; 74 PVBOXWDDM_CONTEXT pContext; 75 RECT ContextRect; 76 VBOXWDDM_RECTS_INFO UpdateRects; 80 struct VBOXWDDM_CONTEXT *pContext; 81 VBOXVDMAPIPE_RECTS ContextsRects; 77 82 } VBOXVDMAPIPE_CMD_RECTSINFO, *PVBOXVDMAPIPE_CMD_RECTSINFO; 78 83 … … 112 117 #define VBOXVDMACBUF_DR_SIZE(_cbData) (VBOXVDMACBUF_DR_DATA_OFFSET() + (_cbData)) 113 118 #define VBOXVDMACBUF_DR_DATA(_pDr) ( ((uint8_t*)(_pDr)) + VBOXVDMACBUF_DR_DATA_OFFSET() ) 119 120 NTSTATUS vboxVdmaGgCmdSubmit(PVBOXVDMAGG pVdma, PVBOXVDMAPIPE_CMD_DR pCmd); 121 PVBOXVDMAPIPE_CMD_DR vboxVdmaGgCmdCreate(PVBOXVDMAGG pVdma, VBOXVDMAPIPE_CMD_TYPE enmType, uint32_t cbCmd); 122 void vboxVdmaGgCmdDestroy(PVBOXVDMAPIPE_CMD_DR pDr); 123 114 124 #endif /* #ifndef ___VBoxVideoVdma_h___ */ -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp
r30462 r30484 2076 2076 break; 2077 2077 } 2078 #endif 2078 2079 case VBOXVDMACMD_TYPE_DMA_PRESENT_BLT: 2079 2080 { … … 2085 2086 { 2086 2087 RECT rect; 2087 Assert(pBlt->DstRects.cRects); 2088 if (pBlt->DstRects.cRects > 1) 2088 if (pBlt->DstRects.UpdateRects.cRects) 2089 2089 { 2090 rect = pBlt->DstRects. aRects[1];2091 for (UINT i = 2; i < pBlt->DstRects.cRects; ++i)2090 rect = pBlt->DstRects.UpdateRects.aRects[0]; 2091 for (UINT i = 1; i < pBlt->DstRects.UpdateRects.cRects; ++i) 2092 2092 { 2093 vboxWddmRectUnited(&rect, &rect, &pBlt->DstRects. aRects[i]);2093 vboxWddmRectUnited(&rect, &rect, &pBlt->DstRects.UpdateRects.aRects[i]); 2094 2094 } 2095 2095 } 2096 2096 else 2097 rect = pBlt->DstRects. aRects[0];2097 rect = pBlt->DstRects.ContextRect; 2098 2098 2099 2099 VBOXWDDM_SOURCE *pSource = &pDevExt->aSources[pPrivateData->SrcAllocInfo.srcId]; 2100 2100 VBOXVBVA_OP(ReportDirtyRect, pDevExt, &pSource->Vbva, &rect); 2101 } 2102 2103 PVBOXWDDM_CONTEXT pContext = (PVBOXWDDM_CONTEXT)pSubmitCommand->hContext; 2104 Assert(pContext); 2105 Assert(pContext->pDevice); 2106 Assert(pContext->pDevice->pAdapter == pDevExt); 2107 PVBOXVDMAPIPE_CMD_RECTSINFO pRectsCmd = (PVBOXVDMAPIPE_CMD_RECTSINFO)vboxVdmaGgCmdCreate(&pDevExt->u.primary.Vdma.DmaGg, VBOXVDMAPIPE_CMD_TYPE_RECTSINFO, RT_OFFSETOF(VBOXVDMAPIPE_CMD_RECTSINFO, ContextsRects.UpdateRects.aRects[pBlt->DstRects.UpdateRects.cRects])); 2108 Assert(pRectsCmd); 2109 if (pRectsCmd) 2110 { 2111 pRectsCmd->pContext = pContext; 2112 pRectsCmd->ContextsRects = pBlt->DstRects; 2113 NTSTATUS tmpStatus = vboxVdmaGgCmdSubmit(&pDevExt->u.primary.Vdma.DmaGg, &pRectsCmd->Hdr); 2114 Assert(tmpStatus == STATUS_SUCCESS); 2115 if (tmpStatus != STATUS_SUCCESS) 2116 vboxVdmaGgCmdDestroy(&pRectsCmd->Hdr); 2101 2117 } 2102 2118 } … … 2116 2132 break; 2117 2133 } 2118 2119 #endif2120 2134 default: 2121 2135 { … … 3756 3770 PVBOXWDDM_DMA_PRESENT_BLT pBlt = (PVBOXWDDM_DMA_PRESENT_BLT)pPrivateData; 3757 3771 pBlt->SrcRect = pPresent->SrcRect; 3758 pBlt->DstRects. cRects = 1;3759 pBlt->DstRects. aRects[0] = pPresent->DstRect;3760 UINT cbHead = RT_OFFSETOF(VBOXWDDM_DMA_PRESENT_BLT, DstRects. aRects[1]);3772 pBlt->DstRects.ContextRect = pPresent->DstRect; 3773 pBlt->DstRects.UpdateRects.cRects = 0; 3774 UINT cbHead = RT_OFFSETOF(VBOXWDDM_DMA_PRESENT_BLT, DstRects.UpdateRects.aRects[0]); 3761 3775 Assert(pPresent->SubRectCnt > pPresent->MultipassOffset); 3762 3776 UINT cbRects = (pPresent->SubRectCnt - pPresent->MultipassOffset) * sizeof (RECT); … … 3768 3782 { 3769 3783 cbCmd -= cbRects; 3770 memcpy(&pBlt->DstRects. aRects[pPresent->MultipassOffset + 1], pPresent->pDstSubRects, cbRects);3771 pBlt->DstRects. cRects += cbRects/sizeof (RECT);3784 memcpy(&pBlt->DstRects.UpdateRects.aRects[pPresent->MultipassOffset], pPresent->pDstSubRects, cbRects); 3785 pBlt->DstRects.UpdateRects.cRects += cbRects/sizeof (RECT); 3772 3786 } 3773 3787 else … … 3775 3789 UINT cbFitingRects = (cbCmd/sizeof (RECT)) * sizeof (RECT); 3776 3790 Assert(cbFitingRects); 3777 memcpy(&pBlt->DstRects. aRects[pPresent->MultipassOffset + 1], pPresent->pDstSubRects, cbFitingRects);3791 memcpy(&pBlt->DstRects.UpdateRects.aRects[pPresent->MultipassOffset], pPresent->pDstSubRects, cbFitingRects); 3778 3792 cbCmd -= cbFitingRects; 3779 3793 pPresent->MultipassOffset += cbFitingRects/sizeof (RECT); 3780 pBlt->DstRects. cRects += cbFitingRects/sizeof (RECT);3794 pBlt->DstRects.UpdateRects.cRects += cbFitingRects/sizeof (RECT); 3781 3795 Assert(pPresent->SubRectCnt > pPresent->MultipassOffset); 3782 3796 Status = STATUS_GRAPHICS_INSUFFICIENT_DMA_BUFFER; -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.h
r30441 r30484 180 180 VBOXWDDM_DMA_PRIVATEDATA_HDR Hdr; 181 181 RECT SrcRect; 182 VBOX WDDM_RECTS_INFODstRects;182 VBOXVDMAPIPE_RECTS DstRects; 183 183 }VBOXWDDM_DMA_PRESENT_BLT, *PVBOXWDDM_DMA_PRESENT_BLT; 184 184
Note:
See TracChangeset
for help on using the changeset viewer.