- Timestamp:
- Apr 16, 2018 12:49:15 PM (7 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Video
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Video/common/wddm/VBoxMPIf.h
r71167 r71862 33 33 34 34 /* One would increase this whenever definitions in this file are changed */ 35 #define VBOXVIDEOIF_VERSION 20 35 #define VBOXVIDEOIF_VERSION 21 36 37 /** @todo VBOXVIDEO_HWTYPE probably needs to be in VBoxVideo.h */ 38 typedef enum VBOXVIDEO_HWTYPE 39 { 40 VBOXVIDEO_HWTYPE_CROGL = 0, 41 VBOXVIDEO_HWTYPE_VMSVGA = 1, 42 VBOXVIDEO_HWTYPE_32BIT = 0x7fffffff 43 } VBOXVIDEO_HWTYPE; 44 AssertCompileSize(VBOXVIDEO_HWTYPE, 4); 36 45 37 46 #define VBOXWDDM_NODE_ID_SYSTEM 0 … … 491 500 } VBOXDISPIFESCAPE_CRHGSMICTLCON_CALL, *PVBOXDISPIFESCAPE_CRHGSMICTLCON_CALL; 492 501 493 /* query info func */ 494 typedef struct VBOXWDDM_QI 495 { 496 uint32_t u32Version; 497 uint32_t u32VBox3DCaps; 498 uint32_t cInfos; 499 VBOXVHWA_INFO aInfos[VBOX_VIDEO_MAX_SCREENS]; 500 } VBOXWDDM_QI; 502 503 /* D3DDDICB_QUERYADAPTERINFO::pPrivateDriverData */ 504 typedef struct VBOXWDDM_QAI 505 { 506 uint32_t u32Version; /* VBOXVIDEOIF_VERSION */ 507 uint32_t u32Reserved; /* Must be 0. */ 508 VBOXVIDEO_HWTYPE enmHwType; /* Hardware type. Determines what kind of data is returned. */ 509 uint32_t cInfos; /* Number of initialized elements in aInfos (equal to number of guest 510 * displays). 0 if VBOX_WITH_VIDEOHWACCEL is not defined. */ 511 VBOXVHWA_INFO aInfos[VBOX_VIDEO_MAX_SCREENS]; /* cInfos elements are initialized. */ 512 union 513 { 514 struct 515 { 516 /* VBOXVIDEO_HWTYPE_CROGL */ 517 uint32_t u32VBox3DCaps; /* CR_VBOX_CAP_* */ 518 } crogl; 519 } u; 520 } VBOXWDDM_QAI; 501 521 502 522 /** Convert a given FourCC code to a D3DDDIFORMAT enum. */ -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3D.cpp
r71329 r71862 6646 6646 LOGREL(("Built %s %s", __DATE__, __TIME__)); 6647 6647 6648 VBOXWDDM_Q I Query;6648 VBOXWDDM_QAI Query; 6649 6649 D3DDDICB_QUERYADAPTERINFO DdiQuery; 6650 6650 DdiQuery.PrivateDriverDataSize = sizeof(Query); … … 6673 6673 PVBOXWDDMDISP_ADAPTER pAdapter = (PVBOXWDDMDISP_ADAPTER)RTMemAllocZ(RT_OFFSETOF(VBOXWDDMDISP_ADAPTER, aHeads[Query.cInfos])); 6674 6674 #else 6675 PVBOXWDDMDISP_ADAPTER pAdapter = (PVBOXWDDMDISP_ADAPTER)RTMemAllocZ(sizeof (VBOXWDDMDISP_ADAPTER)); 6675 Assert(Query.cInfos == 0); 6676 PVBOXWDDMDISP_ADAPTER pAdapter = (PVBOXWDDMDISP_ADAPTER)RTMemAllocZ(sizeof(VBOXWDDMDISP_ADAPTER)); 6676 6677 #endif 6677 6678 Assert(pAdapter); … … 6683 6684 pAdapter->RtCallbacks = *pOpenData->pAdapterCallbacks; 6684 6685 6685 pAdapter->u32VBox3DCaps = Query.u32VBox3DCaps; 6686 6686 pAdapter->enmHwType = Query.enmHwType; 6687 6688 if (Query.enmHwType == VBOXVIDEO_HWTYPE_CROGL) 6689 pAdapter->u32VBox3DCaps = Query.u.crogl.u32VBox3DCaps; 6690 6691 #ifdef VBOX_WITH_VIDEOHWACCEL 6687 6692 pAdapter->cHeads = Query.cInfos; 6693 #endif 6688 6694 6689 6695 pOpenData->hAdapter = pAdapter; -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3D.h
r70052 r71862 76 76 UINT uRtVersion; 77 77 D3DDDI_ADAPTERCALLBACKS RtCallbacks; 78 79 VBOXVIDEO_HWTYPE enmHwType; /* VBOXVIDEO_HWTYPE* */ 80 78 81 VBOXWDDMDISP_D3D D3D; 79 82 VBOXWDDMDISP_FORMATS Formats; -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxUhgsmiKmt.cpp
r69500 r71862 309 309 static HRESULT vboxUhgsmiKmtQueryCaps(PVBOXUHGSMI_PRIVATE_KMT pHgsmi, uint32_t *pu32Caps) 310 310 { 311 VBOXWDDM_Q I Query;311 VBOXWDDM_QAI Query; 312 312 D3DKMT_QUERYADAPTERINFO Info; 313 313 Info.hAdapter = pHgsmi->Adapter.hAdapter; … … 329 329 } 330 330 331 *pu32Caps = Query.u32VBox3DCaps; 331 if (Query.enmHwType == VBOXVIDEO_HWTYPE_CROGL) 332 *pu32Caps = Query.u.crogl.u32VBox3DCaps; 333 else 334 *pu32Caps = 0; 332 335 333 336 return S_OK; -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/common/VBoxMPDevExt.h
r71511 r71862 34 34 # include "wddm/VBoxMPTypes.h" 35 35 #endif 36 37 typedef enum VBOX_HWTYPE38 {39 VBOX_HWTYPE_CROGL = 0,40 VBOX_HWTYPE_VMSVGA = 141 } VBOX_HWTYPE;42 36 43 37 #ifdef VBOX_WDDM_MINIPORT … … 218 212 HGSMIAREA areaDisplay; /* Entire VRAM chunk for this display device. */ 219 213 220 VBOX_HWTYPE enmHwType; 221 #ifdef VBOX_WDDM_MINIPORT 214 #ifdef VBOX_WDDM_MINIPORT 215 VBOXVIDEO_HWTYPE enmHwType; 222 216 VBOXWDDM_HWRESOURCES HwResources; 223 217 #endif -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVdma.cpp
r71658 r71862 1182 1182 static NTSTATUS vboxVdmaCrCtlGetDefaultClientId(PVBOXMP_DEVEXT pDevExt, uint32_t *pu32ClienID) 1183 1183 { 1184 if (pDevExt->enmHwType != VBOX _HWTYPE_CROGL)1184 if (pDevExt->enmHwType != VBOXVIDEO_HWTYPE_CROGL) 1185 1185 { 1186 1186 /* Should not be called at all in this case. */ … … 1336 1336 NTSTATUS vboxVdmaTexPresentSetAlloc(PVBOXMP_DEVEXT pDevExt, const VBOXWDDM_ALLOC_DATA *pAllocData) 1337 1337 { 1338 if (pDevExt->enmHwType != VBOX _HWTYPE_CROGL)1338 if (pDevExt->enmHwType != VBOXVIDEO_HWTYPE_CROGL) 1339 1339 { 1340 1340 /* Not used in this case. */ -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp
r71658 r71862 816 816 } 817 817 818 pDevExt->enmHwType = u32 ? VBOX _HWTYPE_VMSVGA : VBOX_HWTYPE_CROGL;819 820 if (pDevExt->enmHwType == VBOX _HWTYPE_CROGL)818 pDevExt->enmHwType = u32 ? VBOXVIDEO_HWTYPE_VMSVGA : VBOXVIDEO_HWTYPE_CROGL; 819 820 if (pDevExt->enmHwType == VBOXVIDEO_HWTYPE_CROGL) 821 821 { 822 822 pDevExt->f3DEnabled = VBoxMpCrCtlConIs3DSupported(); … … 1149 1149 { 1150 1150 #ifdef VBOX_WITH_CROGL 1151 if (pDevExt->enmHwType == VBOX _HWTYPE_CROGL)1151 if (pDevExt->enmHwType == VBOXVIDEO_HWTYPE_CROGL) 1152 1152 { 1153 1153 if (pDevExt->f3DEnabled) … … 1377 1377 1378 1378 #ifdef VBOX_WITH_CROGL 1379 if (pDevExt->enmHwType == VBOX _HWTYPE_CROGL && pDevExt->u32CrConDefaultClientID)1379 if (pDevExt->enmHwType == VBOXVIDEO_HWTYPE_CROGL && pDevExt->u32CrConDefaultClientID) 1380 1380 VBoxMpCrCtlConDisconnect(pDevExt, &pDevExt->CrCtlCon, pDevExt->u32CrConDefaultClientID); 1381 1381 … … 2330 2330 if (!g_VBoxDisplayOnly) 2331 2331 { 2332 if (pQueryAdapterInfo->OutputDataSize == sizeof (VBOXWDDM_QI)) 2333 { 2334 VBOXWDDM_QI * pQi = (VBOXWDDM_QI*)pQueryAdapterInfo->pOutputData; 2335 memset (pQi, 0, sizeof (VBOXWDDM_QI)); 2336 pQi->u32Version = VBOXVIDEOIF_VERSION; 2337 if (pDevExt->enmHwType == VBOX_HWTYPE_CROGL) 2332 if (pQueryAdapterInfo->OutputDataSize >= sizeof(VBOXWDDM_QAI)) 2333 { 2334 VBOXWDDM_QAI *pQAI = (VBOXWDDM_QAI *)pQueryAdapterInfo->pOutputData; 2335 memset(pQAI, 0, sizeof(VBOXWDDM_QAI)); 2336 2337 pQAI->u32Version = VBOXVIDEOIF_VERSION; 2338 pQAI->enmHwType = pDevExt->enmHwType; 2339 if (pDevExt->enmHwType == VBOXVIDEO_HWTYPE_CROGL) 2338 2340 { 2339 2341 #ifdef VBOX_WITH_CROGL 2340 pQ i->u32VBox3DCaps = VBoxMpCrGetHostCaps();2342 pQAI->u.crogl.u32VBox3DCaps = VBoxMpCrGetHostCaps(); 2341 2343 #endif 2342 2344 } 2343 else2344 pQi->u32VBox3DCaps = 0;2345 pQi->cInfos = VBoxCommonFromDeviceExt(pDevExt)->cDisplays;2346 2345 #ifdef VBOX_WITH_VIDEOHWACCEL 2347 for (int i = 0; i < VBoxCommonFromDeviceExt(pDevExt)->cDisplays; ++i) 2346 pQAI->cInfos = VBoxCommonFromDeviceExt(pDevExt)->cDisplays; 2347 for (uint32_t i = 0; i < pQAI->cInfos; ++i) 2348 2348 { 2349 pQ i->aInfos[i] = pDevExt->aSources[i].Vhwa.Settings;2349 pQAI->aInfos[i] = pDevExt->aSources[i].Vhwa.Settings; 2350 2350 } 2351 2351 #endif … … 2353 2353 else 2354 2354 { 2355 WARN(("incorrect buffer size %d, expected %d", pQueryAdapterInfo->OutputDataSize, sizeof (VBOXWDDM_QI)));2355 WARN(("incorrect buffer size %d, expected %d", pQueryAdapterInfo->OutputDataSize, sizeof(VBOXWDDM_QAI))); 2356 2356 Status = STATUS_BUFFER_TOO_SMALL; 2357 2357 } … … 2854 2854 /* wait for all current allocation-related ops are completed */ 2855 2855 vboxWddmAllocationCleanup(pDevExt, pAlloc); 2856 if (pDevExt->enmHwType == VBOX _HWTYPE_CROGL && pAlloc->hSharedHandle && pAlloc->AllocData.hostID)2856 if (pDevExt->enmHwType == VBOXVIDEO_HWTYPE_CROGL && pAlloc->hSharedHandle && pAlloc->AllocData.hostID) 2857 2857 VBoxVdmaChromiumParameteriCRSubmit(pDevExt, GL_PIN_TEXTURE_CLEAR_CR, pAlloc->AllocData.hostID); 2858 2858 vboxWddmAllocationDestroy(pAlloc); … … 4560 4560 if (pEscape->PrivateDriverDataSize == sizeof (*pEscapeHdr)) 4561 4561 { 4562 if (pDevExt->enmHwType == VBOX _HWTYPE_CROGL)4562 if (pDevExt->enmHwType == VBOXVIDEO_HWTYPE_CROGL) 4563 4563 pEscapeHdr->u32CmdSpecific = VBoxMpCrGetHostCaps(); 4564 4564 else … … 6899 6899 } 6900 6900 6901 if (pDevExt->enmHwType == VBOX _HWTYPE_CROGL)6901 if (pDevExt->enmHwType == VBOXVIDEO_HWTYPE_CROGL) 6902 6902 { 6903 6903 #ifdef VBOX_WITH_CROGL … … 6950 6950 if (pDevExt->f3DEnabled) 6951 6951 { 6952 if (pDevExt->enmHwType == VBOX _HWTYPE_CROGL)6952 if (pDevExt->enmHwType == VBOXVIDEO_HWTYPE_CROGL) 6953 6953 { 6954 6954 int rc = VBoxMpCrCtlConConnect(pDevExt, &pDevExt->CrCtlCon, … … 7005 7005 if (pDevExt->f3DEnabled) 7006 7006 { 7007 if (pDevExt->enmHwType == VBOX _HWTYPE_CROGL)7007 if (pDevExt->enmHwType == VBOXVIDEO_HWTYPE_CROGL) 7008 7008 { 7009 7009 int rc = VBoxMpCrCtlConConnect(pDevExt, &pDevExt->CrCtlCon, … … 7145 7145 7146 7146 #ifdef VBOX_WITH_CROGL 7147 if (pDevExt->enmHwType == VBOX _HWTYPE_CROGL && pContext->u32CrConClientID)7147 if (pDevExt->enmHwType == VBOXVIDEO_HWTYPE_CROGL && pContext->u32CrConClientID) 7148 7148 { 7149 7149 VBoxMpCrCtlConDisconnect(pDevExt, &pDevExt->CrCtlCon, pContext->u32CrConClientID); … … 7317 7317 if (bUpdateRectInited && pSource->bVisible) 7318 7318 { 7319 VBOXVBVA_OP_WITHLOCK(ReportDirtyRect, pDevExt, pSource, &UpdateRect); 7319 if (pDevExt->enmHwType == VBOXVIDEO_HWTYPE_CROGL) 7320 VBOXVBVA_OP_WITHLOCK(ReportDirtyRect, pDevExt, pSource, &UpdateRect); 7320 7321 } 7321 7322 … … 7657 7658 7658 7659 /* Check whether 3D is provided by the host. */ 7659 VBOX _HWTYPE enmHwType = VBOX_HWTYPE_CROGL;7660 VBOXVIDEO_HWTYPE enmHwType = VBOXVIDEO_HWTYPE_CROGL; 7660 7661 BOOL f3DSupported = FALSE; 7661 7662 … … 7675 7676 if (u32) 7676 7677 { 7677 enmHwType = VBOX _HWTYPE_VMSVGA;7678 enmHwType = VBOXVIDEO_HWTYPE_VMSVGA; 7678 7679 } 7679 7680 } 7680 7681 7681 7682 BOOL fCmdVbva = FALSE; 7682 if (enmHwType == VBOX _HWTYPE_CROGL)7683 if (enmHwType == VBOXVIDEO_HWTYPE_CROGL) 7683 7684 { 7684 7685 /* Try to establish connection to the host 3D service. */ … … 7693 7694 #endif 7694 7695 } 7695 else if (enmHwType == VBOX _HWTYPE_VMSVGA)7696 else if (enmHwType == VBOXVIDEO_HWTYPE_VMSVGA) 7696 7697 { 7697 7698 fCmdVbva = TRUE;
Note:
See TracChangeset
for help on using the changeset viewer.