Changeset 29488 in vbox for trunk/src/VBox/Additions/WINNT/Graphics
- Timestamp:
- May 14, 2010 5:05:43 PM (15 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Display/Makefile.kmk
r29432 r29488 77 77 VBoxDispD3D_TEMPLATE = VBOXGUESTR3DLL 78 78 VBoxDispD3D_DEFS = UNICODE _UNICODE 79 ifdef VBOX_WITH_VIDEOHWACCEL 80 VBoxDispD3D_DEFS += VBOX_WITH_VIDEOHWACCEL 81 endif 79 82 VBoxDispD3D_SOURCES = \ 80 83 wddm/VBoxDispD3D.cpp \ -
trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.cpp
r29452 r29488 30 30 #include "VBoxDispD3D.h" 31 31 #include "VBoxDispD3DCmn.h" 32 #include "../../Miniport/wddm/VBoxVideoIf.h" 32 33 33 34 #ifdef VBOXWDDMDISP_DEBUG … … 73 74 74 75 HRESULT hr = S_OK; 76 PVBOXWDDMDISP_ADAPTER pAdapter = (PVBOXWDDMDISP_ADAPTER)hAdapter; 75 77 76 78 switch (pData->Type) 77 79 { 78 80 case D3DDDICAPS_DDRAW: 81 { 82 AssertBreakpoint(); 79 83 Assert(pData->DataSize >= sizeof (DDRAW_CAPS)); 80 84 if (pData->DataSize >= sizeof (DDRAW_CAPS)) 85 { 81 86 memset(pData->pData, 0, sizeof (DDRAW_CAPS)); 87 #ifdef VBOX_WITH_VIDEOHWACCEL 88 VBOXWDDM_QI_2D_1 Query; 89 Query.hdr.enmType = VBOXWDDM_QI_TYPE_2D_1; 90 VBOXVHWA_VERSION_INIT(&Query.Info.u.in.guestVersion); 91 D3DDDICB_QUERYADAPTERINFO DdiQuery; 92 DdiQuery.PrivateDriverDataSize = sizeof(Query); 93 DdiQuery.pPrivateDriverData = &Query; 94 hr = pAdapter->RtCallbacks.pfnQueryAdapterInfoCb(pAdapter->hAdapter, &DdiQuery); 95 Assert(hr == S_OK); 96 if (hr == S_OK) 97 { 98 if (Query.hdr.rc == VINF_SUCCESS) 99 { 100 /* query succeeded, check the results */ 101 if (Query.Info.u.out.cfgFlags == VBOXVHWA_CFG_ENABLED) 102 { 103 /* 2D is enabled*/ 104 DDRAW_CAPS *pCaps = (DDRAW_CAPS*)pData->pData; 105 /* overlay supported */ 106 if (Query.Info.u.out.surfaceCaps & VBOXVHWA_SCAPS_OVERLAY) 107 { 108 if (Query.Info.u.out.caps & VBOXVHWA_CAPS_COLORKEY) 109 { 110 pCaps->Caps = DDRAW_CAPS_COLORKEY; 111 } 112 } 113 114 /* @todo: feel the caps from here */ 115 } 116 } 117 } 118 #endif 119 } 82 120 else 83 121 hr = E_INVALIDARG; 84 122 break; 123 } 85 124 case D3DDDICAPS_DDRAW_MODE_SPECIFIC: 125 { 126 AssertBreakpoint(); 86 127 Assert(pData->DataSize >= sizeof (DDRAW_MODE_SPECIFIC_CAPS)); 87 128 if (pData->DataSize >= sizeof (DDRAW_MODE_SPECIFIC_CAPS)) 88 memset(pData->pData, 0, sizeof (DDRAW_MODE_SPECIFIC_CAPS)); 129 { 130 DDRAW_MODE_SPECIFIC_CAPS * pCaps = (DDRAW_MODE_SPECIFIC_CAPS*)pData->pData; 131 memset(&pCaps->Caps /* do not cleanup the first "Head" field, 132 zero starting with the one following "Head", i.e. Caps */, 133 0, sizeof (DDRAW_MODE_SPECIFIC_CAPS) - RT_OFFSETOF(DDRAW_MODE_SPECIFIC_CAPS, Caps)); 134 #ifdef VBOX_WITH_VIDEOHWACCEL 135 VBOXWDDM_QI_2D_1 Query; 136 Query.hdr.enmType = VBOXWDDM_QI_TYPE_2D_1; 137 VBOXVHWA_VERSION_INIT(&Query.Info.u.in.guestVersion); 138 D3DDDICB_QUERYADAPTERINFO DdiQuery; 139 DdiQuery.PrivateDriverDataSize = sizeof(Query); 140 DdiQuery.pPrivateDriverData = &Query; 141 hr = pAdapter->RtCallbacks.pfnQueryAdapterInfoCb(pAdapter->hAdapter, &DdiQuery); 142 Assert(hr == S_OK); 143 if (hr == S_OK) 144 { 145 if (Query.hdr.rc == VINF_SUCCESS) 146 { 147 /* query succeeded, check the results */ 148 if (Query.Info.u.out.cfgFlags == VBOXVHWA_CFG_ENABLED) 149 { 150 /* 2D is enabled*/ 151 if (Query.Info.u.out.surfaceCaps & VBOXVHWA_SCAPS_OVERLAY) 152 { 153 /* overlay supported */ 154 pCaps->Caps = MODE_CAPS_OVERLAY | MODE_CAPS_OVERLAYSTRETCH; 155 if (Query.Info.u.out.caps & VBOXVHWA_CAPS_COLORKEY) 156 { 157 if (Query.Info.u.out.colorKeyCaps & VBOXVHWA_CKEYCAPS_DESTOVERLAY) 158 { 159 pCaps->CKeyCaps |= MODE_CKEYCAPS_DESTOVERLAY 160 | MODE_CKEYCAPS_DESTOVERLAYYUV /* ?? */; 161 } 162 } 163 164 pCaps->FxCaps = MODE_FXCAPS_OVERLAYSHRINKX 165 | MODE_FXCAPS_OVERLAYSHRINKY 166 | MODE_FXCAPS_OVERLAYSTRETCHX 167 | MODE_FXCAPS_OVERLAYSTRETCHY; 168 169 pCaps->MaxVisibleOverlays = Query.Info.u.out.numOverlays; 170 pCaps->MinOverlayStretch = 1; 171 pCaps->MaxOverlayStretch = 32000; 172 } 173 } 174 } 175 } 176 #endif 177 } 89 178 else 90 179 hr = E_INVALIDARG; 91 180 break; 181 } 92 182 case D3DDDICAPS_GETFORMATCOUNT: 93 183 *((uint32_t*)pData->pData) = 0; … … 114 204 break; 115 205 case D3DDDICAPS_GETD3D9CAPS: 206 { 116 207 Assert(pData->DataSize >= sizeof (D3DCAPS9)); 117 208 if (pData->DataSize >= sizeof (D3DCAPS9)) 209 { 210 if (pAdapter->pD3D9If) 211 { 212 hr = pAdapter->pD3D9If->GetDeviceCaps(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, (D3DCAPS9*)pData->pData); 213 Assert(hr == S_OK); 214 if (hr == S_OK) 215 break; 216 217 vboxVDbgPrintR((__FUNCTION__": GetDeviceCaps hr(%d)\n", hr)); 218 /* let's fall back to the 3D disabled case */ 219 hr = S_OK; 220 } 221 118 222 memset(pData->pData, 0, sizeof (D3DCAPS9)); 223 } 119 224 else 120 225 hr = E_INVALIDARG; 121 226 break; 227 } 122 228 case D3DDDICAPS_GETGAMMARAMPCAPS: 123 229 *((uint32_t*)pData->pData) = 0; -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.h
r28800 r29488 115 115 #else 116 116 #include <VBox/VBoxVideo.h> 117 #include "wddm/VBoxVideoIf.h" 117 118 #include "wddm/VBoxVideoWddm.h" 118 119 #include "wddm/VBoxVideoShgsmi.h" -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp
r28800 r29488 1280 1280 } 1281 1281 case DXGKQAITYPE_UMDRIVERPRIVATE: 1282 drprintf((__FUNCTION__ ": we do not support DXGKQAITYPE_UMDRIVERPRIVATE\n"));1283 1282 AssertBreakpoint(); 1284 Status = STATUS_NOT_SUPPORTED; 1283 Assert(pQueryAdapterInfo->InputDataSize > sizeof (VBOXWDDM_QI)); 1284 if (pQueryAdapterInfo->InputDataSize > sizeof (VBOXWDDM_QI) 1285 && pQueryAdapterInfo->OutputDataSize > sizeof (VBOXWDDM_QI)) 1286 { 1287 VBOXWDDM_QI * pQi = (VBOXWDDM_QI*)pQueryAdapterInfo->pInputData; 1288 switch (pQi->enmType) 1289 { 1290 #ifdef VBOX_WITH_VIDEOHWACCEL 1291 case VBOXWDDM_QI_TYPE_2D_1: 1292 { 1293 if (pQueryAdapterInfo->InputDataSize >= sizeof (VBOXWDDM_QI_2D_1) 1294 && pQueryAdapterInfo->OutputDataSize >= sizeof (VBOXWDDM_QI_2D_1)) 1295 { 1296 VBOXWDDM_QI_2D_1 * pQueryIn = (VBOXWDDM_QI_2D_1*)pQueryAdapterInfo->pInputData; 1297 VBOXWDDM_QI_2D_1 * pQueryOut = (VBOXWDDM_QI_2D_1*)pQueryAdapterInfo->pOutputData; 1298 /* @todo: submit to the host */ 1299 #if 0 1300 VBOXVHWACMD *pCmd = create-cmd; 1301 VBOXVHWACMD_QUERYINFO1 *pQueryCmd = VBOXVHWACMD_BODY(pCmd, VBOXVHWACMD_QUERYINFO1); 1302 pQueryCmd->u.in.guestVersion = pQueryIn->Info.in.guestVersion; 1303 int rc = submit-cmd; 1304 pQueryOut->hdr.rc = rc; 1305 if (RT_SUCCESS(rc)) 1306 { 1307 memcpy(&pQueryOut->Info, pQueryCmd, sizeof(VBOXVHWACMD_QUERYINFO1)); 1308 } 1309 #else 1310 pQueryOut->hdr.rc = VERR_NOT_SUPPORTED; 1311 #endif 1312 } 1313 else 1314 { 1315 drprintf((__FUNCTION__ ": in or out buffer for VBOXWDDM_QI_TYPE_2D_1 too small\n")); 1316 Status = STATUS_BUFFER_TOO_SMALL; 1317 } 1318 break; 1319 } 1320 case VBOXWDDM_QI_TYPE_2D_2: 1321 { 1322 /* @todo: submit to the host */ 1323 break; 1324 } 1325 #endif 1326 default: 1327 drprintf((__FUNCTION__ ": unsupported qi (%d)\n", pQi->enmType)); 1328 AssertBreakpoint(); 1329 Status = STATUS_INVALID_PARAMETER; 1330 } 1331 } 1332 else 1333 { 1334 drprintf((__FUNCTION__ ": in or out buffer too small\n")); 1335 Status = STATUS_BUFFER_TOO_SMALL; 1336 } 1285 1337 break; 1286 1338 default: … … 1790 1842 dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", hAdapter)); 1791 1843 1792 vboxVDbgBreakF ();1844 vboxVDbgBreakFv(); 1793 1845 1794 1846 /* Value == 2 is Present … … 1897 1949 // dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", hAdapter)); 1898 1950 1899 vboxVDbgBreakF ();1951 vboxVDbgBreakFv(); 1900 1952 1901 1953 PDEVICE_EXTENSION pDevExt = (PDEVICE_EXTENSION)hAdapter; … … 3752 3804 PAGED_CODE(); 3753 3805 3754 AssertBreakpoint();3806 vboxVDbgBreakFv(); 3755 3807 3756 3808 drprintf(("VBoxVideoWddm::DriverEntry. Built %s %s\n", __DATE__, __TIME__)); -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.h
r28800 r29488 34 34 PVOID vboxWddmMemAllocZero(IN SIZE_T cbSize); 35 35 VOID vboxWddmMemFree(PVOID pvMem); 36 37 typedef enum38 {39 VBOXWDDM_ALLOC_TYPE_UNEFINED = 0,40 VBOXWDDM_ALLOC_TYPE_STD_SHAREDPRIMARYSURFACE,41 VBOXWDDM_ALLOC_TYPE_STD_SHADOWSURFACE,42 VBOXWDDM_ALLOC_TYPE_STD_STAGINGSURFACE,43 /* this one is win 7-specific and hence unused for now */44 VBOXWDDM_ALLOC_TYPE_STD_GDISURFACE45 /* custom allocation types requested from user-mode d3d module will go here */46 } VBOXWDDM_ALLOC_TYPE;47 48 typedef struct VBOXWDDM_SURFACE_DESC49 {50 UINT width;51 UINT height;52 D3DDDIFORMAT format;53 UINT bpp;54 UINT pitch;55 } VBOXWDDM_SURFACE_DESC, *PVBOXWDDM_SURFACE_DESC;56 57 typedef struct VBOXWDDM_ALLOCINFO58 {59 VBOXWDDM_ALLOC_TYPE enmType;60 union61 {62 VBOXWDDM_SURFACE_DESC SurfInfo;63 } u;64 } VBOXWDDM_ALLOCINFO, *PVBOXWDDM_ALLOCINFO;65 66 #define VBOXWDDM_ALLOCINFO_HEADSIZE() (sizeof (VBOXWDDM_ALLOCINFO))67 #define VBOXWDDM_ALLOCINFO_SIZE_FROMBODYSIZE(_s) (VBOXWDDM_ALLOCINFO_HEADSIZE() + (_s))68 #define VBOXWDDM_ALLOCINFO_SIZE(_tCmd) (VBOXWDDM_ALLOCINFO_SIZE_FROMBODYSIZE(sizeof(_tCmd)))69 #define VBOXWDDM_ALLOCINFO_BODY(_p, _t) ( (_t*)(((uint8_t*)(_p)) + VBOXWDDM_ALLOCINFO_HEADSIZE()) )70 #define VBOXWDDM_ALLOCINFO_HEAD(_pb) ((VBOXWDDM_ALLOCINFO*)((uint8_t *)(_pb) - VBOXWDDM_ALLOCATION_HEADSIZE()))71 72 36 73 37 typedef struct VBOXWDDM_ALLOCINFO_SHAREDPRIMARYSURFACE
Note:
See TracChangeset
for help on using the changeset viewer.