Changeset 30215 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm
- Timestamp:
- Jun 15, 2010 10:31:34 PM (15 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoIf.h
r29966 r30215 108 108 } VBOXVHWA_INFO; 109 109 110 #define VBOXWDDM_OVERLAY_F_CKEY_DST 0x00000001 111 #define VBOXWDDM_OVERLAY_F_CKEY_DSTRANGE 0x00000002 112 #define VBOXWDDM_OVERLAY_F_CKEY_SRC 0x00000004 113 #define VBOXWDDM_OVERLAY_F_CKEY_SRCRANGE 0x00000008 114 #define VBOXWDDM_OVERLAY_F_BOB 0x00000010 115 #define VBOXWDDM_OVERLAY_F_INTERLEAVED 0x00000020 116 #define VBOXWDDM_OVERLAY_F_MIRROR_LR 0x00000040 117 #define VBOXWDDM_OVERLAY_F_MIRROR_UD 0x00000080 118 #define VBOXWDDM_OVERLAY_F_DEINTERLACED 0x00000100 119 120 typedef struct VBOXWDDM_OVERLAY_DESC 121 { 122 uint32_t fFlags; 123 UINT DstColorKeyLow; 124 UINT DstColorKeyHigh; 125 UINT SrcColorKeyLow; 126 UINT SrcColorKeyHigh; 127 } VBOXWDDM_OVERLAY_DESC, *PVBOXWDDM_OVERLAY_DESC; 128 129 /* the dirty rect info is valid */ 130 #define VBOXWDDM_DIRTYREGION_F_VALID 0x00000001 131 #define VBOXWDDM_DIRTYREGION_F_RECT_VALID 0x00000002 132 133 typedef struct VBOXWDDM_DIRTYREGION 134 { 135 uint32_t fFlags; /* <-- see VBOXWDDM_DIRTYREGION_F_xxx flags above */ 136 RECT Rect; 137 } VBOXWDDM_DIRTYREGION, *PVBOXWDDM_DIRTYREGION; 138 139 typedef struct VBOXWDDM_OVERLAY_INFO 140 { 141 VBOXWDDM_OVERLAY_DESC OverlayDesc; 142 VBOXWDDM_DIRTYREGION DirtyRegion; /* <- the dirty region of the overlay surface */ 143 } VBOXWDDM_OVERLAY_INFO, *PVBOXWDDM_OVERLAY_INFO; 144 145 typedef struct VBOXWDDM_OVERLAYFLIP_INFO 146 { 147 VBOXWDDM_DIRTYREGION DirtyRegion; /* <- the dirty region of the overlay surface */ 148 } VBOXWDDM_OVERLAYFLIP_INFO, *PVBOXWDDM_OVERLAYFLIP_INFO; 149 110 150 /* query info func */ 111 151 typedef struct VBOXWDDM_QI … … 195 235 } 196 236 237 DECLINLINE(void) vboxWddmRectUnite(RECT *pR, const RECT *pR2Unite) 238 { 239 pR->left = RT_MIN(pR->left, pR2Unite->left); 240 pR->top = RT_MIN(pR->top, pR2Unite->top); 241 pR->right = RT_MAX(pR->right, pR2Unite->right); 242 pR->bottom = RT_MAX(pR->bottom, pR2Unite->bottom); 243 } 244 245 DECLINLINE(void) vboxWddmDirtyRegionAddRect(PVBOXWDDM_DIRTYREGION pInfo, const RECT *pRect) 246 { 247 if (!(pInfo->fFlags & VBOXWDDM_DIRTYREGION_F_VALID)) 248 { 249 pInfo->fFlags = VBOXWDDM_DIRTYREGION_F_VALID; 250 if (pRect) 251 { 252 pInfo->fFlags |= VBOXWDDM_DIRTYREGION_F_RECT_VALID; 253 pInfo->Rect = *pRect; 254 } 255 } 256 else if (!!(pInfo->fFlags & VBOXWDDM_DIRTYREGION_F_RECT_VALID)) 257 { 258 if (pRect) 259 vboxWddmRectUnite(&pInfo->Rect, pRect); 260 else 261 pInfo->fFlags &= ~VBOXWDDM_DIRTYREGION_F_RECT_VALID; 262 } 263 } 264 265 DECLINLINE(void) vboxWddmDirtyRegionUnite(PVBOXWDDM_DIRTYREGION pInfo, const PVBOXWDDM_DIRTYREGION pInfo2) 266 { 267 if (pInfo2->fFlags & VBOXWDDM_DIRTYREGION_F_VALID) 268 { 269 if (pInfo2->fFlags & VBOXWDDM_DIRTYREGION_F_RECT_VALID) 270 vboxWddmDirtyRegionAddRect(pInfo, &pInfo2->Rect); 271 else 272 vboxWddmDirtyRegionAddRect(pInfo, NULL); 273 } 274 } 275 276 DECLINLINE(void) vboxWddmDirtyRegionClear(PVBOXWDDM_DIRTYREGION pInfo) 277 { 278 pInfo->fFlags = 0; 279 } 280 197 281 #endif /* #ifndef ___VBoxVideoIf_h___ */ -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVhwa.cpp
r30169 r30215 335 335 static void vboxVHWAInitSrc(PDEVICE_EXTENSION pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId) 336 336 { 337 Assert(srcId < pDevExt->u.primary.cDisplays);337 Assert(srcId < (D3DDDI_VIDEO_PRESENT_SOURCE_ID)pDevExt->u.primary.cDisplays); 338 338 VBOXVHWA_INFO *pSettings = &pDevExt->aSources[srcId].Vhwa.Settings; 339 339 memset (pSettings, 0, sizeof (VBOXVHWA_INFO)); … … 408 408 /* we do not allocate/map anything, just issue a Disable command 409 409 * to ensure all pending commands are flushed */ 410 for ( uint32_t i = 0; i < pDevExt->u.primary.cDisplays; ++i)410 for (int i = 0; i < pDevExt->u.primary.cDisplays; ++i) 411 411 { 412 412 vboxVHWADisable(pDevExt, i); … … 660 660 int vboxVhwaHlpGetSurfInfo(PDEVICE_EXTENSION pDevExt, PVBOXWDDM_ALLOCATION pSurf) 661 661 { 662 for ( uint32_t i = 0; i < pDevExt->u.primary.cDisplays; ++i)662 for (int i = 0; i < pDevExt->u.primary.cDisplays; ++i) 663 663 { 664 664 PVBOXWDDM_SOURCE pSource = &pDevExt->aSources[i]; … … 708 708 int vboxVhwaHlpCheckInit(PDEVICE_EXTENSION pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId) 709 709 { 710 Assert(VidPnSourceId < pDevExt->u.primary.cDisplays);711 if (VidPnSourceId >= pDevExt->u.primary.cDisplays)710 Assert(VidPnSourceId < (D3DDDI_VIDEO_PRESENT_SOURCE_ID)pDevExt->u.primary.cDisplays); 711 if (VidPnSourceId >= (D3DDDI_VIDEO_PRESENT_SOURCE_ID)pDevExt->u.primary.cDisplays) 712 712 return VERR_INVALID_PARAMETER; 713 713 … … 748 748 int vboxVhwaHlpCheckTerm(PDEVICE_EXTENSION pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId) 749 749 { 750 Assert(VidPnSourceId < pDevExt->u.primary.cDisplays);751 if (VidPnSourceId >= pDevExt->u.primary.cDisplays)750 Assert(VidPnSourceId < (D3DDDI_VIDEO_PRESENT_SOURCE_ID)pDevExt->u.primary.cDisplays); 751 if (VidPnSourceId >= (D3DDDI_VIDEO_PRESENT_SOURCE_ID)pDevExt->u.primary.cDisplays) 752 752 return VERR_INVALID_PARAMETER; 753 753 -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp
r30169 r30215 1042 1042 dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", MiniportDeviceContext)); 1043 1043 Assert(ChildRelationsSize == (pDevExt->u.primary.cDisplays + 1)*sizeof(DXGK_CHILD_DESCRIPTOR)); 1044 for ( UINTi = 0; i < pDevExt->u.primary.cDisplays; ++i)1044 for (int i = 0; i < pDevExt->u.primary.cDisplays; ++i) 1045 1045 { 1046 1046 ChildRelations[i].ChildDeviceType = TypeVideoOutput; … … 1232 1232 pCaps->MaxOverlays = 0; 1233 1233 #ifdef VBOX_WITH_VIDEOHWACCEL 1234 for ( uint32_t i = 0; i < pContext->u.primary.cDisplays; ++i)1234 for (int i = 0; i < pContext->u.primary.cDisplays; ++i) 1235 1235 { 1236 1236 if ( pContext->aSources[i].Vhwa.Settings.fFlags & VBOXVHWA_F_ENABLED) … … 1323 1323 pQi->cInfos = pContext->u.primary.cDisplays; 1324 1324 #ifdef VBOX_WITH_VIDEOHWACCEL 1325 for ( uint32_t i = 0; i < pContext->u.primary.cDisplays; ++i)1325 for (int i = 0; i < pContext->u.primary.cDisplays; ++i) 1326 1326 { 1327 1327 pQi->aInfos[i] = pContext->aSources[i].Vhwa.Settings; … … 2644 2644 if (Status == STATUS_SUCCESS && bSupported) 2645 2645 { 2646 for ( UINTid = 0; id < pContext->u.primary.cDisplays; ++id)2646 for (int id = 0; id < pContext->u.primary.cDisplays; ++id) 2647 2647 { 2648 2648 D3DKMDT_HVIDPNSOURCEMODESET hNewVidPnSourceModeSet; … … 2675 2675 if (Status == STATUS_SUCCESS && bSupported) 2676 2676 { 2677 for ( UINTid = 0; id < pContext->u.primary.cDisplays; ++id)2677 for (int id = 0; id < pContext->u.primary.cDisplays; ++id) 2678 2678 { 2679 2679 D3DKMDT_HVIDPNTARGETMODESET hNewVidPnTargetModeSet; … … 2785 2785 if (Status == STATUS_SUCCESS) 2786 2786 { 2787 for ( uint32_t i = 0; i < pDevExt->u.primary.cDisplays; ++i)2787 for (int i = 0; i < pDevExt->u.primary.cDisplays; ++i) 2788 2788 { 2789 2789 Status = vboxVidPnCheckAddMonitorModes(pDevExt, i, D3DKMDT_MCO_DRIVER, &Resolution, 1, 0); … … 2902 2902 NTSTATUS Status = STATUS_SUCCESS; 2903 2903 PDEVICE_EXTENSION pDevExt = (PDEVICE_EXTENSION)hAdapter; 2904 Assert( pDevExt->u.primary.cDisplays > pSetVidPnSourceAddress->VidPnSourceId);2905 if ( pDevExt->u.primary.cDisplays > pSetVidPnSourceAddress->VidPnSourceId)2904 Assert((UINT)pDevExt->u.primary.cDisplays > pSetVidPnSourceAddress->VidPnSourceId); 2905 if ((UINT)pDevExt->u.primary.cDisplays > pSetVidPnSourceAddress->VidPnSourceId) 2906 2906 { 2907 2907 PVBOXWDDM_SOURCE pSource = &pDevExt->aSources[pSetVidPnSourceAddress->VidPnSourceId]; … … 2970 2970 NTSTATUS Status = STATUS_SUCCESS; 2971 2971 PDEVICE_EXTENSION pDevExt = (PDEVICE_EXTENSION)hAdapter; 2972 Assert( pDevExt->u.primary.cDisplays > pSetVidPnSourceVisibility->VidPnSourceId);2973 if ( pDevExt->u.primary.cDisplays > pSetVidPnSourceVisibility->VidPnSourceId)2972 Assert((UINT)pDevExt->u.primary.cDisplays > pSetVidPnSourceVisibility->VidPnSourceId); 2973 if ((UINT)pDevExt->u.primary.cDisplays > pSetVidPnSourceVisibility->VidPnSourceId) 2974 2974 { 2975 2975 PVBOXWDDM_SOURCE pSource = &pDevExt->aSources[pSetVidPnSourceVisibility->VidPnSourceId]; … … 3036 3036 { 3037 3037 /* clear all current primaries */ 3038 for ( UINTi = 0; i < pDevExt->u.primary.cDisplays; ++i)3038 for (int i = 0; i < pDevExt->u.primary.cDisplays; ++i) 3039 3039 { 3040 3040 vboxWddmAssignPrimary(pDevExt, &pDevExt->aSources[i], NULL, i); … … 3183 3183 PDEVICE_EXTENSION pDevExt = (PDEVICE_EXTENSION)hAdapter; 3184 3184 3185 Assert( pDevExt->u.primary.cDisplays > pGetScanLine->VidPnTargetId);3185 Assert((UINT)pDevExt->u.primary.cDisplays > pGetScanLine->VidPnTargetId); 3186 3186 VBOXWDDM_TARGET *pTarget = &pDevExt->aTargets[pGetScanLine->VidPnTargetId]; 3187 3187 Assert(pTarget->HeightTotal); … … 3192 3192 { 3193 3193 uint32_t curScanLine = pTarget->ScanLineState; 3194 BOOLEAN bVBlanck;3195 3194 ++pTarget->ScanLineState; 3196 3195 if (pTarget->ScanLineState >= pTarget->HeightTotal) … … 3458 3457 3459 3458 D3DDDI_VIDEO_PRESENT_SOURCE_ID id = pAllocation->SurfDesc.VidPnSourceId; 3460 if (id >= 3459 if (id >= (D3DDDI_VIDEO_PRESENT_SOURCE_ID)pDevExt->u.primary.cDisplays) 3461 3460 return false; 3462 3461
Note:
See TracChangeset
for help on using the changeset viewer.