Changeset 31687 in vbox for trunk/src/VBox/Additions/WINNT/Graphics
- Timestamp:
- Aug 16, 2010 10:59:01 AM (14 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Display/Makefile.kmk
r30855 r31687 90 90 wddm/VBoxDispCm.cpp \ 91 91 wddm/VBoxDispMp.cpp \ 92 wddm/VBoxScreen.cpp \ 92 93 wddm/VBoxDispMpTst.cpp \ 93 94 wddm/VBoxDispD3D.def \ -
trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.cpp
r30986 r31687 23 23 #include "VBoxDispD3DCmn.h" 24 24 #include "VBoxDispD3D.h" 25 #include "VBoxScreen.h" 25 26 26 27 #ifdef VBOXDISPMP_TEST … … 34 35 35 36 #define VBOXWDDMDISP_WITH_TMPWORKAROUND 1 37 38 static VBOXSCREENMONRUNNER g_VBoxScreenMonRunner; 36 39 37 40 //#define VBOXWDDMOVERLAY_TEST … … 1344 1347 LPVOID lpReserved) 1345 1348 { 1346 BOOL bOk = TRUE;1347 1348 1349 switch (dwReason) 1349 1350 { 1350 1351 case DLL_PROCESS_ATTACH: 1351 1352 { 1353 vboxVDbgPrint(("VBoxDispD3D: DLL loaded.\n")); 1352 1354 #ifdef VBOXWDDMDISP_DEBUG 1353 1355 vboxVDbgVEHandlerRegister(); … … 1357 1359 HRESULT hr = vboxDispCmInit(); 1358 1360 Assert(hr == S_OK); 1361 if (hr == S_OK) 1362 { 1359 1363 #ifdef VBOXDISPMP_TEST 1360 if (hr == S_OK)1361 {1362 1364 hr = vboxDispMpTstStart(); 1363 1365 Assert(hr == S_OK); 1364 }1366 if (hr == S_OK) 1365 1367 #endif 1366 if (hr == S_OK) 1367 vboxVDbgPrint(("VBoxDispD3D: DLL loaded.\n")); 1368 else 1369 bOk = FALSE; 1370 1368 { 1369 hr = VBoxScreenMRunnerStart(&g_VBoxScreenMonRunner); 1370 Assert(hr == S_OK); 1371 /* succeed in any way */ 1372 hr = S_OK; 1373 if (hr == S_OK) 1374 { 1375 vboxVDbgPrint(("VBoxDispD3D: DLL loaded OK\n")); 1376 return TRUE; 1377 } 1378 #ifdef VBOXDISPMP_TEST 1379 vboxDispMpTstStop(); 1380 #endif 1381 } 1382 vboxDispCmTerm(); 1383 } 1371 1384 // VbglR3Init(); 1372 1385 break; … … 1378 1391 vboxVDbgVEHandlerUnregister(); 1379 1392 #endif 1380 HRESULT hr; 1381 #ifdef VBOXDISPMP_TEST 1382 hr = vboxDispMpTstStop(); 1393 HRESULT hr = VBoxScreenMRunnerStop(&g_VBoxScreenMonRunner); 1383 1394 Assert(hr == S_OK); 1384 1395 if (hr == S_OK) 1385 #endif 1386 { 1387 hr = vboxDisp CmTerm();1396 { 1397 #ifdef VBOXDISPMP_TEST 1398 hr = vboxDispMpTstStop(); 1388 1399 Assert(hr == S_OK); 1389 1400 if (hr == S_OK) 1390 vboxVDbgPrint(("VBoxDispD3D: DLL unloaded.\n")); 1391 else 1392 bOk = FALSE; 1401 #endif 1402 { 1403 hr = vboxDispCmTerm(); 1404 Assert(hr == S_OK); 1405 if (hr == S_OK) 1406 { 1407 vboxVDbgPrint(("VBoxDispD3D: DLL unloaded.\n")); 1408 return TRUE; 1409 } 1410 } 1393 1411 } 1394 1412 // VbglR3Term(); … … 1398 1416 1399 1417 default: 1400 break;1401 } 1402 return bOk;1418 return TRUE; 1419 } 1420 return FALSE; 1403 1421 } 1404 1422 -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.h
r30953 r31687 178 178 VBOXWDDM_VHWA Vhwa; 179 179 #endif 180 POINT VScreenPos; 180 181 VBOXWDDM_POINTER_INFO PointerInfo; 181 182 } VBOXWDDM_SOURCE, *PVBOXWDDM_SOURCE; -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoIf.h
r30953 r31687 239 239 } VBOXDISPIFESCAPE_DBGPRINT, *PVBOXDISPIFESCAPE_DBGPRINT; 240 240 AssertCompile(RT_OFFSETOF(VBOXDISPIFESCAPE_DBGPRINT, EscapeHdr) == 0); 241 242 typedef struct VBOXSCREENLAYOUT_ELEMENT 243 { 244 D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId; 245 POINT pos; 246 } VBOXSCREENLAYOUT_ELEMENT, *PVBOXSCREENLAYOUT_ELEMENT; 247 248 typedef struct VBOXSCREENLAYOUT 249 { 250 uint32_t cScreens; 251 VBOXSCREENLAYOUT_ELEMENT aScreens[1]; 252 } VBOXSCREENLAYOUT, *PVBOXSCREENLAYOUT; 253 254 typedef struct VBOXDISPIFESCAPE_SCREENLAYOUT 255 { 256 VBOXDISPIFESCAPE EscapeHdr; 257 VBOXSCREENLAYOUT ScreenLayout; 258 } VBOXDISPIFESCAPE_SCREENLAYOUT, *PVBOXDISPIFESCAPE_SCREENLAYOUT; 241 259 242 260 /* query info func */ -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVdma.cpp
r30973 r31687 562 562 { 563 563 PVBOXWDDM_SOURCE pSource = &pDevExt->aSources[pCF->VidPnSourceId]; 564 vboxWddmRectTranslate(&UnionRect, pSource->VScreenPos.x, pSource->VScreenPos.y); 564 565 VBOXVBVA_OP_WITHLOCK(ReportDirtyRect, pDevExt, &pSource->Vbva, &UnionRect); 565 566 } -
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; -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/Makefile.kmk
r30973 r31687 126 126 LIB_TO_DATADIR=\"\" \ 127 127 BIN_TO_DATADIR=\"\" 128 if "$(KBUILD_TYPE)" != "debug" || !defined(DEBUG_misha)128 if "$(KBUILD_TYPE)" != "debug" || defined(DEBUG_misha) 129 129 wined3d_DEFS += WINE_NO_DEBUG_MSGS 130 130 endif … … 183 183 LIB_TO_DATADIR=\"\" \ 184 184 BIN_TO_DATADIR=\"\" 185 if "$(KBUILD_TYPE)" != "debug" || !defined(DEBUG_misha)185 if "$(KBUILD_TYPE)" != "debug" || defined(DEBUG_misha) 186 186 VBoxD3D8_DEFS += WINE_NO_DEBUG_MSGS 187 187 endif … … 220 220 LIB_TO_DATADIR=\"\" \ 221 221 BIN_TO_DATADIR=\"\" 222 if "$(KBUILD_TYPE)" != "debug" || !defined(DEBUG_misha)222 if "$(KBUILD_TYPE)" != "debug" || defined(DEBUG_misha) 223 223 VBoxD3D9_DEFS += WINE_NO_DEBUG_MSGS 224 224 endif
Note:
See TracChangeset
for help on using the changeset viewer.