Changeset 31687 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp
- Timestamp:
- Aug 16, 2010 10:59:01 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp
r30973 r31687 87 87 } 88 88 89 NTSTATUS vboxWddmGhDisplayPostInfoScreen (PDEVICE_EXTENSION pDevExt, PVBOXWDDM_ALLOCATION pAllocation )89 NTSTATUS vboxWddmGhDisplayPostInfoScreen (PDEVICE_EXTENSION pDevExt, PVBOXWDDM_ALLOCATION pAllocation, POINT * pVScreenPos) 90 90 { 91 91 VBOXVIDEOOFFSET offVram = pAllocation->offVram; … … 105 105 106 106 pScreen->u32ViewIndex = pAllocation->SurfDesc.VidPnSourceId; 107 pScreen->i32OriginX = 0;108 pScreen->i32OriginY = 0;107 pScreen->i32OriginX = pVScreenPos->x; 108 pScreen->i32OriginY = pVScreenPos->y; 109 109 pScreen->u32StartOffset = 0; //(uint32_t)offVram; /* we pretend the view is located at the start of each framebuffer */ 110 110 pScreen->u32LineSize = pAllocation->SurfDesc.pitch; … … 169 169 } 170 170 171 NTSTATUS vboxWddmGhDisplayUpdateScreenPos(PDEVICE_EXTENSION pDevExt, PVBOXWDDM_SOURCE pSource, POINT *pVScreenPos) 172 { 173 if (pSource->VScreenPos.x == pVScreenPos->x 174 && pSource->VScreenPos.y == pVScreenPos->y) 175 return STATUS_SUCCESS; 176 177 pSource->VScreenPos = *pVScreenPos; 178 179 PVBOXWDDM_ALLOCATION pAllocation = VBOXWDDM_FB_ALLOCATION(pSource); 180 NTSTATUS Status = vboxWddmGhDisplayPostInfoScreen(pDevExt, pAllocation, &pSource->VScreenPos); 181 Assert(Status == STATUS_SUCCESS); 182 return Status; 183 } 171 184 172 185 NTSTATUS vboxWddmGhDisplaySetInfo(PDEVICE_EXTENSION pDevExt, PVBOXWDDM_SOURCE pSource) 173 186 { 174 175 #ifndef VBOXWDDM_RENDER_FROM_SHADOW 176 PVBOXWDDM_ALLOCATION pAllocation = pSource->pPrimaryAllocation; 177 #else 178 PVBOXWDDM_ALLOCATION pAllocation = pSource->pShadowAllocation; 179 #endif 187 PVBOXWDDM_ALLOCATION pAllocation = VBOXWDDM_FB_ALLOCATION(pSource); 180 188 VBOXVIDEOOFFSET offVram = vboxWddmValidatePrimary(pAllocation); 181 189 Assert(offVram != VBOXVIDEOOFFSET_VOID); … … 194 202 if (Status == STATUS_SUCCESS) 195 203 { 196 Status = vboxWddmGhDisplayPostInfoScreen(pDevExt, pAllocation );204 Status = vboxWddmGhDisplayPostInfoScreen(pDevExt, pAllocation, &pSource->VScreenPos); 197 205 Assert(Status == STATUS_SUCCESS); 198 206 if (Status != STATUS_SUCCESS) … … 1699 1707 DXGKARG_DESCRIBEALLOCATION* pDescribeAllocation) 1700 1708 { 1701 //dfprintf(("==> "__FUNCTION__ ", hAdapter(0x%x)\n", hAdapter));1709 dfprintf(("==> "__FUNCTION__ ", hAdapter(0x%x)\n", hAdapter)); 1702 1710 1703 1711 vboxVDbgBreakFv(); … … 1712 1720 pDescribeAllocation->PrivateDriverFormatAttribute = 0; 1713 1721 1714 //dfprintf(("<== "__FUNCTION__ ", hAdapter(0x%x)\n", hAdapter));1722 dfprintf(("<== "__FUNCTION__ ", hAdapter(0x%x)\n", hAdapter)); 1715 1723 1716 1724 return STATUS_SUCCESS; … … 2058 2066 } 2059 2067 2060 static void vboxWddmSubmitBltCmd(PDEVICE_EXTENSION pDevExt, PVBOXWDDM_ CONTEXT pContext, PVBOXWDDM_DMA_PRESENT_BLT pBlt)2068 static void vboxWddmSubmitBltCmd(PDEVICE_EXTENSION pDevExt, PVBOXWDDM_SOURCE pSource, PVBOXWDDM_CONTEXT pContext, PVBOXWDDM_DMA_PRESENT_BLT pBlt) 2061 2069 { 2062 2070 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])); … … 2066 2074 pRectsCmd->pContext = pContext; 2067 2075 memcpy(&pRectsCmd->ContextsRects, &pBlt->DstRects, RT_OFFSETOF(VBOXVDMAPIPE_RECTS, UpdateRects.aRects[pBlt->DstRects.UpdateRects.cRects])); 2076 vboxWddmRectTranslate(&pRectsCmd->ContextsRects.ContextRect, pSource->VScreenPos.x, pSource->VScreenPos.y); 2077 for (UINT i = 0; i < pRectsCmd->ContextsRects.UpdateRects.cRects; ++i) 2078 { 2079 vboxWddmRectTranslate(&pRectsCmd->ContextsRects.UpdateRects.aRects[i], pSource->VScreenPos.x, pSource->VScreenPos.y); 2080 } 2068 2081 NTSTATUS tmpStatus = vboxVdmaGgCmdSubmit(&pDevExt->u.primary.Vdma.DmaGg, &pRectsCmd->Hdr); 2069 2082 Assert(tmpStatus == STATUS_SUCCESS); … … 2111 2124 vboxWddmCheckUpdateShadowAddress(pDevExt, pSource, pPrivateData->SrcAllocInfo.segmentIdAlloc, pPrivateData->SrcAllocInfo.offAlloc); 2112 2125 PVBOXWDDM_DMA_PRESENT_RENDER_FROM_SHADOW pRFS = (PVBOXWDDM_DMA_PRESENT_RENDER_FROM_SHADOW)pPrivateData; 2126 vboxWddmRectTranslate(&pRFS->rect, pSource->VScreenPos.x, pSource->VScreenPos.y); 2113 2127 uint32_t cDMACmdsOutstanding = ASMAtomicReadU32(&pDevExt->cDMACmdsOutstanding); 2114 2128 if (!cDMACmdsOutstanding) … … 2163 2177 rect = pBlt->DstRects.ContextRect; 2164 2178 2179 vboxWddmRectTranslate(&rect, pSource->VScreenPos.x, pSource->VScreenPos.y); 2180 2165 2181 uint32_t cDMACmdsOutstanding = ASMAtomicReadU32(&pDevExt->cDMACmdsOutstanding); 2166 2182 if (!cDMACmdsOutstanding) … … 2171 2187 VBOXVBVA_OP_WITHLOCK_ATDPC(ReportDirtyRect, pDevExt, &pSource->Vbva, &rect); 2172 2188 } 2173 vboxWddmSubmitBltCmd(pDevExt, p Context, pBlt);2189 vboxWddmSubmitBltCmd(pDevExt, pSource, pContext, pBlt); 2174 2190 break; 2175 2191 } … … 2180 2196 if (pSrcAlloc->fRcFlags.RenderTarget) 2181 2197 { 2182 vboxWddmSubmitBltCmd(pDevExt, p Context, pBlt);2198 vboxWddmSubmitBltCmd(pDevExt, pSource, pContext, pBlt); 2183 2199 } 2184 2200 break; … … 2222 2238 { 2223 2239 PVBOXWDDM_ALLOCATION pAlloc = pPrivateData->SrcAllocInfo.pAlloc; 2240 VBOXWDDM_SOURCE *pSource = &pDevExt->aSources[pPrivateData->SrcAllocInfo.srcId]; 2224 2241 pRectsCmd->pContext = pContext; 2225 2242 RECT r; 2226 r. top = 0;2227 r. left = 0;2228 r.right = pAlloc->SurfDesc.width ;2229 r.bottom = pAlloc->SurfDesc.height ;2243 r.left = pSource->VScreenPos.x; 2244 r.top = pSource->VScreenPos.y; 2245 r.right = pAlloc->SurfDesc.width + pSource->VScreenPos.x; 2246 r.bottom = pAlloc->SurfDesc.height + pSource->VScreenPos.y; 2230 2247 pRectsCmd->ContextsRects.ContextRect = r; 2231 2248 pRectsCmd->ContextsRects.UpdateRects.cRects = 1; … … 2843 2860 Status = STATUS_SUCCESS; 2844 2861 break; 2862 case VBOXESC_SCREENLAYOUT: 2863 { 2864 Assert(pEscape->PrivateDriverDataSize >= sizeof (VBOXDISPIFESCAPE_SCREENLAYOUT)); 2865 if (pEscape->PrivateDriverDataSize >= sizeof (VBOXDISPIFESCAPE_SCREENLAYOUT)) 2866 { 2867 PVBOXDISPIFESCAPE_SCREENLAYOUT pLo = (PVBOXDISPIFESCAPE_SCREENLAYOUT)pEscapeHdr; 2868 Assert(pLo->ScreenLayout.cScreens <= (UINT)pDevExt->u.primary.cDisplays); 2869 for (UINT i = 0; i < pLo->ScreenLayout.cScreens; ++i) 2870 { 2871 PVBOXSCREENLAYOUT_ELEMENT pEl = &pLo->ScreenLayout.aScreens[i]; 2872 Assert(pEl->VidPnSourceId < (UINT)pDevExt->u.primary.cDisplays); 2873 if (pEl->VidPnSourceId < (UINT)pDevExt->u.primary.cDisplays) 2874 { 2875 PVBOXWDDM_SOURCE pSource = &pDevExt->aSources[pEl->VidPnSourceId]; 2876 NTSTATUS tmpStatus = vboxWddmGhDisplayUpdateScreenPos(pDevExt, pSource, &pEl->pos); 2877 Assert(tmpStatus == STATUS_SUCCESS); 2878 } 2879 } 2880 Status = STATUS_SUCCESS; 2881 break; 2882 } 2883 else 2884 { 2885 drprintf((__FUNCTION__": VBOXESC_SCREENLAYOUT: incorrect buffer size (%d) < sizeof (VBOXDISPIFESCAPE_SCREENLAYOUT) (%d)\n", 2886 pEscape->PrivateDriverDataSize, sizeof (VBOXDISPIFESCAPE_SCREENLAYOUT))); 2887 AssertBreakpoint(); 2888 Status = STATUS_INVALID_PARAMETER; 2889 } 2890 } 2845 2891 case VBOXESC_REINITVIDEOMODES: 2846 2892 VBoxWddmInvalidateModesTable(pDevExt); … … 2925 2971 PAGED_CODE(); 2926 2972 2927 //dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", hAdapter));2973 dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", hAdapter)); 2928 2974 2929 2975 vboxVDbgBreakFv(); … … 3016 3062 pIsSupportedVidPnArg->IsVidPnSupported = bSupported; 3017 3063 3018 //dfprintf(("<== "__FUNCTION__ ", status(0x%x), context(0x%x)\n", Status, hAdapter));3064 dfprintf(("<== "__FUNCTION__ ", status(0x%x), context(0x%x)\n", Status, hAdapter)); 3019 3065 3020 3066 return Status; … … 3133 3179 PAGED_CODE(); 3134 3180 3135 //dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", hAdapter));3181 dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", hAdapter)); 3136 3182 3137 3183 vboxVDbgBreakFv(); … … 3180 3226 drprintf((__FUNCTION__ ": DxgkCbQueryVidPnInterface failed Status(0x%x)\n", Status)); 3181 3227 3182 //dfprintf(("<== "__FUNCTION__ ", status(0x%x), context(0x%x)\n", Status, hAdapter));3228 dfprintf(("<== "__FUNCTION__ ", status(0x%x), context(0x%x)\n", Status, hAdapter)); 3183 3229 3184 3230 return Status; … … 3485 3531 DXGKARG_GETSCANLINE* pGetScanLine) 3486 3532 { 3487 //dfprintf(("==> "__FUNCTION__ ", hAdapter(0x%x)\n", hAdapter));3533 dfprintf(("==> "__FUNCTION__ ", hAdapter(0x%x)\n", hAdapter)); 3488 3534 3489 3535 PDEVICE_EXTENSION pDevExt = (PDEVICE_EXTENSION)hAdapter; … … 3513 3559 } 3514 3560 3515 //dfprintf(("<== "__FUNCTION__ ", hAdapter(0x%x)\n", hAdapter));3561 dfprintf(("<== "__FUNCTION__ ", hAdapter(0x%x)\n", hAdapter)); 3516 3562 3517 3563 return STATUS_SUCCESS;
Note:
See TracChangeset
for help on using the changeset viewer.