Changeset 95250 in vbox for trunk/src/VBox/Additions/WINNT/Graphics
- Timestamp:
- Jun 12, 2022 9:48:40 AM (3 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Video
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/Makefile.kmk
r95234 r95250 117 117 VBoxDispD3D_DEFS += VBOX_WITH_VIDEOHWACCEL 118 118 endif 119 # Avoid "src\VBox\Additions\3D\mesa\mesa-21.3.8\include\c99_compat.h(99): warning C4668: '__STDC_VERSION__' 120 # is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'" 121 VBoxDispD3D_DEFS += __STDC_VERSION__=0 119 122 VBoxDispD3D_INCS = \ 120 123 ../../../include \ -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/gallium/GaDdi.cpp
r95234 r95250 2166 2166 pAllocation->hAllocation = pOAI->hAllocation; 2167 2167 pAllocation->enmType = VBOXWDDM_ALLOC_TYPE_D3D; 2168 pAllocation->hSharedHandle = 0; /* This is should be a sid of the allocation. Not needed here. */ 2168 2169 /* 'hSharedHandle' a sid of the allocation. */ 2170 IDirect3DDevice9 *pDevice9If = VBOXDISP_D3DEV(pDevice); 2171 IGaDirect3DDevice9Ex *pGaD3DDevice9Ex = NULL; 2172 HRESULT hr2 = pDevice9If->QueryInterface(IID_IGaDirect3DDevice9Ex, (void**)&pGaD3DDevice9Ex); 2173 Assert(SUCCEEDED(hr2)); 2174 if (SUCCEEDED(hr2)) 2175 { 2176 Assert(pGaD3DDevice9Ex); 2177 2178 VBOXDISPIFESCAPE_SVGAGETSID data; 2179 memset(&data, 0, sizeof(data)); 2180 data.EscapeHdr.escapeCode = VBOXESC_SVGAGETSID; 2181 data.hAllocation = pOAI->hAllocation; 2182 // data.u32Sid = 0; 2183 hr2 = pGaD3DDevice9Ex->EscapeCb(&data, sizeof(data), /* fHardwareAccess= */ false); 2184 if (SUCCEEDED(hr2)) 2185 pAllocation->hSharedHandle = (HANDLE)(uintptr_t)data.u32Sid; 2186 else 2187 pAllocation->hSharedHandle = 0; 2188 2189 pGaD3DDevice9Ex->Release(); 2190 } 2191 2169 2192 pAllocation->AllocDesc = *pAllocDesc; 2170 2193 pAllocation->pvMem = NULL; … … 2245 2268 else if (pOAI->pPrivateDriverData && pOAI->PrivateDriverDataSize == sizeof(VBOXDXALLOCATIONDESC)) 2246 2269 { 2270 /* This is D3D UMD (VBoxDX) resource. Do the same as for "generic" resource branch below. */ 2247 2271 VBOXDXALLOCATIONDESC *pAllocDesc = (VBOXDXALLOCATIONDESC *)pOAI->pPrivateDriverData; 2272 2273 pRc->fFlags.Generic = 1; 2274 pRc->cAllocations = 1; 2248 2275 pRc->RcDesc.fFlags.Primary = pAllocDesc->fPrimary; 2249 2276 pRc->RcDesc.fFlags.RenderTarget = 1; 2250 //pRc->RcDesc.fFlags.NotLockable = 1;2251 2277 pRc->RcDesc.enmFormat = pAllocDesc->enmDDIFormat; 2252 2278 if (pAllocDesc->fPrimary) … … 2255 2281 pRc->RcDesc.RefreshRate.Numerator = pAllocDesc->PrimaryDesc.ModeDesc.RefreshRate.Numerator; 2256 2282 pRc->RcDesc.RefreshRate.Denominator = pAllocDesc->PrimaryDesc.ModeDesc.RefreshRate.Denominator; 2283 } 2284 2285 hr = GaD3DIfCreateForRc(pRc); 2286 if (SUCCEEDED(hr)) 2287 { 2288 /* Get the just created surface id and inform the miniport that the surface id 2289 * should be replaced with the original surface id. 2290 */ 2291 IDirect3DDevice9 *pDevice9If = VBOXDISP_D3DEV(pDevice); 2292 IGaDirect3DDevice9Ex *pGaD3DDevice9Ex = NULL; 2293 HRESULT hr2 = pDevice9If->QueryInterface(IID_IGaDirect3DDevice9Ex, (void**)&pGaD3DDevice9Ex); 2294 if (SUCCEEDED(hr2)) 2295 { 2296 Assert(pGaD3DDevice9Ex); 2297 PVBOXWDDMDISP_ALLOCATION pAllocation = &pRc->aAllocations[0]; /* First allocation is enough. */ 2298 uint32_t u32Sid; 2299 hr2 = pGaD3DDevice9Ex->GaSurfaceId(pAllocation->pD3DIf, &u32Sid); 2300 if (SUCCEEDED(hr2)) 2301 { 2302 /* Inform the miniport. */ 2303 Assert(pAllocation->hSharedHandle); 2304 2305 pAllocation->hostID = u32Sid; 2306 2307 VBOXDISPIFESCAPE_GASHAREDSID data; 2308 RT_ZERO(data); 2309 data.EscapeHdr.escapeCode = VBOXESC_GASHAREDSID; 2310 data.u32Sid = u32Sid; 2311 data.u32SharedSid = (uint32_t)(uintptr_t)pAllocation->hSharedHandle; 2312 hr2 = pGaD3DDevice9Ex->EscapeCb(&data, sizeof(data), /* fHardwareAccess= */ false); 2313 } 2314 pGaD3DDevice9Ex->Release(); 2315 } 2257 2316 } 2258 2317 } -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/gallium/Present.cpp
r93115 r95250 266 266 HRESULT WINAPI WDDMPresent::GetCursorPos(POINT *pPoint) 267 267 { 268 RT_NOREF(pPoint); 269 TRAPNOTIMPL; 270 return D3DERR_INVALIDCALL; 268 if (!::GetCursorPos(pPoint)) 269 { 270 pPoint->x = 0; 271 pPoint->y = 0; 272 } 273 return S_OK; 271 274 } 272 275 -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/gallium/Svga.cpp
r95234 r95250 1038 1038 Status = SvgaProcessSurface(pSvga, &p->dstSid, pHOA); 1039 1039 } break; 1040 case SVGA_3D_CMD_DX_DEFINE_RENDERTARGET_VIEW: 1041 { 1042 SVGA3dCmdDXDefineRenderTargetView *p = (SVGA3dCmdDXDefineRenderTargetView *)pCommand; 1043 Status = SvgaProcessSurface(pSvga, &p->sid, pHOA); 1044 } break; 1045 case SVGA_3D_CMD_DX_DEFINE_SHADERRESOURCE_VIEW: 1046 { 1047 SVGA3dCmdDXDefineShaderResourceView *p = (SVGA3dCmdDXDefineShaderResourceView *)pCommand; 1048 Status = SvgaProcessSurface(pSvga, &p->sid, pHOA); 1049 } break; 1040 1050 default: 1041 1051 if (SVGA_3D_CMD_DX_MIN <= u32CmdId && u32CmdId <= SVGA_3D_CMD_DX_MAX) … … 1824 1834 if (NT_SUCCESS(Status)) 1825 1835 { 1826 Status = SvgaGboFillPageTableFor Array(&pRegion->pMob->gbo, pRegion->u32NumPages, pRegion->aPhys);1836 Status = SvgaGboFillPageTableForMemObj(&pRegion->pMob->gbo, pRegion->MemObj); 1827 1837 Assert(NT_SUCCESS(Status)); 1828 1838 if (NT_SUCCESS(Status)) … … 1873 1883 static NTSTATUS gmrAlloc(GAWDDMREGION *pRegion) 1874 1884 { 1875 int rc = RTR0MemObjAlloc LowTag(&pRegion->MemObj, pRegion->u32NumPages << PAGE_SHIFT,1876 false /* executable R0 mapping */, "WDDMGA");1885 int rc = RTR0MemObjAllocPageTag(&pRegion->MemObj, pRegion->u32NumPages << PAGE_SHIFT, 1886 false /* executable R0 mapping */, "VMSVGAGMR"); 1877 1887 AssertRC(rc); 1878 1888 if (RT_SUCCESS(rc)) … … 2064 2074 Status = SvgaGMRReport(pSvga, 2065 2075 VMSVGAMOB_ID(pRegion->pMob), 2066 SVGA_REMAP_GMR2_PPN 32,2076 SVGA_REMAP_GMR2_PPN64, 2067 2077 pRegion->u32NumPages, 2068 2078 &pRegion->aPhys[0]); … … 2284 2294 for (unsigned i = 0; i < pGbo->cbGbo >> PAGE_SHIFT; ++i) 2285 2295 paPpnGbo[i] = RTR0MemObjGetPagePhysAddr(hMemObj, i) >> PAGE_SHIFT; 2286 }2287 return STATUS_SUCCESS;2288 }2289 2290 2291 NTSTATUS SvgaGboFillPageTableForArray(PVMSVGAGBO pGbo,2292 uint32_t u32NumPages,2293 RTHCPHYS *paPhys)2294 {2295 if (pGbo->enmMobFormat == SVGA3D_MOBFMT_PTDEPTH64_0)2296 {2297 Assert(u32NumPages == 1);2298 pGbo->base = paPhys[0] >> PAGE_SHIFT;2299 }2300 else2301 {2302 /* The first of pages is alway the base. It is either the level 2 page or the single level 1 page */2303 pGbo->base = RTR0MemObjGetPagePhysAddr(pGbo->hMemObjPT, 0) >> PAGE_SHIFT;2304 2305 PPN64 *paPpn = (PPN64 *)RTR0MemObjAddress(pGbo->hMemObjPT);2306 PPN64 *paPpnGbo;2307 if (pGbo->enmMobFormat == SVGA3D_MOBFMT_PTDEPTH64_2)2308 paPpnGbo = &paPpn[PAGE_SIZE / sizeof(PPN64)]; /* Level 1 pages follow the level 2 page. */2309 else if (pGbo->enmMobFormat == SVGA3D_MOBFMT_PTDEPTH64_1)2310 paPpnGbo = paPpn;2311 else2312 AssertFailedReturn(STATUS_INVALID_PARAMETER);2313 2314 /* Store page numbers into the level 1 description pages. */2315 for (unsigned i = 0; i < u32NumPages; ++i)2316 paPpnGbo[i] = paPhys[i] >> PAGE_SHIFT;2317 2296 } 2318 2297 return STATUS_SUCCESS; -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/gallium/Svga.h
r95234 r95250 610 610 NTSTATUS SvgaGboFillPageTableForMemObj(PVMSVGAGBO pGbo, 611 611 RTR0MEMOBJ hMemObj); 612 NTSTATUS SvgaGboFillPageTableForArray(PVMSVGAGBO pGbo,613 uint32_t u32NumPages,614 RTHCPHYS *paPhys);615 612 616 613 void SvgaMobFree(VBOXWDDM_EXT_VMSVGA *pSvga,
Note:
See TracChangeset
for help on using the changeset viewer.