Changeset 17623 in vbox
- Timestamp:
- Mar 10, 2009 12:41:29 PM (16 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Display
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Display/driver.h
r17610 r17623 180 180 extern HSEMAPHORE ghsemHwBuffer; 181 181 #endif /* !VBOX_WITH_HGSMI */ 182 183 184 #ifdef VBOX_WITH_HGSMI 185 #define VBE_DISPI_IOPORT_INDEX 0x01CE 186 #define VBE_DISPI_IOPORT_DATA 0x01CF 187 #define VBE_DISPI_INDEX_VBVA_GUEST 0xc 188 #endif /* VBOX_WITH_HGSMI */ 182 189 183 190 extern BOOL g_bOnNT40; -
trunk/src/VBox/Additions/WINNT/Graphics/Display/enable.c
r17610 r17623 1160 1160 DISPDBG((3, "DN_DEVICE_ORIGIN: %d, %d (PSO = %p)\n", ppdev->ptlDevOrg.x, 1161 1161 ppdev->ptlDevOrg.y, pso)); 1162 if (ppdev->bHGSMISupported) 1163 { 1164 VBoxProcessDisplayInfo(ppdev); 1165 } 1162 VBoxProcessDisplayInfo(ppdev); 1166 1163 #endif /* VBOX_WITH_HGSMI */ 1167 1164 break; -
trunk/src/VBox/Additions/WINNT/Graphics/Display/screen.c
r17610 r17623 35 35 #include <VBox/HGSMI/HGSMI.h> 36 36 #include <VBox/HGSMI/HGSMIChSetup.h> 37 38 #define VBE_DISPI_IOPORT_INDEX 0x01CE39 #define VBE_DISPI_IOPORT_DATA 0x01CF40 #define VBE_DISPI_INDEX_VBVA_GUEST 0xc41 37 #endif 42 38 … … 322 318 } 323 319 } 324 #else 325 static void vboxUpdateDisplayInfo (PPDEV ppdev) 326 { 327 if (ppdev->bHGSMISupported) 328 { 329 /* Inform the host about this display layout. */ 330 DISPDBG((1, "Update: %d,%d\n", ppdev->ptlDevOrg.x, ppdev->ptlDevOrg.y)); 331 VBoxProcessDisplayInfo(ppdev); 332 } 333 } 334 #endif /* VBOX_WITH_HGSMI */ 320 #endif /* !VBOX_WITH_HGSMI */ 335 321 336 322 … … 493 479 DISPDBG((1, "DISP bInitSURF success\n")); 494 480 481 #ifndef VBOX_WITH_HGSMI 495 482 /* Update the display information. */ 496 483 vboxUpdateDisplayInfo (ppdev); 484 #else 485 /* Inform the host about this screen layout. */ 486 DISPDBG((1, "bInitSURF: %d,%d\n", ppdev->ptlDevOrg.x, ppdev->ptlDevOrg.y)); 487 VBoxProcessDisplayInfo (ppdev); 488 #endif /* VBOX_WITH_HGSMI */ 497 489 498 490 return(TRUE); -
trunk/src/VBox/Additions/WINNT/Graphics/Display/vbox.c
r17610 r17623 340 340 #else /* VBOX_WITH_HGSMI */ 341 341 342 static void vboxHGSMIBufferSubmit (PPDEV ppdev, void *p) 343 { 344 HGSMIOFFSET offBuffer = HGSMIHeapBufferOffset (&ppdev->hgsmiDisplayHeap, p); 345 346 ASMOutU16 (VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_VBVA_GUEST); 347 ASMOutU32 (VBE_DISPI_IOPORT_DATA, offBuffer); 348 } 349 350 static BOOL vboxVBVAInformHost (PPDEV ppdev, BOOL bEnable) 351 { 352 BOOL bRc = FALSE; 353 354 if (ppdev->bHGSMISupported) 355 { 356 void *p = HGSMIHeapAlloc (&ppdev->hgsmiDisplayHeap, 357 sizeof (VBVAENABLE), 358 HGSMI_CH_VBVA, 359 VBVA_ENABLE); 360 if (!p) 361 { 362 DISPDBG((0, "VBoxDISP::vboxVBVAInformHost: HGSMIHeapAlloc failed\n")); 363 } 364 else 365 { 366 VBVAENABLE *pEnable = (VBVAENABLE *)p; 367 368 pEnable->u32Flags = bEnable? VBVA_F_ENABLE: VBVA_F_DISABLE; 369 pEnable->u32Reserved = 0; 370 371 vboxHGSMIBufferSubmit (ppdev, p); 372 373 HGSMIHeapFree (&ppdev->hgsmiDisplayHeap, p); 374 375 bRc = TRUE; 376 } 377 } 378 379 return bRc; 380 } 381 342 382 /* 343 383 * Public hardware buffer methods. … … 353 393 VBVABUFFER *pVBVA = (VBVABUFFER *)((uint8_t *)ppdev->pjScreen + ppdev->layout.offVBVABuffer); 354 394 355 pVBVA->u32HostEvents = 0;395 pVBVA->u32HostEvents = 0; 356 396 pVBVA->u32SupportedOrders = 0; 357 pVBVA->off32Data ;358 pVBVA->off32Free ;397 pVBVA->off32Data = 0; 398 pVBVA->off32Free = 0; 359 399 RtlZeroMemory (pVBVA->aRecords, sizeof (pVBVA->aRecords)); 360 pVBVA->indexRecordFirst ;361 pVBVA->indexRecordFree ;362 pVBVA->cbPartialWriteThreshold ;363 pVBVA->cbData = ppdev->layout.cbVBVABuffer - sizeof (VBVABUFFER) + sizeof (pVBVA->au8Data);400 pVBVA->indexRecordFirst = 0; 401 pVBVA->indexRecordFree = 0; 402 pVBVA->cbPartialWriteThreshold = 256; 403 pVBVA->cbData = ppdev->layout.cbVBVABuffer - sizeof (VBVABUFFER) + sizeof (pVBVA->au8Data); 364 404 365 405 ppdev->fHwBufferOverflow = FALSE; … … 367 407 ppdev->pVBVA = pVBVA; 368 408 369 #if 0 370 /* @todo inform host that VBVA mode has been entered. */ 371 bRC = vboxVBVAInformHost (ppdev); 372 #else 373 /* All have been initialized. */ 374 bRc = TRUE; 375 #endif 409 bRc = vboxVBVAInformHost (ppdev, TRUE); 376 410 } 377 411 … … 392 426 ppdev->pVBVA = NULL; 393 427 428 vboxVBVAInformHost (ppdev, FALSE); 429 394 430 return; 395 431 } … … 477 513 static void vboxHwBufferFlush (PPDEV ppdev) 478 514 { 479 VBVA_ASSERT (ppdev->pVBVA); 480 481 #if 0 482 /* @todo issue the flush command */ 515 /* Issue the flush command. */ 483 516 void *p = HGSMIHeapAlloc (&ppdev->hgsmiDisplayHeap, 484 517 sizeof (VBVA_FLUSH), 485 518 HGSMI_CH_VBVA, 486 HGSMI_CC_VBVA_FLUSH); 487 ........ 519 VBVA_FLUSH); 488 520 if (!p) 489 521 { 490 DISPDBG((0, "VBoxDISP::vboxInitVBoxVideo: HGSMIHeapAlloc failed\n")); 491 rc = VERR_NO_MEMORY; 522 DISPDBG((0, "VBoxDISP::vboxHwBufferFlush: HGSMIHeapAlloc failed\n")); 492 523 } 493 524 else 494 525 { 495 HGSMIOFFSET offBuffer = HGSMIHeapBufferOffset (&ppdev->hgsmiDisplayHeap, 496 p); 497 498 ((HGSMI_BUFFER_LOCATION *)p)->offLocation = ppdev->layout.offDisplayInformation; 499 ((HGSMI_BUFFER_LOCATION *)p)->cbLocation = sizeof (HGSMIHOSTFLAGS); 500 501 /* Submit the buffer to the host. */ 502 ASMOutU16 (VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_VBVA_GUEST); 503 ASMOutU32 (VBE_DISPI_IOPORT_DATA, offBuffer); 526 VBVAFLUSH *pFlush = (VBVAFLUSH *)p; 527 528 pFlush->u32Reserved = 0; 529 530 vboxHGSMIBufferSubmit (ppdev, p); 504 531 505 532 HGSMIHeapFree (&ppdev->hgsmiDisplayHeap, p); 506 533 } 507 #endif508 534 509 535 return; … … 629 655 } 630 656 631 void VBoxProcessDisplayInfo(PPDEV ppdev) 632 { 633 #if 0 634 DWORD returnedDataLength; 635 636 DISPDBG((1, "Process: %d,%d\n", ppdev->ptlDevOrg.x, ppdev->ptlDevOrg.y)); 637 638 EngDeviceIoControl(ppdev->hDriver, 639 IOCTL_VIDEO_INTERPRET_DISPLAY_MEMORY, 640 NULL, 641 0, 642 NULL, 643 0, 644 &returnedDataLength); 645 #endif 657 void VBoxProcessDisplayInfo (PPDEV ppdev) 658 { 659 if (ppdev->bHGSMISupported) 660 { 661 /* Issue the screen info command. */ 662 void *p = HGSMIHeapAlloc (&ppdev->hgsmiDisplayHeap, 663 sizeof (VBVAINFOSCREEN), 664 HGSMI_CH_VBVA, 665 VBVA_INFO_SCREEN); 666 if (!p) 667 { 668 DISPDBG((0, "VBoxDISP::vboxHwBufferFlush: HGSMIHeapAlloc failed\n")); 669 } 670 else 671 { 672 VBVAINFOSCREEN *pScreen = (VBVAINFOSCREEN *)p; 673 674 pScreen->i32OriginX = ppdev->ptlDevOrg.x; 675 pScreen->i32OriginY = ppdev->ptlDevOrg.y; 676 pScreen->u32LineSize = ppdev->lDeltaScreen > 0?ppdev->lDeltaScreen: -ppdev->lDeltaScreen; 677 pScreen->u32Width = ppdev->cxScreen; 678 pScreen->u32Height = ppdev->cyScreen; 679 pScreen->u16BitsPerPixel = (uint16_t)ppdev->ulBitCount; 680 pScreen->u16Flags = VBVA_SCREEN_F_ACTIVE; 681 682 vboxHGSMIBufferSubmit (ppdev, p); 683 684 HGSMIHeapFree (&ppdev->hgsmiDisplayHeap, p); 685 } 686 } 687 688 return; 646 689 } 647 690 #endif /* VBOX_WITH_HGSMI */
Note:
See TracChangeset
for help on using the changeset viewer.