Changeset 33714 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVhwa.cpp
- Timestamp:
- Nov 2, 2010 11:36:10 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVhwa.cpp
r33540 r33714 920 920 } 921 921 922 static void vboxVhwaHlpOverlayListAdd(PDEVICE_EXTENSION pDevExt, PVBOXWDDM_OVERLAY pOverlay) 923 { 924 PVBOXWDDM_SOURCE pSource = &pDevExt->aSources[pOverlay->VidPnSourceId]; 925 KIRQL OldIrql; 926 KeAcquireSpinLock(&pSource->OverlayListLock, &OldIrql); 927 ASMAtomicIncU32(&pSource->cOverlays); 928 InsertHeadList(&pSource->OverlayList, &pOverlay->ListEntry); 929 KeReleaseSpinLock(&pSource->OverlayListLock, OldIrql); 930 } 931 932 static void vboxVhwaHlpOverlayListRemove(PDEVICE_EXTENSION pDevExt, PVBOXWDDM_OVERLAY pOverlay) 933 { 934 PVBOXWDDM_SOURCE pSource = &pDevExt->aSources[pOverlay->VidPnSourceId]; 935 KIRQL OldIrql; 936 KeAcquireSpinLock(&pSource->OverlayListLock, &OldIrql); 937 ASMAtomicDecU32(&pSource->cOverlays); 938 RemoveEntryList(&pOverlay->ListEntry); 939 KeReleaseSpinLock(&pSource->OverlayListLock, OldIrql); 940 } 941 922 942 AssertCompile(sizeof (RECT) == sizeof (VBOXVHWA_RECTL)); 923 943 AssertCompile(RT_SIZEOFMEMB(RECT, left) == RT_SIZEOFMEMB(VBOXVHWA_RECTL, left)); … … 930 950 AssertCompile(RT_OFFSETOF(RECT, bottom) == RT_OFFSETOF(VBOXVHWA_RECTL, bottom)); 931 951 932 int vboxVhwaHlpOverlayUpdate(PVBOXWDDM_OVERLAY pOverlay, const DXGK_OVERLAYINFO *pOverlayInfo )952 int vboxVhwaHlpOverlayUpdate(PVBOXWDDM_OVERLAY pOverlay, const DXGK_OVERLAYINFO *pOverlayInfo, RECT * pDstUpdateRect) 933 953 { 934 954 PVBOXWDDM_ALLOCATION pAlloc = (PVBOXWDDM_ALLOCATION)pOverlayInfo->hAllocation; … … 982 1002 if (pOurInfo->DirtyRegion.fFlags & VBOXWDDM_DIRTYREGION_F_VALID) 983 1003 { 984 pBody->u.in.xUpdatedSrcMemValid = 1;985 1004 if (pOurInfo->DirtyRegion.fFlags & VBOXWDDM_DIRTYREGION_F_RECT_VALID) 986 1005 pBody->u.in.xUpdatedSrcMemRect = *(VBOXVHWA_RECTL*)((void*)&pOurInfo->DirtyRegion.Rect); … … 993 1012 } 994 1013 1014 if (pDstUpdateRect) 1015 { 1016 pBody->u.in.xUpdatedDstMemRect = *(VBOXVHWA_RECTL*)((void*)pDstUpdateRect); 1017 } 1018 995 1019 /* we're not interested in completion, just send the command */ 996 1020 vboxVhwaCommandSubmitAsynchAndComplete(pOverlay->pDevExt, pCmd); … … 1011 1035 } 1012 1036 1037 int vboxVhwaHlpOverlayUpdate(PVBOXWDDM_OVERLAY pOverlay, const DXGK_OVERLAYINFO *pOverlayInfo) 1038 { 1039 return vboxVhwaHlpOverlayUpdate(pOverlay, pOverlayInfo, NULL); 1040 } 1041 1013 1042 int vboxVhwaHlpOverlayDestroy(PVBOXWDDM_OVERLAY pOverlay) 1014 1043 { 1015 1044 int rc = VINF_SUCCESS; 1045 1046 vboxVhwaHlpOverlayListRemove(pOverlay->pDevExt, pOverlay); 1047 1016 1048 for (uint32_t i = 0; i < pOverlay->pResource->cAllocations; ++i) 1017 1049 { … … 1066 1098 pOverlay->pResource = pRc; 1067 1099 pOverlay->VidPnSourceId = VidPnSourceId; 1068 rc = vboxVhwaHlpOverlayUpdate(pOverlay, pOverlayInfo); 1100 1101 vboxVhwaHlpOverlayListAdd(pDevExt, pOverlay); 1102 #ifdef VBOXWDDM_RENDER_FROM_SHADOW 1103 RECT DstRect; 1104 vboxVhwaHlpOverlayDstRectGet(pDevExt, pOverlay, &DstRect); 1105 NTSTATUS Status = vboxVdmaHlpUpdatePrimary(pDevExt, VidPnSourceId, &DstRect); 1106 Assert(Status == STATUS_SUCCESS); 1107 /* ignore primary update failure */ 1108 Status = STATUS_SUCCESS; 1109 #endif 1110 rc = vboxVhwaHlpOverlayUpdate(pOverlay, pOverlayInfo, &DstRect); 1069 1111 if (!RT_SUCCESS(rc)) 1070 1112 { … … 1089 1131 PVBOXWDDM_SOURCE pSource = &pDevExt->aSources[VidPnSourceId]; 1090 1132 return !ASMAtomicReadU32(&pSource->cOverlays); 1091 }1092 1093 void vboxVhwaHlpOverlayListAdd(PDEVICE_EXTENSION pDevExt, PVBOXWDDM_OVERLAY pOverlay)1094 {1095 PVBOXWDDM_SOURCE pSource = &pDevExt->aSources[pOverlay->VidPnSourceId];1096 KIRQL OldIrql;1097 KeAcquireSpinLock(&pSource->OverlayListLock, &OldIrql);1098 ASMAtomicIncU32(&pSource->cOverlays);1099 InsertHeadList(&pSource->OverlayList, &pOverlay->ListEntry);1100 KeReleaseSpinLock(&pSource->OverlayListLock, OldIrql);1101 }1102 1103 void vboxVhwaHlpOverlayListRemove(PDEVICE_EXTENSION pDevExt, PVBOXWDDM_OVERLAY pOverlay)1104 {1105 PVBOXWDDM_SOURCE pSource = &pDevExt->aSources[pOverlay->VidPnSourceId];1106 KIRQL OldIrql;1107 KeAcquireSpinLock(&pSource->OverlayListLock, &OldIrql);1108 ASMAtomicDecU32(&pSource->cOverlays);1109 RemoveEntryList(&pOverlay->ListEntry);1110 KeReleaseSpinLock(&pSource->OverlayListLock, OldIrql);1111 1133 } 1112 1134
Note:
See TracChangeset
for help on using the changeset viewer.