Changeset 50628 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm
- Timestamp:
- Feb 27, 2014 12:39:15 PM (11 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPMisc.cpp
r49591 r50628 1895 1895 NTSTATUS VBoxWddmSlEnableVSyncNotification(PVBOXMP_DEVEXT pDevExt, BOOLEAN fEnable) 1896 1896 { 1897 if (!pDevExt->bVSyncTimerEnabled == !fEnable) 1898 return STATUS_SUCCESS; 1899 1897 1900 if (!fEnable) 1898 1901 { … … 1901 1904 else 1902 1905 { 1906 KeQuerySystemTime(&pDevExt->VSyncTime); 1907 1903 1908 LARGE_INTEGER DueTime; 1904 1909 DueTime.QuadPart = -166666LL; /* 60 Hz */ 1905 1910 KeSetTimerEx(&pDevExt->VSyncTimer, DueTime, 16, &pDevExt->VSyncDpc); 1906 1911 } 1912 1913 pDevExt->bVSyncTimerEnabled = !!fEnable; 1914 1907 1915 return STATUS_SUCCESS; 1908 1916 } … … 1915 1923 Assert(pTarget->HeightVisible); 1916 1924 Assert(pTarget->HeightTotal >= pTarget->HeightVisible); 1917 Assert(pTarget->ScanLineState < pTarget->HeightTotal);1918 1925 if (pTarget->HeightTotal) 1919 1926 { 1920 uint32_t curScanLine = pTarget->ScanLineState; 1921 ++pTarget->ScanLineState; 1922 if (pTarget->ScanLineState >= pTarget->HeightTotal) 1923 pTarget->ScanLineState = 0; 1924 1925 1926 BOOL bVBlank = (!curScanLine || curScanLine > pTarget->HeightVisible); 1927 uint32_t curScanLine; 1928 BOOL bVBlank; 1929 LARGE_INTEGER DevVSyncTime; 1930 DevVSyncTime.QuadPart = ASMAtomicReadU64((volatile uint64_t*)&pDevExt->VSyncTime.QuadPart); 1931 LARGE_INTEGER VSyncTime; 1932 KeQuerySystemTime(&VSyncTime); 1933 1934 if (VSyncTime.QuadPart < DevVSyncTime.QuadPart) 1935 { 1936 WARN(("vsync time is less than the one stored in device")); 1937 curScanLine = 0; 1938 } 1939 else 1940 { 1941 VSyncTime.QuadPart = VSyncTime.QuadPart - DevVSyncTime.QuadPart; 1942 /* time is in 100ns, */ 1943 curScanLine = (uint32_t)((pTarget->HeightTotal * VSyncTime.QuadPart) / DevVSyncTime.QuadPart); 1944 if (pDevExt->bVSyncTimerEnabled) 1945 { 1946 if (curScanLine >= pTarget->HeightTotal) 1947 curScanLine = 0; 1948 } 1949 else 1950 { 1951 curScanLine %= pTarget->HeightTotal; 1952 } 1953 } 1954 1955 bVBlank = (!curScanLine || curScanLine > pTarget->HeightVisible); 1927 1956 pGetScanLine->ScanLine = curScanLine; 1928 1957 pGetScanLine->InVerticalBlank = bVBlank; … … 1934 1963 } 1935 1964 return STATUS_SUCCESS; 1965 } 1966 1967 static BOOLEAN vboxWddmSlVSyncIrqCb(PVOID pvContext) 1968 { 1969 PVBOXMP_DEVEXT pDevExt = (PVBOXMP_DEVEXT)pvContext; 1970 DXGKARGCB_NOTIFY_INTERRUPT_DATA notify; 1971 BOOLEAN bNeedDpc = FALSE; 1972 for (UINT i = 0; i < (UINT)VBoxCommonFromDeviceExt(pDevExt)->cDisplays; ++i) 1973 { 1974 PVBOXWDDM_TARGET pTarget = &pDevExt->aTargets[i]; 1975 if (pTarget->fConnected) 1976 { 1977 memset(¬ify, 0, sizeof(DXGKARGCB_NOTIFY_INTERRUPT_DATA)); 1978 notify.InterruptType = DXGK_INTERRUPT_CRTC_VSYNC; 1979 notify.CrtcVsync.VidPnTargetId = i; 1980 pDevExt->u.primary.DxgkInterface.DxgkCbNotifyInterrupt(pDevExt->u.primary.DxgkInterface.DeviceHandle, ¬ify); 1981 bNeedDpc = TRUE; 1982 } 1983 } 1984 1985 if (bNeedDpc) 1986 { 1987 pDevExt->u.primary.DxgkInterface.DxgkCbQueueDpc(pDevExt->u.primary.DxgkInterface.DeviceHandle); 1988 } 1989 1990 return FALSE; 1936 1991 } 1937 1992 … … 1944 1999 { 1945 2000 PVBOXMP_DEVEXT pDevExt = (PVBOXMP_DEVEXT)DeferredContext; 1946 DXGKARGCB_NOTIFY_INTERRUPT_DATA notify; 1947 BOOLEAN bNeedDpc = FALSE; 1948 for (UINT i = 0; i < (UINT)VBoxCommonFromDeviceExt(pDevExt)->cDisplays; ++i) 1949 { 1950 PVBOXWDDM_SOURCE pSource = &pDevExt->aSources[i]; 1951 PVBOXWDDM_ALLOCATION pPrimary = vboxWddmAquirePrimary(pDevExt, pSource, i); 1952 if (pPrimary) 1953 { 1954 VBOXVIDEOOFFSET offVram = pPrimary->AllocData.Addr.offVram; 1955 if (offVram != VBOXVIDEOOFFSET_VOID) 1956 { 1957 memset(¬ify, 0, sizeof(DXGKARGCB_NOTIFY_INTERRUPT_DATA)); 1958 notify.InterruptType = DXGK_INTERRUPT_CRTC_VSYNC; 1959 /* @todo: !!!this is not correct in case we want source[i]->target[i!=j] mapping */ 1960 notify.CrtcVsync.VidPnTargetId = i; 1961 notify.CrtcVsync.PhysicalAddress.QuadPart = offVram; 1962 /* yes, we can report VSync at dispatch */ 1963 pDevExt->u.primary.DxgkInterface.DxgkCbNotifyInterrupt(pDevExt->u.primary.DxgkInterface.DeviceHandle, ¬ify); 1964 bNeedDpc = TRUE; 1965 } 1966 1967 vboxWddmAllocationRelease(pPrimary); 1968 } 1969 } 1970 1971 if (bNeedDpc) 1972 { 1973 pDevExt->u.primary.DxgkInterface.DxgkCbQueueDpc(pDevExt->u.primary.DxgkInterface.DeviceHandle); 1974 } 2001 Assert(!pDevExt->fVSyncInVBlank); 2002 ASMAtomicWriteU32(&pDevExt->fVSyncInVBlank, 1); 2003 2004 BOOLEAN bDummy; 2005 NTSTATUS Status = pDevExt->u.primary.DxgkInterface.DxgkCbSynchronizeExecution( 2006 pDevExt->u.primary.DxgkInterface.DeviceHandle, 2007 vboxWddmSlVSyncIrqCb, 2008 pDevExt, 2009 0, /* IN ULONG MessageNumber */ 2010 &bDummy); 2011 if (!NT_SUCCESS(Status)) 2012 WARN(("DxgkCbSynchronizeExecution failed Status %#x", Status)); 2013 2014 LARGE_INTEGER VSyncTime; 2015 KeQuerySystemTime(&VSyncTime); 2016 ASMAtomicWriteU64((volatile uint64_t*)&pDevExt->VSyncTime.QuadPart, VSyncTime.QuadPart); 2017 2018 ASMAtomicWriteU32(&pDevExt->fVSyncInVBlank, 0); 1975 2019 } 1976 2020 1977 2021 NTSTATUS VBoxWddmSlInit(PVBOXMP_DEVEXT pDevExt) 1978 2022 { 2023 pDevExt->bVSyncTimerEnabled = FALSE; 2024 pDevExt->fVSyncInVBlank = 0; 2025 KeQuerySystemTime(&pDevExt->VSyncTime); 1979 2026 KeInitializeTimer(&pDevExt->VSyncTimer); 1980 2027 KeInitializeDpc(&pDevExt->VSyncDpc, vboxWddmSlVSyncDpc, pDevExt); … … 2035 2082 if (pSource->AllocData.Addr.offVram != PhAddr.QuadPart 2036 2083 || pSource->AllocData.Addr.SegmentId != 1) 2037 pSource-> fGhSynced = 0;2084 pSource->u8SyncState &= ~VBOXWDDM_HGSYNC_F_SYNCED_LOCATION; 2038 2085 pSource->AllocData.Addr.SegmentId = 1; 2039 2086 pSource->AllocData.Addr.offVram = PhAddr.QuadPart; -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPTypes.h
r49591 r50628 112 112 } VBOXWDDM_ALLOC_DATA, *PVBOXWDDM_ALLOC_DATA; 113 113 114 #define VBOXWDDM_HGSYNC_F_SYNCED_DIMENSIONS 0x01 115 #define VBOXWDDM_HGSYNC_F_SYNCED_LOCATION 0x02 116 #define VBOXWDDM_HGSYNC_F_SYNCED_ALL (VBOXWDDM_HGSYNC_F_SYNCED_DIMENSIONS | VBOXWDDM_HGSYNC_F_SYNCED_LOCATION) 117 #define VBOXWDDM_HGSYNC_F_CHANGED_LOCATION_ONLY (VBOXWDDM_HGSYNC_F_SYNCED_ALL & ~VBOXWDDM_HGSYNC_F_SYNCED_LOCATION) 118 114 119 typedef struct VBOXWDDM_SOURCE 115 120 { … … 119 124 #endif 120 125 VBOXWDDM_ALLOC_DATA AllocData; 126 uint8_t u8SyncState; 121 127 BOOLEAN bVisible; 122 char fGhSynced;123 128 /* specifies whether the source has 3D overlay data visible */ 124 129 BOOLEAN fHas3DVrs; … … 140 145 typedef struct VBOXWDDM_TARGET 141 146 { 142 uint32_t ScanLineState;143 147 uint32_t HeightVisible; 144 148 uint32_t HeightTotal; 145 149 /* since there coul be multiple state changes on auto-resize, 146 * we pend notifying host to avoi flickering */150 * we pend notifying host to avoid flickering */ 147 151 volatile bool fStateSyncPening; 148 152 bool fConnected; -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVidPn.cpp
r48070 r50628 2090 2090 NTSTATUS vboxVidPnSetupSourceInfo(PVBOXMP_DEVEXT pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId, PVBOXWDDM_SOURCE pSource, CONST D3DKMDT_VIDPN_SOURCE_MODE* pVidPnSourceModeInfo, PVBOXWDDM_ALLOCATION pAllocation) 2091 2091 { 2092 vboxWddmAssignPrimary(pDevExt, pSource, pAllocation, srcId);2093 2092 /* pVidPnSourceModeInfo could be null if STATUS_GRAPHICS_MODE_NOT_PINNED, 2094 2093 * see vboxVidPnCommitSourceModeForSrcId */ 2094 uint8_t fChanges = 0; 2095 2095 if (pVidPnSourceModeInfo) 2096 2096 { 2097 pSource->AllocData.SurfDesc.width = pVidPnSourceModeInfo->Format.Graphics.PrimSurfSize.cx; 2098 pSource->AllocData.SurfDesc.height = pVidPnSourceModeInfo->Format.Graphics.PrimSurfSize.cy; 2099 pSource->AllocData.SurfDesc.format = pVidPnSourceModeInfo->Format.Graphics.PixelFormat; 2100 pSource->AllocData.SurfDesc.bpp = vboxWddmCalcBitsPerPixel(pVidPnSourceModeInfo->Format.Graphics.PixelFormat); 2101 pSource->AllocData.SurfDesc.pitch = pVidPnSourceModeInfo->Format.Graphics.Stride; 2097 if (pSource->AllocData.SurfDesc.width != pVidPnSourceModeInfo->Format.Graphics.PrimSurfSize.cx) 2098 { 2099 fChanges |= VBOXWDDM_HGSYNC_F_SYNCED_DIMENSIONS; 2100 pSource->AllocData.SurfDesc.width = pVidPnSourceModeInfo->Format.Graphics.PrimSurfSize.cx; 2101 } 2102 if (pSource->AllocData.SurfDesc.height != pVidPnSourceModeInfo->Format.Graphics.PrimSurfSize.cy) 2103 { 2104 fChanges |= VBOXWDDM_HGSYNC_F_SYNCED_DIMENSIONS; 2105 pSource->AllocData.SurfDesc.height = pVidPnSourceModeInfo->Format.Graphics.PrimSurfSize.cy; 2106 } 2107 if (pSource->AllocData.SurfDesc.format != pVidPnSourceModeInfo->Format.Graphics.PixelFormat) 2108 { 2109 fChanges |= VBOXWDDM_HGSYNC_F_SYNCED_DIMENSIONS; 2110 pSource->AllocData.SurfDesc.format = pVidPnSourceModeInfo->Format.Graphics.PixelFormat; 2111 } 2112 if (pSource->AllocData.SurfDesc.bpp != vboxWddmCalcBitsPerPixel(pVidPnSourceModeInfo->Format.Graphics.PixelFormat)) 2113 { 2114 fChanges |= VBOXWDDM_HGSYNC_F_SYNCED_DIMENSIONS; 2115 pSource->AllocData.SurfDesc.bpp = vboxWddmCalcBitsPerPixel(pVidPnSourceModeInfo->Format.Graphics.PixelFormat); 2116 } 2117 if(pSource->AllocData.SurfDesc.pitch != pVidPnSourceModeInfo->Format.Graphics.Stride) 2118 { 2119 fChanges |= VBOXWDDM_HGSYNC_F_SYNCED_DIMENSIONS; 2120 pSource->AllocData.SurfDesc.pitch = pVidPnSourceModeInfo->Format.Graphics.Stride; 2121 } 2102 2122 pSource->AllocData.SurfDesc.depth = 1; 2103 pSource->AllocData.SurfDesc.slicePitch = pVidPnSourceModeInfo->Format.Graphics.Stride; 2104 pSource->AllocData.SurfDesc.cbSize = pVidPnSourceModeInfo->Format.Graphics.Stride * pVidPnSourceModeInfo->Format.Graphics.PrimSurfSize.cy; 2123 if (pSource->AllocData.SurfDesc.slicePitch != pVidPnSourceModeInfo->Format.Graphics.Stride) 2124 { 2125 fChanges |= VBOXWDDM_HGSYNC_F_SYNCED_DIMENSIONS; 2126 pSource->AllocData.SurfDesc.slicePitch = pVidPnSourceModeInfo->Format.Graphics.Stride; 2127 } 2128 if (pSource->AllocData.SurfDesc.cbSize != pVidPnSourceModeInfo->Format.Graphics.Stride * pVidPnSourceModeInfo->Format.Graphics.PrimSurfSize.cy) 2129 { 2130 fChanges |= VBOXWDDM_HGSYNC_F_SYNCED_DIMENSIONS; 2131 pSource->AllocData.SurfDesc.cbSize = pVidPnSourceModeInfo->Format.Graphics.Stride * pVidPnSourceModeInfo->Format.Graphics.PrimSurfSize.cy; 2132 } 2105 2133 #ifdef VBOX_WDDM_WIN8 2106 2134 if (g_VBoxDisplayOnly) … … 2113 2141 { 2114 2142 Assert(!pAllocation); 2115 } 2143 fChanges |= VBOXWDDM_HGSYNC_F_SYNCED_ALL; 2144 } 2145 2146 vboxWddmAssignPrimary(pDevExt, pSource, pAllocation, srcId); 2147 2116 2148 Assert(pSource->AllocData.SurfDesc.VidPnSourceId == srcId); 2117 pSource-> fGhSynced = 0;2149 pSource->u8SyncState &= ~fChanges; 2118 2150 return STATUS_SUCCESS; 2119 2151 } … … 2161 2193 pTarget->HeightVisible = pPinnedVidPnTargetModeInfo->VideoSignalInfo.ActiveSize.cy; 2162 2194 pTarget->HeightTotal = pPinnedVidPnTargetModeInfo->VideoSignalInfo.TotalSize.cy; 2163 pTarget->ScanLineState = 0;2164 2195 } 2165 2196 pVidPnTargetModeSetInterface->pfnReleaseModeInfo(hVidPnTargetModeSet, pPinnedVidPnTargetModeInfo); -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp
r50313 r50628 242 242 NTSTATUS vboxWddmGhDisplayHideScreen(PVBOXMP_DEVEXT pDevExt, D3DDDI_VIDEO_PRESENT_TARGET_ID VidPnTargetId) 243 243 { 244 VBOXWDDM_SURFACE_DESC SurfDesc = {0}; 244 PVBOXWDDM_SOURCE pSource = &pDevExt->aSources[VidPnTargetId]; 245 /* this will force update on re-activation */ 246 pSource->AllocData.SurfDesc.width = 0; 247 pSource->AllocData.SurfDesc.height = 0; 245 248 POINT VScreenPos = {0}; 246 SurfDesc.VidPnSourceId = VidPnTargetId; 247 NTSTATUS Status = vboxWddmGhDisplayPostInfoScreenBySDesc(pDevExt, & SurfDesc, &VScreenPos, VBVA_SCREEN_F_ACTIVE | VBVA_SCREEN_F_DISABLED);249 250 NTSTATUS Status = vboxWddmGhDisplayPostInfoScreenBySDesc(pDevExt, &pSource->AllocData.SurfDesc, &VScreenPos, VBVA_SCREEN_F_ACTIVE | VBVA_SCREEN_F_DISABLED); 248 251 if (!NT_SUCCESS(Status)) 249 252 WARN(("vboxWddmGhDisplayPostInfoScreenBySDesc failed Status 0x%x", Status)); … … 341 344 } 342 345 343 NTSTATUS vboxWddmGhDisplaySetInfo(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_ALLOCATION pRealFbAlloc, const VBOXWDDM_ALLOC_DATA *pAllocData, const POINT * pVScreenPos) 344 { 345 NTSTATUS Status = vboxWddmGhDisplaySetMode(pDevExt, pAllocData); 346 NTSTATUS vboxWddmGhDisplaySetInfo(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_ALLOCATION pRealFbAlloc, const VBOXWDDM_ALLOC_DATA *pAllocData, const POINT * pVScreenPos, uint8_t u8CurCyncState) 347 { 348 NTSTATUS Status; 349 350 if ((u8CurCyncState & VBOXWDDM_HGSYNC_F_CHANGED_LOCATION_ONLY) == VBOXWDDM_HGSYNC_F_CHANGED_LOCATION_ONLY 351 && pRealFbAlloc->AllocData.hostID) 352 { 353 Status = vboxVdmaTexPresentSetAlloc(pDevExt, pRealFbAlloc); 354 if (!NT_SUCCESS(Status)) 355 WARN(("vboxVdmaTexPresentSetAlloc failed, Status 0x%x", Status)); 356 return Status; 357 } 358 359 Status = vboxWddmGhDisplaySetMode(pDevExt, pAllocData); 346 360 if (NT_SUCCESS(Status)) 347 361 { … … 378 392 { 379 393 vboxWddmGhDisplayHideScreen(pDevExt, pSource->AllocData.SurfDesc.VidPnSourceId); 380 pSource-> fGhSynced = 1;394 pSource->u8SyncState = VBOXWDDM_HGSYNC_F_SYNCED_ALL; 381 395 return true; 382 396 } 383 397 384 char fGhSynced = 1;385 398 PVBOXWDDM_ALLOCATION pFbAlloc = VBOXWDDM_FB_ALLOCATION(pDevExt, pSource); 386 399 PVBOXWDDM_ALLOCATION pRealFbAlloc = pSource->pPrimaryAllocation; … … 394 407 395 408 if (!pFbAlloc) 396 { 397 pFbAlloc = VBOXWDDM_NONFB_ALLOCATION(pDevExt, pSource); 398 fGhSynced = -1; 399 } 409 pFbAlloc = pRealFbAlloc; 400 410 401 411 if (!pFbAlloc || pFbAlloc->AllocData.Addr.offVram == VBOXVIDEOOFFSET_VOID) … … 416 426 Assert(!pFbAlloc || pFbAlloc->AllocData.Addr.SegmentId == pSource->AllocData.Addr.SegmentId); 417 427 418 NTSTATUS Status = vboxWddmGhDisplaySetInfo(pDevExt, pRealFbAlloc, pFbAlloc ? &pFbAlloc->AllocData : &pSource->AllocData, &pSource->VScreenPos );428 NTSTATUS Status = vboxWddmGhDisplaySetInfo(pDevExt, pRealFbAlloc, pFbAlloc ? &pFbAlloc->AllocData : &pSource->AllocData, &pSource->VScreenPos, pSource->u8SyncState); 419 429 if (NT_SUCCESS(Status)) 420 pSource-> fGhSynced = fGhSynced;430 pSource->u8SyncState = VBOXWDDM_HGSYNC_F_SYNCED_ALL; 421 431 else 422 432 WARN(("vboxWddmGhDisplaySetInfo failed, Status (0x%x)", Status)); … … 432 442 || !pDevExt->aTargets[pSource->AllocData.SurfDesc.VidPnSourceId].HeightVisible); 433 443 434 if (pSource-> fGhSynced)444 if (pSource->u8SyncState == VBOXWDDM_HGSYNC_F_SYNCED_ALL) 435 445 return false; 436 446 … … 475 485 476 486 /* ensure we issue resize command on next update */ 477 pSource-> fGhSynced = 0;487 pSource->u8SyncState &= ~VBOXWDDM_HGSYNC_F_SYNCED_LOCATION; 478 488 } 479 489 } … … 517 527 pContext->fRenderFromShadowDisabled = FALSE; 518 528 } 519 520 #ifdef VBOXWDDM_RENDER_FROM_SHADOW521 bool vboxWddmCheckUpdateFramebufferAddress(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_SOURCE pSource)522 {523 if (pSource->pPrimaryAllocation->enmType == VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC524 || pSource->pPrimaryAllocation->AllocData.hostID)525 {526 // Assert(pSource->fGhSynced == FALSE);527 return false;528 }529 530 return vboxWddmGhDisplayCheckSetInfoFromSource(pDevExt, pSource);531 }532 #endif533 529 534 530 PVBOXSHGSMI vboxWddmHgsmiGetHeapFromCmdOffset(PVBOXMP_DEVEXT pDevExt, HGSMIOFFSET offCmd) … … 2871 2867 { 2872 2868 /* this is a NOP, just return success */ 2873 WARN(("null data size, treating as NOP"));2869 // LOG(("null data size, treating as NOP")); 2874 2870 return STATUS_SUCCESS; 2875 2871 } … … 3004 3000 else if (pSubmitCommand->DmaBufferPrivateDataSubmissionEndOffset == pSubmitCommand->DmaBufferPrivateDataSubmissionStartOffset) 3005 3001 { 3006 WARN(("null data size, treating as NOP"));3007 3002 enmCmd = VBOXVDMACMD_TYPE_DMA_NOP; 3008 3003 } … … 3029 3024 BOOLEAN fShadowChanged = vboxWddmAddrSetVram(&pSrcAlloc->AllocData.Addr, pS2P->Shadow2Primary.ShadowAlloc.segmentIdAlloc, pS2P->Shadow2Primary.ShadowAlloc.offAlloc); 3030 3025 if (fShadowChanged) 3031 pSource-> fGhSynced = 0;3026 pSource->u8SyncState &= ~VBOXWDDM_HGSYNC_F_SYNCED_LOCATION; 3032 3027 vboxWddmAssignShadow(pDevExt, pSource, pSrcAlloc, pS2P->Shadow2Primary.VidPnSourceId); 3033 3028 vboxWddmModeRenderFromShadowCheckOnSubmitCommand(pDevExt, NULL); 3034 vboxWddm CheckUpdateFramebufferAddress(pDevExt, pSource);3029 vboxWddmGhDisplayCheckSetInfoFromSource(pDevExt, pSource); 3035 3030 if (pSrcAlloc->bVisible) 3036 3031 { … … 3056 3051 PVBOXWDDM_ALLOCATION pSrcAlloc = pBlt->Blt.SrcAlloc.pAlloc; 3057 3052 BOOLEAN fSrcChanged; 3058 3059 vboxWddmAddrSetVram(&pDstAlloc->AllocData.Addr, pBlt->Blt.DstAlloc.segmentIdAlloc, pBlt->Blt.DstAlloc.offAlloc); 3053 BOOLEAN fDstChanged; 3054 3055 fDstChanged = vboxWddmAddrSetVram(&pDstAlloc->AllocData.Addr, pBlt->Blt.DstAlloc.segmentIdAlloc, pBlt->Blt.DstAlloc.offAlloc); 3060 3056 fSrcChanged = vboxWddmAddrSetVram(&pSrcAlloc->AllocData.Addr, pBlt->Blt.SrcAlloc.segmentIdAlloc, pBlt->Blt.SrcAlloc.offAlloc); 3061 3057 3058 vboxWddmModeRenderFromShadowCheckOnSubmitCommand(pDevExt, NULL); 3059 3062 3060 if (VBOXWDDM_IS_REAL_FB_ALLOCATION(pDevExt, pDstAlloc)) 3063 3061 { 3064 3062 VBOXWDDM_SOURCE *pSource = &pDevExt->aSources[pDstAlloc->AllocData.SurfDesc.VidPnSourceId]; 3063 3065 3064 Assert(pDstAlloc->AllocData.SurfDesc.VidPnSourceId < VBOX_VIDEO_MAX_SCREENS); 3066 3067 if (pSrcAlloc->enmType == VBOXWDDM_ALLOC_TYPE_STD_SHADOWSURFACE) 3065 #if 0 3066 if (VBOXWDDM_IS_FB_ALLOCATION(pDevExt, pDstAlloc) && pDstAlloc->AllocData.hostID) 3067 { 3068 if (pSource->AllocData.hostID != pDstAlloc->AllocData.hostID) 3069 { 3070 pSource->AllocData.hostID = pDstAlloc->AllocData.hostID; 3071 fDstChanged = TRUE; 3072 } 3073 3074 if (fDstChanged) 3075 pSource->u8SyncState &= ~VBOXWDDM_HGSYNC_F_SYNCED_LOCATION; 3076 } 3077 else 3078 #endif 3079 if (pSrcAlloc->enmType == VBOXWDDM_ALLOC_TYPE_STD_SHADOWSURFACE) 3068 3080 { 3069 3081 if (fSrcChanged) 3070 pSource-> fGhSynced = 0;3082 pSource->u8SyncState &= ~VBOXWDDM_HGSYNC_F_SYNCED_LOCATION; 3071 3083 3072 3084 vboxWddmAssignShadow(pDevExt, pSource, pSrcAlloc, pDstAlloc->AllocData.SurfDesc.VidPnSourceId); 3073 } 3074 vboxWddmModeRenderFromShadowCheckOnSubmitCommand(pDevExt, NULL); 3075 if(pContext->enmType != VBOXWDDM_CONTEXT_TYPE_CUSTOM_3D 3076 || pDstAlloc->enmType !=VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC) 3077 vboxWddmCheckUpdateFramebufferAddress(pDevExt, pSource); 3078 } 3079 else 3080 vboxWddmModeRenderFromShadowCheckOnSubmitCommand(pDevExt, NULL); 3085 vboxWddmGhDisplayCheckSetInfoFromSource(pDevExt, pSource); 3086 } 3087 3088 Assert(pSource->u8SyncState == VBOXWDDM_HGSYNC_F_SYNCED_ALL); 3089 } 3081 3090 3082 3091 Status = vboxVdmaProcessBltCmd(pDevExt, pContext, pBlt); … … 3091 3100 { 3092 3101 VBOXWDDM_DMA_PRIVATEDATA_FLIP *pFlip = (VBOXWDDM_DMA_PRIVATEDATA_FLIP*)pPrivateDataBase; 3093 vboxWddmAddrSetVram(&pFlip->Flip.Alloc.pAlloc->AllocData.Addr, pFlip->Flip.Alloc.segmentIdAlloc, pFlip->Flip.Alloc.offAlloc);3094 3095 Status = vboxVdmaProcessFlipCmd(pDevExt, pContext, pFlip);3096 if (!NT_SUCCESS(Status))3097 WARN(("vboxVdmaProcessFlipCmd failed, Status 0x%x", Status));3102 PVBOXWDDM_ALLOCATION pAlloc = pFlip->Flip.Alloc.pAlloc; 3103 VBOXWDDM_SOURCE *pSource = &pDevExt->aSources[pAlloc->AllocData.SurfDesc.VidPnSourceId]; 3104 vboxWddmAddrSetVram(&pAlloc->AllocData.Addr, pFlip->Flip.Alloc.segmentIdAlloc, pFlip->Flip.Alloc.offAlloc); 3105 vboxWddmAssignPrimary(pDevExt, pSource, pAlloc, pAlloc->AllocData.SurfDesc.VidPnSourceId); 3106 vboxWddmGhDisplayCheckSetInfoFromSource(pDevExt, pSource); 3098 3107 3099 3108 Status = vboxVdmaDdiCmdFenceComplete(pDevExt, pContext->NodeOrdinal, pSubmitCommand->SubmissionFenceId, … … 3306 3315 } 3307 3316 /** @todo: add necessary bits */ 3317 WARN(("Impl!")); 3308 3318 break; 3309 3319 } … … 3352 3362 LOGF(("ENTER, context(0x%x)", hAdapter)); 3353 3363 3364 uint32_t cbCmdDma = 0; 3365 3354 3366 /* @todo: */ 3355 3367 switch (pBuildPagingBuffer->Operation) … … 3357 3369 case DXGK_OPERATION_TRANSFER: 3358 3370 { 3371 cbCmdDma = VBOXWDDM_DUMMY_DMABUFFER_SIZE; 3359 3372 #ifdef VBOX_WITH_VDMA 3360 3373 #if 0 … … 3507 3520 case DXGK_OPERATION_FILL: 3508 3521 { 3522 cbCmdDma = VBOXWDDM_DUMMY_DMABUFFER_SIZE; 3509 3523 Assert(pBuildPagingBuffer->Fill.FillPattern == 0); 3510 3524 PVBOXWDDM_ALLOCATION pAlloc = (PVBOXWDDM_ALLOCATION)pBuildPagingBuffer->Fill.hAllocation; … … 3519 3533 default: 3520 3534 { 3521 LOGREL(("unsupported op (%d)", pBuildPagingBuffer->Operation)); 3522 AssertBreakpoint(); 3535 WARN(("unsupported op (%d)", pBuildPagingBuffer->Operation)); 3523 3536 break; 3524 3537 } 3538 } 3539 3540 if (cbCmdDma) 3541 { 3542 pBuildPagingBuffer->pDmaBuffer = ((uint8_t*)pBuildPagingBuffer->pDmaBuffer) + cbCmdDma; 3525 3543 } 3526 3544 … … 4884 4902 4885 4903 PVBOXWDDM_SOURCE pSource = &pDevExt->aSources[pSetVidPnSourceAddress->VidPnSourceId]; 4886 Status= vboxWddmDisplaySettingsQueryPos(pDevExt, pSetVidPnSourceAddress->VidPnSourceId, &pSource->VScreenPos); 4904 POINT Pos; 4905 Status= vboxWddmDisplaySettingsQueryPos(pDevExt, pSetVidPnSourceAddress->VidPnSourceId, &Pos); 4887 4906 Assert(Status == STATUS_SUCCESS); 4907 if (NT_SUCCESS(Status)) 4908 { 4909 if (memcmp(&pSource->VScreenPos, &Pos, sizeof (Pos))) 4910 { 4911 pSource->VScreenPos = Pos; 4912 pSource->u8SyncState &= ~VBOXWDDM_HGSYNC_F_SYNCED_DIMENSIONS; 4913 } 4914 } 4915 4888 4916 Status = STATUS_SUCCESS; 4889 4917 … … 4930 4958 } 4931 4959 4932 pSource-> fGhSynced = 0; /* force guest->host notification */4960 pSource->u8SyncState &= ~VBOXWDDM_HGSYNC_F_SYNCED_LOCATION; 4933 4961 4934 4962 if (pSource->bVisible) … … 4961 4989 4962 4990 PVBOXWDDM_SOURCE pSource = &pDevExt->aSources[pSetVidPnSourceVisibility->VidPnSourceId]; 4963 Status= vboxWddmDisplaySettingsQueryPos(pDevExt, pSetVidPnSourceVisibility->VidPnSourceId, &pSource->VScreenPos); 4991 POINT Pos; 4992 Status= vboxWddmDisplaySettingsQueryPos(pDevExt, pSetVidPnSourceVisibility->VidPnSourceId, &Pos); 4964 4993 Assert(Status == STATUS_SUCCESS); 4994 if (NT_SUCCESS(Status)) 4995 { 4996 if (memcmp(&pSource->VScreenPos, &Pos, sizeof (Pos))) 4997 { 4998 pSource->VScreenPos = Pos; 4999 pSource->u8SyncState &= ~VBOXWDDM_HGSYNC_F_SYNCED_DIMENSIONS; 5000 } 5001 } 4965 5002 Status = STATUS_SUCCESS; 4966 5003 … … 5713 5750 if (pRender->DmaBufferPrivateDataSize < sizeof (VBOXWDDM_DMA_PRIVATEDATA_BASEHDR)) 5714 5751 { 5715 LOGREL(("Present->DmaBufferPrivateDataSize(%d) < sizeof VBOXWDDM_DMA_PRIVATEDATA_BASEHDR (%d)",5752 WARN(("Present->DmaBufferPrivateDataSize(%d) < sizeof VBOXWDDM_DMA_PRIVATEDATA_BASEHDR (%d)", 5716 5753 pRender->DmaBufferPrivateDataSize , sizeof (VBOXWDDM_DMA_PRIVATEDATA_BASEHDR))); 5717 5754 /* @todo: can this actually happen? what status to return? */ … … 5720 5757 if (pRender->CommandLength < sizeof (VBOXWDDM_DMA_PRIVATEDATA_BASEHDR)) 5721 5758 { 5722 Assert(0); 5723 LOGREL(("Present->DmaBufferPrivateDataSize(%d) < sizeof VBOXWDDM_DMA_PRIVATEDATA_BASEHDR (%d)", 5759 WARN(("Present->DmaBufferPrivateDataSize(%d) < sizeof VBOXWDDM_DMA_PRIVATEDATA_BASEHDR (%d)", 5724 5760 pRender->DmaBufferPrivateDataSize , sizeof (VBOXWDDM_DMA_PRIVATEDATA_BASEHDR))); 5725 5761 /* @todo: can this actually happen? what status to return? */ … … 5737 5773 5738 5774 pRender->pDmaBufferPrivateData = (uint8_t*)pRender->pDmaBufferPrivateData + sizeof (VBOXWDDM_DMA_PRIVATEDATA_BASEHDR); 5775 memset(pRender->pDmaBuffer, 0, pRender->CommandLength); 5739 5776 pRender->pDmaBuffer = ((uint8_t*)pRender->pDmaBuffer) + pRender->CommandLength; 5740 5777 Assert(pRender->DmaSize >= pRender->CommandLength); … … 5920 5957 } 5921 5958 5922 pBlt->Pos.x = pPresent->DstRect.left - pPresent->SrcRect.left;5923 pBlt->Pos.y = pPresent->DstRect.top - pPresent->SrcRect.top;5959 pBlt->Pos.x = (int16_t)(pPresent->DstRect.left - pPresent->SrcRect.left); 5960 pBlt->Pos.y = (int16_t)(pPresent->DstRect.top - pPresent->SrcRect.top); 5924 5961 5925 5962 paRects = pBlt->aRects; … … 5943 5980 u32DstPatch = RT_OFFSETOF(VBOXCMDVBVA_BLT_OFFPRIMSZFMT_OR_ID, dst.offVRAM); 5944 5981 5945 pBlt->Pos.x = pPresent->DstRect.left - pPresent->SrcRect.left;5946 pBlt->Pos.y = pPresent->DstRect.top - pPresent->SrcRect.top;5982 pBlt->Pos.x = (int16_t)(pPresent->DstRect.left - pPresent->SrcRect.left); 5983 pBlt->Pos.y = (int16_t)(pPresent->DstRect.top - pPresent->SrcRect.top); 5947 5984 5948 5985 paRects = pBlt->aRects; … … 6379 6416 for (int i = 0; i < VBoxCommonFromDeviceExt(pDevExt)->cDisplays; ++i) 6380 6417 { 6381 pDevExt->aSources[i]. fGhSynced= 0;6418 pDevExt->aSources[i].u8SyncState = 0; 6382 6419 NTSTATUS tmpStatus= vboxWddmDisplaySettingsQueryPos(pDevExt, i, &pDevExt->aSources[i].VScreenPos); 6383 6420 Assert(tmpStatus == STATUS_SUCCESS); -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.h
r49591 r50628 134 134 } 135 135 136 if (pSource->pShadowAllocation == pAllocation && pSource->fGhSynced > 0)136 if (pSource->pShadowAllocation == pAllocation) 137 137 { 138 138 Assert(pAllocation->bAssigned); … … 162 162 163 163 if(!vboxWddmAddrVramEqual(&pSource->AllocData.Addr, &pAllocation->AllocData.Addr)) 164 pSource->fGhSynced = 0; /* force guest->host notification */ 165 pSource->AllocData.Addr = pAllocation->AllocData.Addr; 166 } 164 { 165 pSource->u8SyncState &= ~VBOXWDDM_HGSYNC_F_SYNCED_LOCATION; /* force guest->host notification */ 166 pSource->AllocData.Addr = pAllocation->AllocData.Addr; 167 } 168 if (pSource->AllocData.hostID != pAllocation->AllocData.hostID) 169 { 170 pSource->u8SyncState &= ~VBOXWDDM_HGSYNC_F_SYNCED_LOCATION; /* force guest->host notification */ 171 pSource->AllocData.hostID = pAllocation->AllocData.hostID; 172 } 173 } 174 else 175 pSource->u8SyncState &= ~VBOXWDDM_HGSYNC_F_SYNCED_LOCATION; /* force guest->host notification */ 167 176 168 177 pSource->pShadowAllocation = pAllocation; 169 170 Assert(!pSource->AllocData.pSwapchain);171 Assert(!pSource->AllocData.hostID);172 178 } 173 179 #endif … … 197 203 198 204 if(!vboxWddmAddrVramEqual(&pSource->AllocData.Addr, &pAllocation->AllocData.Addr)) 199 pSource->fGhSynced = 0; /* force guest->host notification */ 200 pSource->AllocData.Addr = pAllocation->AllocData.Addr; 205 { 206 pSource->u8SyncState &= ~VBOXWDDM_HGSYNC_F_SYNCED_LOCATION; /* force guest->host notification */ 207 pSource->AllocData.Addr = pAllocation->AllocData.Addr; 208 } 209 if (pSource->AllocData.hostID != pAllocation->AllocData.hostID) 210 { 211 pSource->u8SyncState &= ~VBOXWDDM_HGSYNC_F_SYNCED_LOCATION; /* force guest->host notification */ 212 pSource->AllocData.hostID = pAllocation->AllocData.hostID; 213 } 201 214 202 215 vboxWddmAllocationRetain(pAllocation); 203 216 } 217 else 218 pSource->u8SyncState &= ~VBOXWDDM_HGSYNC_F_SYNCED_LOCATION; /* force guest->host notification */ 204 219 205 220 KIRQL OldIrql; … … 207 222 pSource->pPrimaryAllocation = pAllocation; 208 223 KeReleaseSpinLock(&pSource->AllocationLock, OldIrql); 209 210 Assert(!pSource->AllocData.pSwapchain);211 Assert(!pSource->AllocData.hostID);212 224 } 213 225
Note:
See TracChangeset
for help on using the changeset viewer.