Changeset 7443 in vbox for trunk/src/VBox/Additions/x11
- Timestamp:
- Mar 13, 2008 3:56:58 PM (17 years ago)
- Location:
- trunk/src/VBox/Additions/x11/xgraphics
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/x11/xgraphics/vboxutils.c
r7440 r7443 315 315 316 316 Bool 317 vbox_init(int scrnIndex )317 vbox_init(int scrnIndex, VBOXPtr pVBox) 318 318 { 319 319 Bool rc = TRUE; … … 321 321 if (RT_FAILURE(vrc)) 322 322 { 323 xf86DrvMsg(scrnIndex, X_ERROR, "VbglR3Init failed rc=%d.\n", rc); 323 xf86DrvMsg(scrnIndex, X_ERROR, 324 "Failed to initialize the VirtualBox device (rc=%d) - make sure that the VirtualBox guest additions are properly installed. If you are not sure, try reinstalling them. The X Window graphics drivers will run in compatibility mode.\n", 325 vrc); 324 326 rc = FALSE; 325 327 } 328 pVBox->useDevice = rc; 326 329 return rc; 327 330 } … … 337 340 TRACE_ENTRY(); 338 341 342 if (!pVBox->useDevice) 343 return FALSE; 339 344 pVBox->useVbva = FALSE; 340 345 … … 733 738 Bool rc; 734 739 740 if (!pVBox->useDevice) 741 return FALSE; 735 742 pVBox->pCurs = pCurs = xf86CreateCursorInfoRec(); 736 743 if (!pCurs) … … 830 837 */ 831 838 Bool 832 vboxEnableGraphicsCap(void) 833 { 839 vboxEnableGraphicsCap(VBOXPtr pVBox) 840 { 841 if (!pVBox->useDevice) 842 return FALSE; 834 843 return RT_SUCCESS(VbglR3SetGuestCaps(VMMDEV_GUEST_SUPPORTS_GRAPHICS, 0)); 835 844 } … … 842 851 */ 843 852 Bool 844 vboxDisableGraphicsCap(void) 845 { 853 vboxDisableGraphicsCap(VBOXPtr pVBox) 854 { 855 if (!pVBox->useDevice) 856 return FALSE; 846 857 return RT_SUCCESS(VbglR3SetGuestCaps(0, VMMDEV_GUEST_SUPPORTS_GRAPHICS)); 847 858 } … … 860 871 Bool 861 872 vboxGetDisplayChangeRequest(ScrnInfoPtr pScrn, uint32_t *pcx, uint32_t *pcy, 862 uint32_t *pcBits, uint32_t *piDisplay) 863 { 873 uint32_t *pcBits, uint32_t *piDisplay, 874 VBOXPtr pVBox) 875 { 876 if (!pVBox->useDevice) 877 return FALSE; 864 878 int rc = VbglR3GetLastDisplayChangeRequest(pcx, pcy, pcBits, piDisplay); 865 879 if (RT_SUCCESS(rc)) … … 868 882 return FALSE; 869 883 } 870 -
trunk/src/VBox/Additions/x11/xgraphics/vboxvideo.h
r7440 r7443 150 150 size_t pointerSize; 151 151 Bool pointerOffscreen; 152 Bool useDevice; 152 153 Bool useVbva; 153 154 VMMDevMemory *pVMMDevMemory; … … 155 156 } VBOXRec, *VBOXPtr; 156 157 157 extern Bool vbox_init(int scrnIndex );158 extern Bool vbox_init(int scrnIndex, VBOXPtr pVBox); 158 159 extern Bool vbox_cursor_init (ScreenPtr pScreen); 159 extern Bool vbox_open (ScrnInfoPtr pScrn, ScreenPtr pScreen, VBOXPtr pVB OX);160 extern void vbox_close (ScrnInfoPtr pScrn, VBOXPtr pVB OX);160 extern Bool vbox_open (ScrnInfoPtr pScrn, ScreenPtr pScreen, VBOXPtr pVBox); 161 extern void vbox_close (ScrnInfoPtr pScrn, VBOXPtr pVBox); 161 162 162 163 extern Bool vboxEnableVbva(ScrnInfoPtr pScrn); 163 164 extern Bool vboxDisableVbva(ScrnInfoPtr pScrn); 164 165 165 extern Bool vboxEnableGraphicsCap( void);166 extern Bool vboxDisableGraphicsCap( void);166 extern Bool vboxEnableGraphicsCap(VBOXPtr pVBox); 167 extern Bool vboxDisableGraphicsCap(VBOXPtr pVBox); 167 168 168 169 extern Bool vboxGetDisplayChangeRequest(ScrnInfoPtr pScrn, uint32_t *pcx, 169 170 uint32_t *pcy, uint32_t *pcBits, 170 uint32_t *piDisplay );171 uint32_t *piDisplay, VBOXPtr pVBox); 171 172 172 173 #endif /* _VBOXVIDEO_H_ */ -
trunk/src/VBox/Additions/x11/xgraphics/vboxvideo_13.c
r7440 r7443 402 402 DisplayModePtr pModes = NULL; 403 403 ScrnInfoPtr pScrn = output->scrn; 404 VBOXPtr pVBox = VBOXGetRec(pScrn); 404 405 405 406 TRACE; 406 rc = vboxGetDisplayChangeRequest(pScrn, &x, &y, &bpp, &display );407 rc = vboxGetDisplayChangeRequest(pScrn, &x, &y, &bpp, &display, pVBox); 407 408 /* @todo - check the display number once we support multiple displays. */ 408 409 if (rc && (0 != x) && (0 != y)) { … … 652 653 VBOX_VERSION_STRING "\n"); 653 654 654 /* Initialise the guest library */655 if (!vbox_init(pScrn->scrnIndex))656 return FALSE;657 658 655 /* Get our private data from the ScrnInfoRec structure. */ 659 656 pVBox = VBOXGetRec(pScrn); 657 658 /* Initialise the guest library */ 659 vbox_init(pScrn->scrnIndex, pVBox); 660 660 661 661 /* Entity information seems to mean bus information. */ … … 709 709 710 710 /* We only support 16 and 24 bits depth (i.e. 16 and 32bpp) */ 711 if ( vboxGetDisplayChangeRequest(pScrn, &cx, &cy, &cBits, &iDisplay) 711 if ( vboxGetDisplayChangeRequest(pScrn, &cx, &cy, &cBits, &iDisplay, 712 pVBox) 712 713 && (cBits != 16)) 713 714 cBits = 24; … … 925 926 xf86DrvMsg(scrnIndex, X_INFO, 926 927 "The VBox video extensions are now enabled.\n"); 927 vboxEnableGraphicsCap(); 928 } else 929 xf86DrvMsg(scrnIndex, X_ERROR, "Failed to open the VBox system device - make sure that the VirtualBox guest additions are properly installed. If you are not sure, try reinstalling them.\n"); 928 vboxEnableGraphicsCap(pVBox); 929 } 930 930 return (TRUE); 931 931 } … … 948 948 if (pVBox->useVbva == TRUE) 949 949 vboxDisableVbva(pScrn); 950 vboxDisableGraphicsCap( );950 vboxDisableGraphicsCap(pVBox); 951 951 } 952 952 … … 959 959 if (pVBox->useVbva == TRUE) 960 960 vboxDisableVbva(pScrn); 961 vboxDisableGraphicsCap( );961 vboxDisableGraphicsCap(pVBox); 962 962 if (pScrn->vtSema) { 963 963 VBOXSaveRestore(xf86Screens[scrnIndex], MODE_RESTORE); … … 1078 1078 if (vboxEnableVbva(pScrn) != TRUE) /* Bad but not fatal */ 1079 1079 pVBox->useVbva = FALSE; 1080 vboxEnableGraphicsCap( );1080 vboxEnableGraphicsCap(pVBox); 1081 1081 return (TRUE); 1082 1082 } -
trunk/src/VBox/Additions/x11/xgraphics/vboxvideo_70.c
r7168 r7443 391 391 VBOX_VERSION_STRING "\n"); 392 392 393 /* Initialise the guest library */394 if (!vbox_init(pScrn->scrnIndex))395 return FALSE;396 397 393 /* Get our private data from the ScrnInfoRec structure. */ 398 394 pVBox = VBOXGetRec(pScrn); 395 396 /* Initialise the guest library */ 397 vbox_init(pScrn->scrnIndex, pVBox); 399 398 400 399 /* Entity information seems to mean bus information. */ … … 467 466 uint32_t cx, cy, iDisplay, cBits = 24; 468 467 469 if (vboxGetDisplayChangeRequest(pScrn, &cx, &cy, &cBits, &iDisplay)) 468 if (vboxGetDisplayChangeRequest(pScrn, &cx, &cy, &cBits, &iDisplay, 469 pVBox)) 470 470 { 471 471 /* We only support 16 and 24 bits depth (i.e. 16 and 32bpp) */ … … 739 739 xf86DrvMsg(scrnIndex, X_INFO, 740 740 "The VBox video extensions are now enabled.\n"); 741 } else 742 xf86DrvMsg(scrnIndex, X_ERROR, "Failed to open the VBox system device - make sure that the VirtualBox guest additions are properly installed. If you are not sure, try reinstalling them.\n"); 741 } 743 742 return (TRUE); 744 743 }
Note:
See TracChangeset
for help on using the changeset viewer.