Changeset 33085 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Miniport
- Timestamp:
- Oct 12, 2010 11:10:48 PM (14 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Miniport
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.h
r33048 r33085 24 24 #include <VBox/HGSMI/HGSMI.h> 25 25 #include <VBox/HGSMI/HGSMIChSetup.h> 26 #include <VBox/VBoxVideo.h> 26 27 #include "VBoxHGSMI.h" 27 28 … … 34 35 #include "video.h" 35 36 #else 37 # ifdef PAGE_SIZE 38 # undef PAGE_SIZE 39 # endif 40 # ifdef PAGE_SHIFT 41 # undef PAGE_SHIFT 42 # endif 36 43 # define VBOX_WITH_WORKAROUND_MISSING_PACK 37 44 # if (_MSC_VER >= 1400) && !defined(VBOX_WITH_PATCHED_DDK) … … 870 877 BOOLEAN VBoxHGSMIIsSupported (void); 871 878 879 typedef int FNHGSMIFILLVIEWINFO (void *pvData, VBVAINFOVIEW *pInfo); 880 typedef FNHGSMIFILLVIEWINFO *PFNHGSMIFILLVIEWINFO; 881 882 int VBoxHGSMISendViewInfo(PVBOXVIDEO_COMMON pCommon, uint32_t u32Count, PFNHGSMIFILLVIEWINFO pfnFill, void *pvData); 883 872 884 VOID VBoxSetupDisplaysHGSMI (PDEVICE_EXTENSION PrimaryExtension, 873 885 #ifndef VBOX_WITH_WDDM -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideoHGSMI.cpp
r33022 r33085 176 176 } 177 177 178 typedef int FNHGSMICALLINIT (P DEVICE_EXTENSION PrimaryExtension, void *pvContext, void *pvData);178 typedef int FNHGSMICALLINIT (PVBOXVIDEO_COMMON pCommon, void *pvContext, void *pvData); 179 179 typedef FNHGSMICALLINIT *PFNHGSMICALLINIT; 180 180 181 typedef int FNHGSMICALLFINALIZE (P DEVICE_EXTENSION PrimaryExtension, void *pvContext, void *pvData);181 typedef int FNHGSMICALLFINALIZE (PVBOXVIDEO_COMMON pCommon, void *pvContext, void *pvData); 182 182 typedef FNHGSMICALLFINALIZE *PFNHGSMICALLFINALIZE; 183 183 … … 217 217 } 218 218 219 static int vboxCallChannel (P DEVICE_EXTENSION PrimaryExtension,219 static int vboxCallChannel (PVBOXVIDEO_COMMON pCommon, 220 220 uint8_t u8Ch, 221 221 uint16_t u16Op, … … 228 228 229 229 /* Allocate the IO buffer. */ 230 #ifndef VBOX_WITH_WDDM 231 if (PrimaryExtension->pPrimary != PrimaryExtension) 232 { 233 dprintf(("VBoxVideo::vboxCallChannel: not primary extension %p!!!\n", PrimaryExtension)); 234 return VERR_INVALID_PARAMETER; 235 } 236 #endif 237 238 void *p = HGSMIHeapAlloc (&commonFromDeviceExt(PrimaryExtension)->hgsmiAdapterHeap, cbData, u8Ch, u16Op); 230 void *p = HGSMIHeapAlloc (&pCommon->hgsmiAdapterHeap, cbData, u8Ch, u16Op); 239 231 240 232 if (!p) … … 247 239 if (pfnInit) 248 240 { 249 rc = pfnInit ( PrimaryExtension, pvContext, p);241 rc = pfnInit (pCommon, pvContext, p); 250 242 } 251 243 … … 253 245 { 254 246 /* Initialize the buffer and get the offset for port IO. */ 255 HGSMIOFFSET offBuffer = HGSMIHeapBufferOffset (& commonFromDeviceExt(PrimaryExtension)->hgsmiAdapterHeap,247 HGSMIOFFSET offBuffer = HGSMIHeapBufferOffset (&pCommon->hgsmiAdapterHeap, 256 248 p); 257 249 258 250 /* Submit the buffer to the host. */ 259 VBoxHGSMIGuestWrite( commonFromDeviceExt(PrimaryExtension), offBuffer);251 VBoxHGSMIGuestWrite(pCommon, offBuffer); 260 252 261 253 if (pfnFinalize) 262 254 { 263 rc = pfnFinalize ( PrimaryExtension, pvContext, p);255 rc = pfnFinalize (pCommon, pvContext, p); 264 256 } 265 257 } … … 271 263 272 264 /* Free the IO buffer. */ 273 HGSMIHeapFree (& commonFromDeviceExt(PrimaryExtension)->hgsmiAdapterHeap, p);265 HGSMIHeapFree (&pCommon->hgsmiAdapterHeap, p); 274 266 } 275 267 … … 277 269 } 278 270 279 static int vboxCallVBVA (P DEVICE_EXTENSION PrimaryExtension,271 static int vboxCallVBVA (PVBOXVIDEO_COMMON pCommon, 280 272 uint16_t u16Op, 281 273 HGSMISIZE cbData, … … 284 276 void *pvContext) 285 277 { 286 return vboxCallChannel ( PrimaryExtension,278 return vboxCallChannel (pCommon, 287 279 HGSMI_CH_VBVA, 288 280 u16Op, … … 299 291 } QUERYCONFCTX; 300 292 301 static int vbvaInitQueryConf (PDEVICE_EXTENSION PrimaryExtension, void *pvContext, void *pvData) 302 { 303 NOREF (PrimaryExtension); 304 293 static int vbvaInitQueryConf (PVBOXVIDEO_COMMON, void *pvContext, void *pvData) 294 { 305 295 QUERYCONFCTX *pCtx = (QUERYCONFCTX *)pvContext; 306 296 VBVACONF32 *p = (VBVACONF32 *)pvData; … … 312 302 } 313 303 314 static int vbvaFinalizeQueryConf (PDEVICE_EXTENSION PrimaryExtension, void *pvContext, void *pvData) 315 { 316 NOREF (PrimaryExtension); 317 304 static int vbvaFinalizeQueryConf (PVBOXVIDEO_COMMON, void *pvContext, void *pvData) 305 { 318 306 QUERYCONFCTX *pCtx = (QUERYCONFCTX *)pvContext; 319 307 VBVACONF32 *p = (VBVACONF32 *)pvData; … … 337 325 context.pulValue = pulValue; 338 326 339 int rc = vboxCallVBVA ( PrimaryExtension,327 int rc = vboxCallVBVA (commonFromDeviceExt(PrimaryExtension), 340 328 VBVA_QUERY_CONF32, 341 329 sizeof (VBVACONF32), … … 348 336 return rc; 349 337 } 338 339 int VBoxHGSMISendViewInfo(PVBOXVIDEO_COMMON pCommon, uint32_t u32Count, PFNHGSMIFILLVIEWINFO pfnFill, void *pvData) 340 { 341 int rc; 342 /* Issue the screen info command. */ 343 void *p = vboxHGSMIBufferAlloc (pCommon, sizeof(VBVAINFOVIEW) * u32Count, 344 HGSMI_CH_VBVA, VBVA_INFO_VIEW); 345 Assert(p); 346 if (p) 347 { 348 VBVAINFOVIEW *pInfo = (VBVAINFOVIEW *)p; 349 rc = pfnFill(pvData, pInfo); 350 if (RT_SUCCESS(rc)) 351 vboxHGSMIBufferSubmit (pCommon, p); 352 vboxHGSMIBufferFree (pCommon, p); 353 } 354 else 355 rc = VERR_NO_MEMORY; 356 return rc; 357 } 358 350 359 #ifndef VBOX_WITH_WDDM 351 static int vbvaInitInfoDisplay (PDEVICE_EXTENSION PrimaryExtension, void *pvContext, void *pvData) 352 { 353 NOREF (pvContext); 354 VBVAINFOVIEW *p = (VBVAINFOVIEW *)pvData; 360 static int vbvaInitInfoDisplay (void *pvData, VBVAINFOVIEW *p) 361 { 362 PDEVICE_EXTENSION PrimaryExtension = (PDEVICE_EXTENSION) pvData; 355 363 356 364 int i; … … 382 390 } 383 391 #else 384 int vbvaInitInfoCaps (P DEVICE_EXTENSION PrimaryExtension, void *pvContext, void *pvData)392 int vbvaInitInfoCaps (PVBOXVIDEO_COMMON, void *pvContext, void *pvData) 385 393 { 386 394 VBVACAPS *pCaps = (VBVACAPS*)pvData; … … 391 399 392 400 393 int vbvaFinalizeInfoCaps (P DEVICE_EXTENSION PrimaryExtension, void *pvContext, void *pvData)401 int vbvaFinalizeInfoCaps (PVBOXVIDEO_COMMON, void *pvContext, void *pvData) 394 402 { 395 403 VBVACAPS *pCaps = (VBVACAPS*)pvData; … … 399 407 #endif 400 408 401 static int vbvaInitInfoHeap (P DEVICE_EXTENSION PrimaryExtension, void *pvContext, void *pvData)409 static int vbvaInitInfoHeap (PVBOXVIDEO_COMMON pCommon, void *pvContext, void *pvData) 402 410 { 403 411 NOREF (pvContext); 404 412 VBVAINFOHEAP *p = (VBVAINFOHEAP *)pvData; 405 413 406 p->u32HeapOffset = commonFromDeviceExt(PrimaryExtension)->cbVRAM407 - commonFromDeviceExt(PrimaryExtension)->cbMiniportHeap414 p->u32HeapOffset = pCommon->cbVRAM 415 - pCommon->cbMiniportHeap 408 416 - VBVA_ADAPTER_INFORMATION_SIZE; 409 p->u32HeapSize = commonFromDeviceExt(PrimaryExtension)->cbMiniportHeap;417 p->u32HeapSize = pCommon->cbMiniportHeap; 410 418 411 419 return VINF_SUCCESS; 412 420 } 413 421 414 static int hgsmiInitFlagsLocation (P DEVICE_EXTENSION PrimaryExtension, void *pvContext, void *pvData)422 static int hgsmiInitFlagsLocation (PVBOXVIDEO_COMMON pCommon, void *pvContext, void *pvData) 415 423 { 416 424 NOREF (pvContext); 417 425 HGSMIBUFFERLOCATION *p = (HGSMIBUFFERLOCATION *)pvData; 418 426 419 p->offLocation = commonFromDeviceExt(PrimaryExtension)->cbVRAM - sizeof (HGSMIHOSTFLAGS);427 p->offLocation = pCommon->cbVRAM - sizeof (HGSMIHOSTFLAGS); 420 428 p->cbLocation = sizeof (HGSMIHOSTFLAGS); 421 429 … … 429 437 430 438 /* setup the flags first to ensure they are initialized by the time the host heap is ready */ 431 int rc = vboxCallChannel( PrimaryExtension,439 int rc = vboxCallChannel(commonFromDeviceExt(PrimaryExtension), 432 440 HGSMI_CH_HGSMI, 433 441 HGSMI_CC_HOST_FLAGS_LOCATION, … … 440 448 { 441 449 #ifndef VBOX_WITH_WDDM 442 rc = vboxCallVBVA (PrimaryExtension, 443 VBVA_INFO_VIEW, 444 sizeof (VBVAINFOVIEW) * PrimaryExtension->u.primary.cDisplays, 450 rc = VBoxHGSMISendViewInfo (commonFromDeviceExt(PrimaryExtension), 451 PrimaryExtension->u.primary.cDisplays, 445 452 vbvaInitInfoDisplay, 446 NULL, 447 NULL); 453 (void *) PrimaryExtension); 448 454 AssertRC(rc); 449 455 if (RT_SUCCESS (rc)) … … 454 460 455 461 /* Inform about caps */ 456 rc = vboxCallVBVA ( PrimaryExtension,462 rc = vboxCallVBVA (commonFromDeviceExt(PrimaryExtension), 457 463 VBVA_INFO_CAPS, 458 464 sizeof (VBVACAPS), … … 465 471 { 466 472 /* Report the host heap location. */ 467 rc = vboxCallVBVA ( PrimaryExtension,473 rc = vboxCallVBVA (commonFromDeviceExt(PrimaryExtension), 468 474 VBVA_INFO_HEAP, 469 475 sizeof (VBVAINFOHEAP), … … 1128 1134 } MOUSEPOINTERSHAPECTX; 1129 1135 1130 static int vbvaInitMousePointerShape (PDEVICE_EXTENSION PrimaryExtension, void *pvContext, void *pvData) 1131 { 1132 NOREF (PrimaryExtension); 1133 1136 static int vbvaInitMousePointerShape (PVBOXVIDEO_COMMON, void *pvContext, void *pvData) 1137 { 1134 1138 MOUSEPOINTERSHAPECTX *pCtx = (MOUSEPOINTERSHAPECTX *)pvContext; 1135 1139 VBVAMOUSEPOINTERSHAPE *p = (VBVAMOUSEPOINTERSHAPE *)pvData; … … 1160 1164 } 1161 1165 1162 static int vbvaFinalizeMousePointerShape (PDEVICE_EXTENSION PrimaryExtension, void *pvContext, void *pvData) 1163 { 1164 NOREF (PrimaryExtension); 1165 1166 static int vbvaFinalizeMousePointerShape (PVBOXVIDEO_COMMON, void *pvContext, void *pvData) 1167 { 1166 1168 MOUSEPOINTERSHAPECTX *pCtx = (MOUSEPOINTERSHAPECTX *)pvContext; 1167 1169 VBVAMOUSEPOINTERSHAPE *p = (VBVAMOUSEPOINTERSHAPE *)pvData; … … 1232 1234 ctx.i32Result = VERR_NOT_SUPPORTED; 1233 1235 1234 int rc = vboxCallVBVA ( PrimaryExtension,1236 int rc = vboxCallVBVA (commonFromDeviceExt(PrimaryExtension), 1235 1237 VBVA_MOUSE_POINTER_SHAPE, 1236 1238 sizeof (VBVAMOUSEPOINTERSHAPE) + cbData,
Note:
See TracChangeset
for help on using the changeset viewer.