Changeset 27955 in vbox for trunk/src/VBox/Additions/WINNT/Graphics
- Timestamp:
- Apr 2, 2010 9:12:26 AM (15 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Miniport
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.cpp
r27887 r27955 1231 1231 1232 1232 #ifdef VBOXWDDM 1233 static bool g_bModesTableInitialized = false; 1233 1234 /** 1234 1235 * Helper function to dynamically build our table of standard video … … 1241 1242 D3DKMDT_2DREGION **ppResolutions, uint32_t * pcResolutions) 1242 1243 { 1243 static bool bTableInitialized = false; 1244 if(bRebuildTable || !bTableInitialized) 1244 if(bRebuildTable || !g_bModesTableInitialized) 1245 1245 { 1246 1246 VBoxBuildModesTable(DeviceExtension); 1247 bTableInitialized = true;1247 g_bModesTableInitialized = true; 1248 1248 } 1249 1249 … … 1253 1253 *ppResolutions = g_VBoxWddmVideoResolutions; 1254 1254 *pcResolutions = g_VBoxWddmNumResolutions; 1255 } 1256 1257 VOID VBoxWddmInvalidateModesTable(PDEVICE_EXTENSION DeviceExtension) 1258 { 1259 g_bModesTableInitialized = false; 1255 1260 } 1256 1261 -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.h
r27606 r27955 587 587 D3DKMDT_2DREGION **ppResolutions, uint32_t * pcResolutions); 588 588 589 VOID VBoxWddmInvalidateModesTable(PDEVICE_EXTENSION DeviceExtension); 590 589 591 D3DDDIFORMAT vboxWddmCalcPixelFormat(VIDEO_MODE_INFORMATION *pInfo); 590 592 UINT vboxWddmCalcBitsPerPixel(D3DDDIFORMAT format); -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp
r27641 r27955 20 20 #include <VBox/VBoxGuestLib.h> 21 21 #include <VBox/VBoxVideo.h> 22 #include <wingdi.h> /* needed for RGNDATA definition */ 23 #include <VBoxDisplay.h> /* this is from Additions/WINNT/include/ to include escape codes */ 22 24 23 25 #define VBOXWDDM_MEMTAG 'MDBV' … … 2166 2168 dfprintf(("==> "__FUNCTION__ ", hAdapter(0x%x)\n", hAdapter)); 2167 2169 2168 AssertBreakpoint(); 2170 NTSTATUS Status = STATUS_NOT_SUPPORTED; 2171 PDEVICE_EXTENSION pDevExt = (PDEVICE_EXTENSION)hAdapter; 2172 if (pEscape->PrivateDriverDataSize >= sizeof (VBOXDISPIFESCAPE)) 2173 { 2174 PVBOXDISPIFESCAPE pEscapeHdr = (PVBOXDISPIFESCAPE)pEscape->pPrivateDriverData; 2175 switch (pEscapeHdr->escapeCode) 2176 { 2177 case VBOXESC_SETVISIBLEREGION: 2178 { 2179 LPRGNDATA lpRgnData = VBOXDISPIFESCAPE_DATA(pEscapeHdr, RGNDATA); 2180 uint32_t cbData = VBOXDISPIFESCAPE_DATA_SIZE(pEscape->PrivateDriverDataSize); 2181 uint32_t cbRects = cbData - RT_OFFSETOF(RGNDATA, Buffer); 2182 /* the lpRgnData->Buffer comes to us as RECT 2183 * to avoid extra memcpy we cast it to PRTRECT assuming 2184 * they are identical */ 2185 AssertCompile(sizeof(RECT) == sizeof(RTRECT)); 2186 AssertCompile(RT_OFFSETOF(RECT, left) == RT_OFFSETOF(RTRECT, xLeft)); 2187 AssertCompile(RT_OFFSETOF(RECT, bottom) == RT_OFFSETOF(RTRECT, yBottom)); 2188 AssertCompile(RT_OFFSETOF(RECT, right) == RT_OFFSETOF(RTRECT, xRight)); 2189 AssertCompile(RT_OFFSETOF(RECT, top) == RT_OFFSETOF(RTRECT, yTop)); 2190 RTRECT *pRect = (RTRECT *)&lpRgnData->Buffer; 2191 2192 uint32_t cRects = cbRects/sizeof(RTRECT); 2193 int rc; 2194 2195 dprintf(("IOCTL_VIDEO_VBOX_SETVISIBLEREGION cRects=%d\n", cRects)); 2196 Assert(cbRects >= sizeof(RTRECT) 2197 && cbRects == cRects*sizeof(RTRECT) 2198 && cRects == lpRgnData->rdh.nCount); 2199 if ( cbRects >= sizeof(RTRECT) 2200 && cbRects == cRects*sizeof(RTRECT) 2201 && cRects == lpRgnData->rdh.nCount) 2202 { 2203 /* 2204 * Inform the host about the visible region 2205 */ 2206 VMMDevVideoSetVisibleRegion *req = NULL; 2207 2208 rc = VbglGRAlloc ((VMMDevRequestHeader **)&req, 2209 sizeof (VMMDevVideoSetVisibleRegion) + (cRects-1)*sizeof(RTRECT), 2210 VMMDevReq_VideoSetVisibleRegion); 2211 AssertRC(rc); 2212 if (RT_SUCCESS(rc)) 2213 { 2214 req->cRect = cRects; 2215 memcpy(&req->Rect, pRect, cRects*sizeof(RTRECT)); 2216 2217 rc = VbglGRPerform (&req->header); 2218 AssertRC(rc); 2219 if (!RT_SUCCESS(rc)) 2220 { 2221 drprintf((__FUNCTION__": VbglGRPerform failed rc (%d)", rc)); 2222 Status = STATUS_UNSUCCESSFUL; 2223 } 2224 } 2225 else 2226 { 2227 drprintf((__FUNCTION__": VbglGRAlloc failed rc (%d)", rc)); 2228 Status = STATUS_UNSUCCESSFUL; 2229 } 2230 } 2231 else 2232 { 2233 drprintf((__FUNCTION__": VBOXESC_SETVISIBLEREGION: incorrect buffer size (%d), reported count (%d)\n", cbRects, lpRgnData->rdh.nCount)); 2234 AssertBreakpoint(); 2235 Status = STATUS_INVALID_PARAMETER; 2236 } 2237 break; 2238 } 2239 case VBOXESC_ISVRDPACTIVE: 2240 /* @todo: implement */ 2241 Status = STATUS_SUCCESS; 2242 break; 2243 case VBOXESC_REINITVIDEOMODES: 2244 VBoxWddmInvalidateModesTable(pDevExt); 2245 Status = STATUS_SUCCESS; 2246 break; 2247 default: 2248 drprintf((__FUNCTION__": unsupported escape code (0x%x)\n", pEscapeHdr->escapeCode)); 2249 break; 2250 } 2251 } 2252 else 2253 { 2254 drprintf((__FUNCTION__": pEscape->PrivateDriverDataSize(%d) < (%d)\n", pEscape->PrivateDriverDataSize, sizeof (VBOXDISPIFESCAPE))); 2255 Status = STATUS_INVALID_PARAMETER; 2256 AssertBreakpoint(); 2257 } 2169 2258 2170 2259 dfprintf(("<== "__FUNCTION__ ", hAdapter(0x%x)\n", hAdapter)); 2171 2260 2172 return S TATUS_INVALID_PARAMETER;2261 return Status; 2173 2262 } 2174 2263
Note:
See TracChangeset
for help on using the changeset viewer.