Changeset 33761 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Miniport
- Timestamp:
- Nov 4, 2010 12:45:28 PM (14 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Miniport
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.cpp
r33711 r33761 1857 1857 * with old guest additions. 1858 1858 */ 1859 VBoxSetupDisplaysHGSMI((PDEVICE_EXTENSION)HwDeviceExtension, AdapterMemorySize, 0); 1859 VBoxSetupDisplaysHGSMI(commonFromDeviceExt((PDEVICE_EXTENSION)HwDeviceExtension), 1860 AdapterMemorySize, 0); 1860 1861 1861 1862 if (commonFromDeviceExt((PDEVICE_EXTENSION)HwDeviceExtension)->bHGSMI) … … 1970 1971 PointerAttributes.Enable = VBOX_MOUSE_POINTER_VISIBLE; 1971 1972 1972 Result = vboxUpdatePointerShape( PrimaryExtension, &PointerAttributes, sizeof (PointerAttributes));1973 Result = vboxUpdatePointerShape(commonFromDeviceExt(PrimaryExtension), &PointerAttributes, sizeof (PointerAttributes)); 1973 1974 1974 1975 if (Result) … … 2218 2219 PointerAttributes.Enable = 0; 2219 2220 2220 Result = vboxUpdatePointerShape( (PDEVICE_EXTENSION)HwDeviceExtension, &PointerAttributes, sizeof (PointerAttributes));2221 Result = vboxUpdatePointerShape(commonFromDeviceExt((PDEVICE_EXTENSION)HwDeviceExtension), &PointerAttributes, sizeof (PointerAttributes)); 2221 2222 2222 2223 if (Result) … … 2263 2264 dprintf(("\tBytes attached: %d\n", RequestPacket->InputBufferLength - sizeof(VIDEO_POINTER_ATTRIBUTES))); 2264 2265 #endif 2265 Result = vboxUpdatePointerShape( (PDEVICE_EXTENSION)HwDeviceExtension, pPointerAttributes, RequestPacket->InputBufferLength);2266 Result = vboxUpdatePointerShape(commonFromDeviceExt((PDEVICE_EXTENSION)HwDeviceExtension), pPointerAttributes, RequestPacket->InputBufferLength); 2266 2267 if (!Result) 2267 2268 dprintf(("VBoxVideo::VBoxVideoStartIO: Could not set hardware pointer -> fallback\n")); -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.h
r33711 r33761 846 846 int VBoxHGSMISendViewInfo(PVBOXVIDEO_COMMON pCommon, uint32_t u32Count, PFNHGSMIFILLVIEWINFO pfnFill, void *pvData); 847 847 848 VOID VBoxSetupDisplaysHGSMI (P DEVICE_EXTENSION PrimaryExtension,848 VOID VBoxSetupDisplaysHGSMI (PVBOXVIDEO_COMMON pCommon, 849 849 ULONG AdapterMemorySize, uint32_t fCaps); 850 BOOLEAN vboxUpdatePointerShape (P DEVICE_EXTENSION DeviceExtension,850 BOOLEAN vboxUpdatePointerShape (PVBOXVIDEO_COMMON pCommon, 851 851 PVIDEO_POINTER_ATTRIBUTES pointerAttr, 852 852 uint32_t cbLength); -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideoHGSMI.cpp
r33713 r33761 381 381 * to talk to the host. 382 382 */ 383 VOID VBoxSetupDisplaysHGSMI(P DEVICE_EXTENSION PrimaryExtension,383 VOID VBoxSetupDisplaysHGSMI(PVBOXVIDEO_COMMON pCommon, 384 384 ULONG AdapterMemorySize, uint32_t fCaps) 385 385 { 386 386 VP_STATUS rc = NO_ERROR; 387 387 388 dprintf(("VBoxVideo::VBoxSetupDisplays: PrimaryExtension = %p\n", 389 PrimaryExtension)); 390 391 memset(commonFromDeviceExt(PrimaryExtension), 0, 392 sizeof(*commonFromDeviceExt(PrimaryExtension))); 393 commonFromDeviceExt(PrimaryExtension)->cbVRAM = AdapterMemorySize; 394 commonFromDeviceExt(PrimaryExtension)->fCaps = fCaps; 395 commonFromDeviceExt(PrimaryExtension)->cDisplays = 1; 396 commonFromDeviceExt(PrimaryExtension)->bHGSMI = VBoxHGSMIIsSupported (); 388 dprintf(("VBoxVideo::VBoxSetupDisplays: pCommon = %p\n", pCommon)); 389 390 memset(pCommon, 0, sizeof(*pCommon)); 391 pCommon->cbVRAM = AdapterMemorySize; 392 pCommon->fCaps = fCaps; 393 pCommon->cDisplays = 1; 394 pCommon->bHGSMI = VBoxHGSMIIsSupported (); 397 395 /* Why does this use VBoxVideoCmnMemZero? The MSDN docs say that it should 398 396 * only be used on mapped display adapter memory. Done with memset above. */ 399 // VBoxVideoCmnMemZero(& commonFromDeviceExt(PrimaryExtension)->areaHostHeap, sizeof(HGSMIAREA));400 if ( commonFromDeviceExt(PrimaryExtension)->bHGSMI)397 // VBoxVideoCmnMemZero(&pCommon->areaHostHeap, sizeof(HGSMIAREA)); 398 if (pCommon->bHGSMI) 401 399 { 402 400 /** @note (michael) moved this here as it is done unconditionally in both 403 401 * driver branches. Feel free to fix if that is ever changed. */ 404 commonFromDeviceExt(PrimaryExtension)->IOPortHost = (RTIOPORT)VGA_PORT_HGSMI_HOST;405 commonFromDeviceExt(PrimaryExtension)->IOPortGuest = (RTIOPORT)VGA_PORT_HGSMI_GUEST;402 pCommon->IOPortHost = (RTIOPORT)VGA_PORT_HGSMI_HOST; 403 pCommon->IOPortGuest = (RTIOPORT)VGA_PORT_HGSMI_GUEST; 406 404 407 405 /* Map the adapter information. It will be needed for HGSMI IO. */ 408 rc = VBoxMapAdapterMemory (commonFromDeviceExt(PrimaryExtension), 409 &commonFromDeviceExt(PrimaryExtension)->pvAdapterInformation, 406 rc = VBoxMapAdapterMemory (pCommon, &pCommon->pvAdapterInformation, 410 407 AdapterMemorySize - VBVA_ADAPTER_INFORMATION_SIZE, 411 408 VBVA_ADAPTER_INFORMATION_SIZE … … 416 413 rc)); 417 414 418 commonFromDeviceExt(PrimaryExtension)->bHGSMI = FALSE;415 pCommon->bHGSMI = FALSE; 419 416 } 420 417 else 421 418 { 422 419 /* Setup a HGSMI heap within the adapter information area. */ 423 rc = HGSMIHeapSetup (& commonFromDeviceExt(PrimaryExtension)->hgsmiAdapterHeap,424 commonFromDeviceExt(PrimaryExtension)->pvAdapterInformation,420 rc = HGSMIHeapSetup (&pCommon->hgsmiAdapterHeap, 421 pCommon->pvAdapterInformation, 425 422 VBVA_ADAPTER_INFORMATION_SIZE - sizeof(HGSMIHOSTFLAGS), 426 commonFromDeviceExt(PrimaryExtension)->cbVRAM - VBVA_ADAPTER_INFORMATION_SIZE,423 pCommon->cbVRAM - VBVA_ADAPTER_INFORMATION_SIZE, 427 424 false /*fOffsetBased*/); 428 425 … … 432 429 rc)); 433 430 434 commonFromDeviceExt(PrimaryExtension)->bHGSMI = FALSE;431 pCommon->bHGSMI = FALSE; 435 432 } 436 433 else 437 434 { 438 commonFromDeviceExt(PrimaryExtension)->pHostFlags = (HGSMIHOSTFLAGS*)(((uint8_t*)commonFromDeviceExt(PrimaryExtension)->pvAdapterInformation)435 pCommon->pHostFlags = (HGSMIHOSTFLAGS*)(((uint8_t*)pCommon->pvAdapterInformation) 439 436 + VBVA_ADAPTER_INFORMATION_SIZE - sizeof(HGSMIHOSTFLAGS)); 440 437 } … … 443 440 444 441 /* Setup the host heap and the adapter memory. */ 445 if ( commonFromDeviceExt(PrimaryExtension)->bHGSMI)442 if (pCommon->bHGSMI) 446 443 { 447 444 /* The miniport heap is used for the host buffers. */ 448 445 ULONG cbMiniportHeap = 0; 449 vboxQueryConfHGSMI ( commonFromDeviceExt(PrimaryExtension), VBOX_VBVA_CONF32_HOST_HEAP_SIZE, &cbMiniportHeap);446 vboxQueryConfHGSMI (pCommon, VBOX_VBVA_CONF32_HOST_HEAP_SIZE, &cbMiniportHeap); 450 447 451 448 if (cbMiniportHeap != 0) … … 465 462 466 463 /* Round up to 4096 bytes. */ 467 commonFromDeviceExt(PrimaryExtension)->cbMiniportHeap = (cbMiniportHeap + 0xFFF) & ~0xFFF;468 469 dprintf(("VBoxVideo::VBoxSetupDisplays: cbMiniportHeap = 0x%08X, PrimaryExtension->u.primary.cbMiniportHeap = 0x%08X, cbMiniportHeapMaxSize = 0x%08X\n",470 cbMiniportHeap, commonFromDeviceExt(PrimaryExtension)->cbMiniportHeap, cbMiniportHeapMaxSize));464 pCommon->cbMiniportHeap = (cbMiniportHeap + 0xFFF) & ~0xFFF; 465 466 dprintf(("VBoxVideo::VBoxSetupDisplays: cbMiniportHeap = 0x%08X, pCommon->cbMiniportHeap = 0x%08X, cbMiniportHeapMaxSize = 0x%08X\n", 467 cbMiniportHeap, pCommon->cbMiniportHeap, cbMiniportHeapMaxSize)); 471 468 472 469 /* Map the heap region. … … 476 473 * display drivers. 477 474 */ 478 rc = VBoxMapAdapterMemory (commonFromDeviceExt(PrimaryExtension), 479 &commonFromDeviceExt(PrimaryExtension)->pvMiniportHeap, 480 commonFromDeviceExt(PrimaryExtension)->cbVRAM 475 rc = VBoxMapAdapterMemory (pCommon, &pCommon->pvMiniportHeap, 476 pCommon->cbVRAM 481 477 - VBVA_ADAPTER_INFORMATION_SIZE 482 - commonFromDeviceExt(PrimaryExtension)->cbMiniportHeap,483 commonFromDeviceExt(PrimaryExtension)->cbMiniportHeap478 - pCommon->cbMiniportHeap, 479 pCommon->cbMiniportHeap 484 480 ); 485 481 if (rc != NO_ERROR) 486 482 { 487 commonFromDeviceExt(PrimaryExtension)->pvMiniportHeap = NULL;488 commonFromDeviceExt(PrimaryExtension)->cbMiniportHeap = 0;489 commonFromDeviceExt(PrimaryExtension)->bHGSMI = FALSE;483 pCommon->pvMiniportHeap = NULL; 484 pCommon->cbMiniportHeap = 0; 485 pCommon->bHGSMI = FALSE; 490 486 } 491 487 else 492 488 { 493 HGSMIOFFSET offBase = commonFromDeviceExt(PrimaryExtension)->cbVRAM489 HGSMIOFFSET offBase = pCommon->cbVRAM 494 490 - VBVA_ADAPTER_INFORMATION_SIZE 495 - commonFromDeviceExt(PrimaryExtension)->cbMiniportHeap;491 - pCommon->cbMiniportHeap; 496 492 497 493 /* Init the host hap area. Buffers from the host will be placed there. */ 498 HGSMIAreaInitialize (& commonFromDeviceExt(PrimaryExtension)->areaHostHeap,499 commonFromDeviceExt(PrimaryExtension)->pvMiniportHeap,500 commonFromDeviceExt(PrimaryExtension)->cbMiniportHeap,494 HGSMIAreaInitialize (&pCommon->areaHostHeap, 495 pCommon->pvMiniportHeap, 496 pCommon->cbMiniportHeap, 501 497 offBase); 502 498 } … … 505 501 { 506 502 /* Host has not requested a heap. */ 507 commonFromDeviceExt(PrimaryExtension)->pvMiniportHeap = NULL;508 commonFromDeviceExt(PrimaryExtension)->cbMiniportHeap = 0;503 pCommon->pvMiniportHeap = NULL; 504 pCommon->cbMiniportHeap = 0; 509 505 } 510 506 } 511 507 512 508 /* Check whether the guest supports multimonitors. */ 513 if ( commonFromDeviceExt(PrimaryExtension)->bHGSMI)509 if (pCommon->bHGSMI) 514 510 { 515 511 /* Query the configured number of displays. */ 516 512 ULONG cDisplays = 0; 517 vboxQueryConfHGSMI ( commonFromDeviceExt(PrimaryExtension), VBOX_VBVA_CONF32_MONITOR_COUNT, &cDisplays);513 vboxQueryConfHGSMI (pCommon, VBOX_VBVA_CONF32_MONITOR_COUNT, &cDisplays); 518 514 519 515 dprintf(("VBoxVideo::VBoxSetupDisplays: cDisplays = %d\n", … … 525 521 cDisplays = 1; 526 522 } 527 commonFromDeviceExt(PrimaryExtension)->cDisplays = cDisplays;528 } 529 530 if ( commonFromDeviceExt(PrimaryExtension)->bHGSMI)523 pCommon->cDisplays = cDisplays; 524 } 525 526 if (pCommon->bHGSMI) 531 527 { 532 528 /* Setup the information for the host. */ 533 rc = vboxSetupAdapterInfoHGSMI ( commonFromDeviceExt(PrimaryExtension));529 rc = vboxSetupAdapterInfoHGSMI (pCommon); 534 530 535 531 if (RT_FAILURE (rc)) 536 532 { 537 commonFromDeviceExt(PrimaryExtension)->bHGSMI = FALSE;538 } 539 } 540 541 if (! commonFromDeviceExt(PrimaryExtension)->bHGSMI)542 VBoxFreeDisplaysHGSMI( commonFromDeviceExt(PrimaryExtension));533 pCommon->bHGSMI = FALSE; 534 } 535 } 536 537 if (!pCommon->bHGSMI) 538 VBoxFreeDisplaysHGSMI(pCommon); 543 539 544 540 dprintf(("VBoxVideo::VBoxSetupDisplays: finished\n")); … … 613 609 } 614 610 615 BOOLEAN vboxUpdatePointerShape (P DEVICE_EXTENSION DeviceExtension,611 BOOLEAN vboxUpdatePointerShape (PVBOXVIDEO_COMMON pCommon, 616 612 PVIDEO_POINTER_ATTRIBUTES pointerAttr, 617 613 uint32_t cbLength) 618 614 { 619 #ifndef VBOX_WITH_WDDM620 PDEVICE_EXTENSION PrimaryExtension = DeviceExtension->pPrimary;621 622 /* In multimonitor case the HW mouse pointer is the same on all screens,623 * and Windows calls each display driver with the same pointer data: visible for624 * the screen where the pointer is and invisible for other screens.625 *626 * This driver passes the shape to the host only from primary screen and makes627 * the pointer always visible (in vbvaInitMousePointerShape).628 *629 * The simple solution makes it impossible to create the shape and keep the mouse630 * pointer invisible. New shapes will be created visible.631 * But:632 * 1) VBox frontends actually ignore the visibility flag if VBOX_MOUSE_POINTER_SHAPE633 * is set and always create new pointers visible.634 * 2) Windows uses DrvMovePointer to hide the pointer, which will still work.635 */636 637 if (DeviceExtension->iDevice != PrimaryExtension->iDevice)638 {639 dprintf(("vboxUpdatePointerShape: ignore non primary device %d(%d)\n",640 DeviceExtension->iDevice, PrimaryExtension->iDevice));641 /* Success. */642 return TRUE;643 }644 #else645 PDEVICE_EXTENSION PrimaryExtension = DeviceExtension;646 #endif647 648 615 uint32_t cbData = 0; 649 616 … … 673 640 ctx.i32Result = VERR_NOT_SUPPORTED; 674 641 675 int rc = vboxCallVBVA (commonFromDeviceExt(PrimaryExtension), 676 VBVA_MOUSE_POINTER_SHAPE, 642 int rc = vboxCallVBVA (pCommon, VBVA_MOUSE_POINTER_SHAPE, 677 643 sizeof (VBVAMOUSEPOINTERSHAPE) + cbData, 678 644 vbvaInitMousePointerShape, -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp
r33715 r33761 733 733 * with old guest additions. 734 734 */ 735 VBoxSetupDisplaysHGSMI(pContext, AdapterMemorySize, 735 VBoxSetupDisplaysHGSMI(commonFromDeviceExt(pContext), 736 AdapterMemorySize, 736 737 VBVACAPS_COMPLETEGCMD_BY_IOREAD | VBVACAPS_IRQ); 737 738 if (commonFromDeviceExt(pContext)->bHGSMI) … … 3281 3282 PointerAttributes.Enable = pSetPointerPosition->Flags.Visible ? VBOX_MOUSE_POINTER_VISIBLE : 0; 3282 3283 3283 BOOLEAN bResult = vboxUpdatePointerShape( pDevExt, &PointerAttributes, sizeof (PointerAttributes));3284 BOOLEAN bResult = vboxUpdatePointerShape(commonFromDeviceExt(pDevExt), &PointerAttributes, sizeof (PointerAttributes)); 3284 3285 Assert(bResult); 3285 3286 } … … 3311 3312 if (vboxVddmPointerShapeToAttributes(pSetPointerShape, pPointerInfo)) 3312 3313 { 3313 if (vboxUpdatePointerShape ( pDevExt, &pPointerInfo->Attributes.data, VBOXWDDM_POINTER_ATTRIBUTES_SIZE))3314 if (vboxUpdatePointerShape (commonFromDeviceExt(pDevExt), &pPointerInfo->Attributes.data, VBOXWDDM_POINTER_ATTRIBUTES_SIZE)) 3314 3315 Status = STATUS_SUCCESS; 3315 3316 else
Note:
See TracChangeset
for help on using the changeset viewer.