Changeset 47063 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVdma.cpp
- Timestamp:
- Jul 10, 2013 7:30:18 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVdma.cpp
r47059 r47063 1124 1124 } 1125 1125 1126 NTSTATUS vboxVdmaProcessBltCmd(PVBOXMP_DEVEXT pDevExt, VBOXWDDM_CONTEXT *pContext, VBOXWDDM_DMA_PRIVATEDATA_BLT *pBlt, VBOXVDMAPIPE_FLAGS_DMACMD fBltFlags) 1126 static void vboxVdmaBltDirtyRectsUpdate(PVBOXMP_DEVEXT pDevExt, VBOXWDDM_SOURCE *pSource, uint32_t cRects, const RECT *paRects) 1127 { 1128 if (!cRects) 1129 { 1130 WARN(("vboxVdmaBltDirtyRectsUpdate: no rects specified")); 1131 return; 1132 } 1133 1134 RECT rect; 1135 rect = paRects[0]; 1136 for (UINT i = 1; i < cRects; ++i) 1137 { 1138 vboxWddmRectUnited(&rect, &rect, &paRects[i]); 1139 } 1140 1141 uint32_t cUnlockedVBVADisabled = ASMAtomicReadU32(&pDevExt->cUnlockedVBVADisabled); 1142 if (!cUnlockedVBVADisabled) 1143 { 1144 VBOXVBVA_OP(ReportDirtyRect, pDevExt, pSource, &rect); 1145 } 1146 else 1147 { 1148 VBOXVBVA_OP_WITHLOCK_ATDPC(ReportDirtyRect, pDevExt, pSource, &rect); 1149 } 1150 } 1151 1152 NTSTATUS vboxVdmaProcessBltCmd(PVBOXMP_DEVEXT pDevExt, VBOXWDDM_CONTEXT *pContext, VBOXWDDM_DMA_PRIVATEDATA_BLT *pBlt) 1127 1153 { 1128 1154 NTSTATUS Status = STATUS_SUCCESS; 1129 1130 if (fBltFlags.fRealOp) 1131 { 1132 PVBOXWDDM_ALLOCATION pDstAlloc = pBlt->Blt.DstAlloc.pAlloc; 1133 PVBOXWDDM_ALLOCATION pSrcAlloc = pBlt->Blt.SrcAlloc.pAlloc; 1134 1155 PVBOXWDDM_ALLOCATION pDstAlloc = pBlt->Blt.DstAlloc.pAlloc; 1156 PVBOXWDDM_ALLOCATION pSrcAlloc = pBlt->Blt.SrcAlloc.pAlloc; 1157 BOOLEAN fRenderFromSharedDisabled = pDevExt->fRenderToShadowDisabled; 1158 BOOLEAN fVRAMUpdated = FALSE; 1159 1160 if (!pDstAlloc->AllocData.hostID && !pSrcAlloc->AllocData.hostID) 1161 { 1162 /* the allocations contain a real data in VRAM, do blitting */ 1135 1163 vboxVdmaGgDmaBlt(pDevExt, &pBlt->Blt); 1136 1137 if (VBOXWDDM_IS_FB_ALLOCATION(pDevExt, pDstAlloc) 1138 && pDstAlloc->bVisible) 1139 { 1140 VBOXWDDM_SOURCE *pSource = &pDevExt->aSources[pDstAlloc->AllocData.SurfDesc.VidPnSourceId]; 1141 Assert(pDstAlloc->AllocData.SurfDesc.VidPnSourceId < VBOX_VIDEO_MAX_SCREENS); 1142 Assert(pSource->pPrimaryAllocation == pDstAlloc); 1143 1144 RECT UpdateRect; 1145 UpdateRect = pBlt->Blt.DstRects.UpdateRects.aRects[0]; 1146 for (UINT i = 1; i < pBlt->Blt.DstRects.UpdateRects.cRects; ++i) 1147 { 1148 vboxWddmRectUnite(&UpdateRect, &pBlt->Blt.DstRects.UpdateRects.aRects[i]); 1149 } 1150 1151 uint32_t cUnlockedVBVADisabled = ASMAtomicReadU32(&pDevExt->cUnlockedVBVADisabled); 1152 if (!cUnlockedVBVADisabled) 1153 { 1154 VBOXVBVA_OP(ReportDirtyRect, pDevExt, pSource, &UpdateRect); 1155 } 1156 else 1157 { 1158 VBOXVBVA_OP_WITHLOCK(ReportDirtyRect, pDevExt, pSource, &UpdateRect); 1159 } 1160 } 1161 } 1162 1163 if (fBltFlags.fVisibleRegions) 1164 { 1165 Status = vboxVdmaProcessVRegCmd(pDevExt, pContext, &pBlt->Blt.SrcAlloc, &pBlt->Blt.DstAlloc, &pBlt->Blt.SrcRect, &pBlt->Blt.DstRects); 1166 if (!NT_SUCCESS(Status)) 1167 WARN(("vboxVdmaProcessVRegCmd failed Status 0x%x", Status)); 1168 } 1169 1170 return Status; 1171 } 1172 1173 NTSTATUS vboxVdmaProcessFlipCmd(PVBOXMP_DEVEXT pDevExt, VBOXWDDM_CONTEXT *pContext, VBOXWDDM_DMA_PRIVATEDATA_FLIP *pFlip, VBOXVDMAPIPE_FLAGS_DMACMD fFlags) 1164 fVRAMUpdated = TRUE; 1165 } 1166 1167 if (VBOXWDDM_IS_REAL_FB_ALLOCATION(pDevExt, pDstAlloc) 1168 && pDstAlloc->bVisible) 1169 { 1170 VBOXWDDM_SOURCE *pSource = &pDevExt->aSources[pDstAlloc->AllocData.SurfDesc.VidPnSourceId]; 1171 Assert(pDstAlloc->AllocData.SurfDesc.VidPnSourceId < VBOX_VIDEO_MAX_SCREENS); 1172 Assert(pSource->pPrimaryAllocation == pDstAlloc); 1173 1174 1175 if (fVRAMUpdated) 1176 vboxVdmaBltDirtyRectsUpdate(pDevExt, pSource, pBlt->Blt.DstRects.UpdateRects.cRects, pBlt->Blt.DstRects.UpdateRects.aRects); 1177 1178 if (pSrcAlloc->AllocData.hostID || pSource->fHas3DVrs) 1179 { 1180 Status = vboxVdmaProcessVRegCmd(pDevExt, pContext, &pBlt->Blt.SrcAlloc, &pBlt->Blt.DstAlloc, &pBlt->Blt.SrcRect, &pBlt->Blt.DstRects); 1181 if (!NT_SUCCESS(Status)) 1182 WARN(("vboxVdmaProcessVRegCmd failed Status 0x%x", Status)); 1183 } 1184 } 1185 1186 return Status; 1187 } 1188 1189 NTSTATUS vboxVdmaProcessFlipCmd(PVBOXMP_DEVEXT pDevExt, VBOXWDDM_CONTEXT *pContext, VBOXWDDM_DMA_PRIVATEDATA_FLIP *pFlip) 1174 1190 { 1175 1191 NTSTATUS Status = STATUS_SUCCESS; … … 1177 1193 VBOXWDDM_SOURCE *pSource = &pDevExt->aSources[pAlloc->AllocData.SurfDesc.VidPnSourceId]; 1178 1194 vboxWddmAssignPrimary(pDevExt, pSource, pAlloc, pAlloc->AllocData.SurfDesc.VidPnSourceId); 1179 Assert(!fFlags.fRealOp); 1180 if (fFlags.fVisibleRegions) 1195 if (pAlloc->AllocData.hostID) 1181 1196 { 1182 1197 RECT SrcRect; … … 1203 1218 } 1204 1219 1205 NTSTATUS vboxVdmaProcessClrFillCmd(PVBOXMP_DEVEXT pDevExt, VBOXWDDM_CONTEXT *pContext, VBOXWDDM_DMA_PRIVATEDATA_CLRFILL *pCF , VBOXVDMAPIPE_FLAGS_DMACMD fFlags)1220 NTSTATUS vboxVdmaProcessClrFillCmd(PVBOXMP_DEVEXT pDevExt, VBOXWDDM_CONTEXT *pContext, VBOXWDDM_DMA_PRIVATEDATA_CLRFILL *pCF) 1206 1221 { 1207 1222 NTSTATUS Status = STATUS_SUCCESS; 1208 Assert(!fFlags.fVisibleRegions);1209 1210 if ( fFlags.fRealOp)1223 PVBOXWDDM_ALLOCATION pAlloc = pCF->ClrFill.Alloc.pAlloc; 1224 1225 if (!pAlloc->AllocData.hostID) 1211 1226 { 1212 1227 Status = vboxVdmaGgDmaColorFill(pDevExt, &pCF->ClrFill);
Note:
See TracChangeset
for help on using the changeset viewer.