Changeset 7274 in vbox for trunk/src/VBox/Additions/x11
- Timestamp:
- Mar 4, 2008 1:09:18 PM (17 years ago)
- Location:
- trunk/src/VBox/Additions/x11
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/x11/xgraphics/vboxutils.c
r7168 r7274 35 35 #endif 36 36 #ifdef DEBUG_X 37 #define TRACE_ENTRY() for (;;)\37 #define TRACE_ENTRY() do \ 38 38 { \ 39 39 ErrorF ("%s\n", __FUNCTION__); \ 40 break; \ 41 } 40 } while(0) 41 #define TRACE_LINE() do \ 42 { \ 43 ErrorF ("%s: line %d\n", __FUNCTION__, __LINE__); \ 44 } while(0) 42 45 #define PUT_PIXEL(c) ErrorF ("%c", c) 43 46 #define dolog(...) ErrorF (__VA_ARGS__) 44 47 #else 45 #define PUT_PIXEL(c) (void) c 46 #define TRACE_ENTRY() (void) 0 47 #define dolog(...) 48 #define PUT_PIXEL(c) do { } while(0) 49 #define TRACE_ENTRY() do { } while(0) 50 #define TRACE_LINE() do { } while(0) 51 #define dolog(...) do { } while(0) 48 52 #endif 49 53 … … 96 100 97 101 static Bool 98 vbox_host_can_hwcursor(ScrnInfoPtr pScrn, VBOXPtr pVBox) 99 { 100 VMMDevReqMouseStatus req; 101 int rc; 102 int scrnIndex = pScrn->scrnIndex; 103 104 uint32_t fFeatures; 105 NOREF(req); 106 rc = VbglR3GetMouseStatus(&fFeatures, NULL, NULL); 107 if (VBOX_FAILURE(rc)) 108 RETERROR(scrnIndex, FALSE, 109 "Unable to determine whether the virtual machine supports mouse pointer integration - request initialization failed with return code %d\n", rc); 110 111 return (fFeatures & VBOXGUEST_MOUSE_HOST_CANNOT_HWPOINTER) ? FALSE : TRUE; 112 } 102 vbox_host_uses_hwcursor(ScrnInfoPtr pScrn) 103 { 104 Bool rc = FALSE; 105 uint32_t fFeatures = 0; 106 107 TRACE_ENTRY(); 108 int vrc = VbglR3GetMouseStatus(&fFeatures, NULL, NULL); 109 if (VBOX_FAILURE(vrc)) 110 xf86DrvMsg(pScrn->scrnIndex, X_ERROR, 111 "Unable to determine whether the virtual machine supports mouse pointer integration - request initialization failed with return code %d\n", vrc); 112 else 113 { 114 if ( !(fFeatures & VBOXGUEST_MOUSE_HOST_CANNOT_HWPOINTER) 115 && (fFeatures & VBOXGUEST_MOUSE_GUEST_CAN_ABSOLUTE)) 116 rc = TRUE; 117 } 118 return rc; 119 } 120 113 121 114 122 void … … 346 354 pVBox->reqp = p; 347 355 pVBox->pCurs = NULL; 348 pVBox->useHwCursor = vbox_host_can_hwcursor(pScrn, pVBox);349 356 pVBox->pointerHeaderSize = size; 350 357 pVBox->pointerOffscreen = FALSE; … … 472 479 { 473 480 ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; 474 VBOXPtr pVBox = pScrn->driverPrivate; 475 return pVBox->useHwCursor; 481 return vbox_host_uses_hwcursor(pScrn); 476 482 } 477 483 … … 534 540 dolog ("w=%d h=%d sm=%d sr=%d p=%d\n", 535 541 w, h, (int) sizeMask, (int) sizeRgba, (int) dstPitch); 536 dolog ("m=%p c=%p cp=%p\n", m, c, cp);542 dolog ("m=%p c=%p cp=%p\n", m, c, (void *)cp); 537 543 538 544 fc = color_to_byte (pCurs->foreBlue) … … 615 621 { 616 622 ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; 617 return pCurs->bits->height <= VBOX_MAX_CURSOR_HEIGHT 618 && pCurs->bits->width <= VBOX_MAX_CURSOR_WIDTH 619 && pScrn->bitsPerPixel > 8; 620 } 623 Bool rc = TRUE; 624 625 if (!vbox_host_uses_hwcursor(pScrn)) 626 rc = FALSE; 627 if ( rc 628 && ( (pCurs->bits->height > VBOX_MAX_CURSOR_HEIGHT) 629 || (pCurs->bits->width > VBOX_MAX_CURSOR_WIDTH) 630 || (pScrn->bitsPerPixel <= 8) 631 ) 632 ) 633 rc = FALSE; 634 return rc; 635 } 636 621 637 622 638 static void … … 715 731 xf86CursorInfoPtr pCurs; 716 732 Bool rc; 717 718 if (pVBox->useHwCursor)719 {720 xf86DrvMsg(pScrn->scrnIndex, X_INFO,721 "The host system is drawing the mouse cursor.\n");722 }723 else724 {725 xf86DrvMsg(pScrn->scrnIndex, X_INFO,726 "The guest system is drawing the mouse cursor.\n");727 return TRUE;728 }729 733 730 734 pVBox->pCurs = pCurs = xf86CreateCursorInfoRec(); -
trunk/src/VBox/Additions/x11/xgraphics/vboxutils_68.c
r7086 r7274 40 40 #endif 41 41 #ifdef DEBUG_X 42 #define TRACE_ENTRY() for (;;) { \ 43 ErrorF ("%s\n", __FUNCTION__); \ 44 break; \ 45 } 42 #define TRACE_ENTRY() do \ 43 { \ 44 ErrorF ("%s\n", __FUNCTION__); \ 45 } while(0) 46 #define TRACE_LINE() do \ 47 { \ 48 ErrorF ("%s: line %d\n", __FUNCTION__, __LINE__); \ 49 } while(0) 46 50 #define PUT_PIXEL(c) ErrorF ("%c", c) 47 51 #define dolog(...) ErrorF (__VA_ARGS__) 48 52 #else 49 #define PUT_PIXEL(c) (void) c 50 #define TRACE_ENTRY() (void) 0 51 #define dolog(...) 53 #define PUT_PIXEL(c) do { } while(0) 54 #define TRACE_ENTRY() do { } while(0) 55 #define TRACE_LINE() do { } while(0) 56 #define dolog(...) do { } while(0) 52 57 #endif 53 58 … … 130 135 131 136 static Bool 132 vbox_host_can_hwcursor(ScrnInfoPtr pScrn, VBOXPtr pVBox) 133 { 137 vbox_host_uses_hwcursor(ScrnInfoPtr pScrn) 138 { 139 Bool rc = FALSE; 140 VBOXPtr pVBox = pScrn->driverPrivate; 134 141 VMMDevReqMouseStatus req; 135 int rc; 136 int scrnIndex = pScrn->scrnIndex; 137 138 #ifdef RT_OS_SOLARIS 139 uint32_t fFeatures; 140 NOREF(req); 141 rc = VbglR3GetMouseStatus(&fFeatures, NULL, NULL); 142 if (VBOX_FAILURE(rc)) 143 RETERROR(scrnIndex, FALSE, 142 143 int vrc = vmmdevInitRequest ((VMMDevRequestHeader*)&req, VMMDevReq_GetMouseStatus); 144 if (RT_FAILURE (vrc)) 145 xf86DrvMsg(pScrn->scrnIndex, X_ERROR, 144 146 "Unable to determine whether the virtual machine supports mouse pointer integration - request initialization failed with return code %d\n", rc); 145 146 return (fFeatures & VBOXGUEST_MOUSE_HOST_CANNOT_HWPOINTER) ? FALSE : TRUE; 147 #else 148 rc = vmmdevInitRequest ((VMMDevRequestHeader*)&req, VMMDevReq_GetMouseStatus); 149 if (VBOX_FAILURE (rc)) 150 RETERROR(scrnIndex, FALSE, 151 "Unable to determine whether the virtual machine supports mouse pointer integration - request initialization failed with return code %d\n", rc); 152 153 if (ioctl(pVBox->vbox_fd, IOCTL_VBOXGUEST_VMMREQUEST, (void*)&req) < 0) 154 RETERROR(scrnIndex, FALSE, 147 if ( RT_SUCCESS(vrc) 148 && (ioctl(pVBox->vbox_fd, IOCTL_VBOXGUEST_VMMREQUEST, (void*)&req) < 0)) 149 { 150 vrc = VERR_FILE_IO_ERROR; 151 xf86DrvMsg(pScrn->scrnIndex, X_ERROR, 155 152 "Unable to determine whether the virtual machine supports mouse pointer integration - request system call failed: %s.\n", 156 153 strerror(errno)); 157 158 return (req.mouseFeatures & VBOXGUEST_MOUSE_HOST_CANNOT_HWPOINTER) ? FALSE : TRUE; 159 #endif 160 } 154 } 155 if ( RT_SUCCESS(rc) 156 && !(req.mouseFeatures & VBOXGUEST_MOUSE_HOST_CANNOT_HWPOINTER) 157 && (req.mouseFeatures & VBOXGUEST_MOUSE_GUEST_CAN_ABSOLUTE)) 158 rc = TRUE; 159 return rc; 160 } 161 161 162 162 163 void … … 479 480 pVBox->reqp = p; 480 481 pVBox->pCurs = NULL; 481 pVBox->useHwCursor = vbox_host_can_hwcursor(pScrn, pVBox);482 482 pVBox->pointerHeaderSize = size; 483 483 pVBox->pointerOffscreen = FALSE; … … 603 603 { 604 604 ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; 605 VBOXPtr pVBox = pScrn->driverPrivate; 606 return pVBox->useHwCursor; 605 return vbox_host_uses_hwcursor(pScrn); 607 606 } 608 607 … … 663 662 dolog ("w=%d h=%d sm=%d sr=%d p=%d\n", 664 663 w, h, (int) size_mask, (int) size_rgba, (int) dst_pitch); 665 dolog ("m=%p c=%p cp=%p\n", m, c, (void *) cp);664 dolog ("m=%p c=%p cp=%p\n", m, c, (void *) (void *)cp); 666 665 667 666 fc = color_to_byte (pCurs->foreBlue) … … 743 742 { 744 743 ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; 745 return pCurs->bits->height <= VBOX_MAX_CURSOR_HEIGHT 746 && pCurs->bits->width <= VBOX_MAX_CURSOR_WIDTH 747 && pScrn->bitsPerPixel > 8; 744 Bool rc = TRUE; 745 746 if (!vbox_host_uses_hwcursor(pScrn)) 747 rc = FALSE; 748 if ( rc 749 && ( (pCurs->bits->height > VBOX_MAX_CURSOR_HEIGHT) 750 || (pCurs->bits->width > VBOX_MAX_CURSOR_WIDTH) 751 || (pScrn->bitsPerPixel <= 8) 752 ) 753 ) 754 rc = FALSE; 755 return rc; 748 756 } 749 757 … … 846 854 xf86CursorInfoPtr pCurs; 847 855 Bool rc; 848 849 if (pVBox->useHwCursor)850 {851 xf86DrvMsg(pScrn->scrnIndex, X_INFO,852 "The host system is drawing the mouse cursor.\n");853 }854 else855 {856 xf86DrvMsg(pScrn->scrnIndex, X_INFO,857 "The guest system is drawing the mouse cursor.\n");858 return TRUE;859 }860 856 861 857 pVBox->pCurs = pCurs = xf86CreateCursorInfoRec (); -
trunk/src/VBox/Additions/x11/xgraphics/vboxvideo.h
r7168 r7274 75 75 /* VBE/DDC support */ 76 76 #include "vbe.h" 77 #ifdef XORG_7X78 77 #include "vbeModes.h" 79 #endif80 78 #include "xf86DDC.h" 81 79 … … 118 116 #include "afb.h" 119 117 #include "mfb.h" 120 #ifndef XORG_7X121 #include "cfb24_32.h"122 #endif123 118 124 119 #define VBOX_VERSION 4000 … … 137 132 PCITAG pciTag; 138 133 CARD16 maxBytesPerScanline; 139 #ifdef XORG_7X140 134 unsigned long mapPhys, mapOff; 141 135 int mapSize; /* video memory */ 142 #else143 int mapPhys, mapOff, mapSize; /* video memory */144 #endif145 136 void *base, *VGAbase; 146 137 CARD8 *state, *pstate; /* SVGA state */ … … 153 144 CloseScreenProcPtr CloseScreen; 154 145 OptionInfoPtr Options; 155 #ifdef XORG_7X156 146 IOADDRESS ioBase; 157 #endif /* XORG_7X defined */158 #if 0159 int vbox_fd;160 #endif161 147 VMMDevReqMousePointer *reqp; 162 148 xf86CursorInfoPtr pCurs; 163 Bool useHwCursor;164 149 size_t pointerHeaderSize; 165 150 size_t pointerSize; 166 151 Bool pointerOffscreen; 167 152 Bool useVbva; 168 #if 0169 VMMDevVideoAccelFlush *reqf;170 VMMDevVideoAccelEnable *reqe;171 #endif172 153 VMMDevMemory *pVMMDevMemory; 173 154 VBVAMEMORY *pVbvaMemory; 174 155 } VBOXRec, *VBOXPtr; 175 176 #ifndef XORG_7X177 typedef struct _ModeInfoData178 {179 int mode;180 VbeModeInfoBlock *data;181 VbeCRTCInfoBlock *block;182 } ModeInfoData;183 #endif184 156 185 157 extern Bool vbox_init(int scrnIndex); -
trunk/src/VBox/Additions/x11/xgraphics/vboxvideo_13.c
r7168 r7274 48 48 */ 49 49 50 #ifdef DEBUG 50 #ifdef DEBUG_VIDEO 51 51 52 52 #define TRACE \ … … 66 66 } while(0) 67 67 68 #else /* DEBUG not defined */68 #else /* DEBUG_VIDEO not defined */ 69 69 70 70 #define TRACE … … 72 72 #define TRACE3(...) 73 73 74 #endif /* DEBUG not defined */74 #endif /* DEBUG_VIDEO not defined */ 75 75 76 76 #ifdef XFree86LOADER -
trunk/src/VBox/Additions/x11/xgraphics/vboxvideo_68.c
r7168 r7274 50 50 #define DEBUG_VERB 2 51 51 52 #include "vboxvideo .h"52 #include "vboxvideo_68.h" 53 53 #include "version-generated.h" 54 54 -
trunk/src/VBox/Additions/x11/xgraphics/vboxvideo_68.h
r7086 r7274 145 145 VMMDevReqMousePointer *reqp; 146 146 xf86CursorInfoPtr pCurs; 147 Bool useHwCursor;148 147 size_t pointerHeaderSize; 149 148 size_t pointerSize; -
trunk/src/VBox/Additions/x11/xmouse/VBoxUtils.c
r6594 r7274 34 34 } 35 35 36 rc = VbglR3SetMouseStatus(VBOXGUEST_MOUSE_GUEST_CAN_ABSOLUTE | VBOXGUEST_MOUSE_GUEST_NEEDS_HOST_CURSOR);36 rc = VbglR3SetMouseStatus(VBOXGUEST_MOUSE_GUEST_CAN_ABSOLUTE /* | VBOXGUEST_MOUSE_GUEST_NEEDS_HOST_CURSOR */); 37 37 if (VBOX_FAILURE(rc)) 38 38 {
Note:
See TracChangeset
for help on using the changeset viewer.