Changeset 53966 in vbox
- Timestamp:
- Jan 26, 2015 8:38:30 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
-
include/VBox/VBoxVideoGuest.h (modified) (2 diffs)
-
src/VBox/Additions/common/VBoxVideo/HGSMIBase.cpp (modified) (1 diff)
-
src/VBox/Additions/common/VBoxVideo/Modesetting.cpp (modified) (1 diff)
-
src/VBox/Additions/x11/VBoxClient/display.cpp (modified) (16 diffs)
-
src/VBox/Additions/x11/vboxvideo/getmode.c (modified) (6 diffs)
-
src/VBox/Additions/x11/vboxvideo/pointer.c (modified) (10 diffs)
-
src/VBox/Additions/x11/vboxvideo/setmode.c (modified) (5 diffs)
-
src/VBox/Additions/x11/vboxvideo/vboxvideo.c (modified) (6 diffs)
-
src/VBox/Additions/x11/vboxvideo/vboxvideo.h (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/VBoxVideoGuest.h
r53530 r53966 257 257 uint8_t *pPixels, 258 258 uint32_t cbLength); 259 RTDECL(int) VBoxHGSMICursorPosition(PHGSMIGUESTCOMMANDCONTEXT pCtx, bool fReportPosition, uint32_t x, uint32_t y, 260 uint32_t *pxHost, uint32_t *pyHost); 259 261 260 262 /** @} */ … … 329 331 uint16_t cBPP, 330 332 uint16_t fFlags); 333 RTDECL(int) VBoxHGSMIUpdateInputMapping(PHGSMIGUESTCOMMANDCONTEXT pCtx, int32_t cOriginX, int32_t cOriginY, 334 uint32_t cWidth, uint32_t cHeight); 331 335 RTDECL(int) VBoxHGSMIGetModeHints(PHGSMIGUESTCOMMANDCONTEXT pCtx, 332 336 unsigned cScreens, VBVAMODEHINT *paHints); -
trunk/src/VBox/Additions/common/VBoxVideo/HGSMIBase.cpp
r53530 r53966 581 581 582 582 583 /** 584 * Report the guest cursor position. The host may wish to use this information 585 * to re-position its own cursor (though this is currently unlikely). The 586 * current host cursor position is returned. 587 * @param pCtx The context containing the heap used. 588 * @param fReportPosition Are we reporting a position? 589 * @param x Guest cursor X position. 590 * @param y Guest cursor Y position. 591 * @param pxHost Host cursor X position is stored here. Optional. 592 * @param pyHost Host cursor Y position is stored here. Optional. 593 * @returns iprt status code. 594 * @returns VERR_NO_MEMORY HGSMI heap allocation failed. 595 */ 596 RTDECL(int) VBoxHGSMICursorPosition(PHGSMIGUESTCOMMANDCONTEXT pCtx, bool fReportPosition, uint32_t x, uint32_t y, 597 uint32_t *pxHost, uint32_t *pyHost) 598 { 599 int rc = VINF_SUCCESS; 600 VBVACURSORPOSITION *p; 601 LogRelFlowFunc(("x=%u, y=%u\n", (unsigned)x, (unsigned)y)); 602 603 /* Allocate the IO buffer. */ 604 p = (VBVACURSORPOSITION *)VBoxHGSMIBufferAlloc(pCtx, sizeof(VBVACURSORPOSITION), HGSMI_CH_VBVA, VBVA_CURSOR_POSITION); 605 if (p) 606 { 607 /* Prepare data to be sent to the host. */ 608 p->fReportPosition = fReportPosition ? 1 : 0; 609 p->x = x; 610 p->y = y; 611 rc = VBoxHGSMIBufferSubmit(pCtx, p); 612 if (RT_SUCCESS(rc)) 613 { 614 if (pxHost) 615 *pxHost = p->x; 616 if (pyHost) 617 *pyHost = p->y; 618 LogRelFlowFunc(("return: x=%u, y=%u\n", (unsigned)x, (unsigned)y)); 619 } 620 /* Free the IO buffer. */ 621 VBoxHGSMIBufferFree(pCtx, p); 622 } 623 else 624 rc = VERR_NO_MEMORY; 625 LogFunc(("rc = %d\n", rc)); 626 return rc; 627 } 628 629 583 630 /** @todo Mouse pointer position to be read from VMMDev memory, address of the memory region 584 631 * can be queried from VMMDev via an IOCTL. This VMMDev memory region will contain -
trunk/src/VBox/Additions/common/VBoxVideo/Modesetting.cpp
r53530 r53966 280 280 } 281 281 282 283 /** Report the rectangle relative to which absolute pointer events should be 284 * expressed. This information remains valid until the next VBVA resize event 285 * for any screen, at which time it is reset to the bounding rectangle of all 286 * virtual screens. 287 * @param pCtx The context containing the heap to use. 288 * @param cOriginX Upper left X co-ordinate relative to the first screen. 289 * @param cOriginY Upper left Y co-ordinate relative to the first screen. 290 * @param cWidth Rectangle width. 291 * @param cHeight Rectangle height. 292 * @returns iprt status code. 293 * @returns VERR_NO_MEMORY HGSMI heap allocation failed. 294 */ 295 RTDECL(int) VBoxHGSMIUpdateInputMapping(PHGSMIGUESTCOMMANDCONTEXT pCtx, int32_t cOriginX, int32_t cOriginY, 296 uint32_t cWidth, uint32_t cHeight) 297 { 298 int rc = VINF_SUCCESS; 299 VBVAREPORTINPUTMAPPING *p; 300 LogRelFlowFunc(("cOriginX=%u, cOriginY=%u, cWidth=%u, cHeight=%u\n", 301 (unsigned)cOriginX, (unsigned)cOriginX, 302 (unsigned)cWidth, (unsigned)cHeight)); 303 304 /* Allocate the IO buffer. */ 305 p = (VBVAREPORTINPUTMAPPING *)VBoxHGSMIBufferAlloc(pCtx, sizeof(VBVAREPORTINPUTMAPPING), HGSMI_CH_VBVA, 306 VBVA_REPORT_INPUT_MAPPING); 307 if (p) 308 { 309 /* Prepare data to be sent to the host. */ 310 p->x = cOriginX; 311 p->y = cOriginY; 312 p->cx = cWidth; 313 p->cy = cHeight; 314 rc = VBoxHGSMIBufferSubmit(pCtx, p); 315 /* Free the IO buffer. */ 316 VBoxHGSMIBufferFree(pCtx, p); 317 } 318 else 319 rc = VERR_NO_MEMORY; 320 LogFunc(("rc = %d\n", rc)); 321 return rc; 322 } 323 324 282 325 /** 283 326 * Get most recent video mode hints. -
trunk/src/VBox/Additions/x11/VBoxClient/display.cpp
r53624 r53966 25 25 #include <X11/Xlib.h> 26 26 #include <X11/Xatom.h> 27 #include <X11/cursorfont.h>28 27 29 28 #include <iprt/assert.h> … … 39 38 #include "VBoxClient.h" 40 39 41 /** State information we need for interacting with the X server. */ 42 struct x11State 43 { 40 /* TESTING: Dynamic resizing and mouse integration toggling should work 41 * correctly with a range of X servers (pre-1.3, 1.3 and later under Linux, 1.3 42 * and later under Solaris) with Guest Additions installed. Switching to a 43 * virtual terminal while a user session is in place should disable dynamic 44 * resizing and cursor integration, switching back should re-enable them. */ 45 46 /** Most recent information received for a particular screen. */ 47 struct screenInformation 48 { 49 unsigned cx; 50 unsigned cy; 51 unsigned cBPP; 52 unsigned x; 53 unsigned y; 54 bool fEnabled; 55 bool fUpdateSize; 56 bool fUpdatePosition; 57 }; 58 59 /** Display magic number, start of a UUID. */ 60 #define DISPLAYSTATE_MAGIC UINT32_C(0xf0029993) 61 62 /** State information needed for the service. The main VBoxClient code provides 63 * the daemon logic needed by all services. */ 64 struct DISPLAYSTATE 65 { 66 /** The service interface. */ 67 struct VBCLSERVICE *pInterface; 68 /** Magic number for sanity checks. */ 69 uint32_t magic; 70 /** Are we initialised yet? */ 71 bool mfInit; 44 72 /** The connection to the server. */ 45 73 Display *pDisplay; … … 50 78 * would it make sense to use absolute paths on all systems? */ 51 79 const char *pcszXrandr; 52 /** The size of our array of size hints. */ 53 unsigned cSizeHints; 54 /** Array of size hints. Large enough to hold the highest display 55 * number we have had a hint for so far, reallocated when a higher one 56 * comes. Zero means no hint for that display. */ 57 long *paSizeHints; 80 /** The number of screens we are currently aware of. */ 81 unsigned cScreensTracked; 82 /** Array of information about different screens. */ 83 struct screenInformation *paScreenInformation; 58 84 }; 59 85 … … 92 118 } 93 119 94 static int init X11(struct x11State*pState)120 static int initDisplay(struct DISPLAYSTATE *pState) 95 121 { 96 122 char szCommand[256]; … … 111 137 if (WEXITSTATUS(status) == 0) 112 138 pState->fHaveRandR12 = true; 113 pState->cS izeHints= 0;114 pState->paS izeHints= NULL;139 pState->cScreensTracked = 0; 140 pState->paScreenInformation = NULL; 115 141 return VINF_SUCCESS; 116 142 } 117 143 118 static void setModeX11(struct x11State *pState, unsigned cx, unsigned cy, 119 unsigned cBPP, unsigned iDisplay, unsigned x, 120 unsigned y, bool fEnabled, bool fChangeOrigin) 144 static void updateScreenInformation(struct DISPLAYSTATE *pState, unsigned cx, unsigned cy, unsigned cBPP, unsigned iDisplay, 145 unsigned x, unsigned y, bool fEnabled, bool fUpdatePosition) 146 { 147 uint32_t i; 148 149 if (iDisplay >= pState->cScreensTracked) 150 { 151 pState->paScreenInformation = 152 (struct screenInformation *)RTMemRealloc(pState->paScreenInformation, 153 (iDisplay + 1) * sizeof(*pState->paScreenInformation)); 154 if (!pState->paScreenInformation) 155 VBClFatalError(("Failed to re-allocate screen information.\n")); 156 for (i = pState->cScreensTracked; i < iDisplay + 1; ++i) 157 RT_ZERO(pState->paScreenInformation[i]); 158 pState->cScreensTracked = iDisplay + 1; 159 } 160 pState->paScreenInformation[iDisplay].cx = cx; 161 pState->paScreenInformation[iDisplay].cy = cy; 162 pState->paScreenInformation[iDisplay].cBPP = cBPP; 163 pState->paScreenInformation[iDisplay].x = x; 164 pState->paScreenInformation[iDisplay].y = y; 165 pState->paScreenInformation[iDisplay].fEnabled = fEnabled; 166 pState->paScreenInformation[iDisplay].fUpdateSize = true; 167 pState->paScreenInformation[iDisplay].fUpdatePosition = fUpdatePosition; 168 } 169 170 static void updateSizeHintsProperty(struct DISPLAYSTATE *pState) 171 { 172 int32_t *paSizeHints = (int32_t *)RTMemTmpAllocZ(pState->cScreensTracked * sizeof(int32_t)); 173 unsigned i; 174 175 if (paSizeHints == NULL) 176 VBClFatalError(("Failed to allocate size hint property memory.\n")); 177 for (i = 0; i < pState->cScreensTracked; ++i) 178 { 179 if ( pState->paScreenInformation[i].fEnabled 180 && pState->paScreenInformation[i].cx != 0 && pState->paScreenInformation[i].cy != 0) 181 paSizeHints[i] = (pState->paScreenInformation[i].cx & 0x8fff) << 16 | (pState->paScreenInformation[i].cy & 0x8fff); 182 else if (pState->paScreenInformation[i].cx != 0 && pState->paScreenInformation[i].cy != 0) 183 paSizeHints[i] = -1; 184 } 185 XChangeProperty(pState->pDisplay, DefaultRootWindow(pState->pDisplay), XInternAtom(pState->pDisplay, "VBOX_SIZE_HINTS", 0), 186 XA_INTEGER, 32, PropModeReplace, (unsigned char *)paSizeHints, pState->cScreensTracked); 187 XFlush(pState->pDisplay); 188 RTMemTmpFree(paSizeHints); 189 } 190 191 static void notifyXServer(struct DISPLAYSTATE *pState) 121 192 { 122 193 char szCommand[256]; 123 uint32_t i; 194 unsigned i; 195 bool fUpdateInformation = false; 124 196 125 197 /** @note The xrandr command can fail if something else accesses RandR at 126 198 * the same time. We just ignore failure for now and let the user try 127 199 * again as we do not know what someone else is doing. */ 128 if (iDisplay >= pState->cSizeHints) 200 for (i = 0; i < pState->cScreensTracked; ++i) 201 if (pState->paScreenInformation[i].fUpdateSize) 202 fUpdateInformation = true; 203 if ( !pState->fHaveRandR12 && pState->paScreenInformation[0].fUpdateSize 204 && pState->paScreenInformation[0].cx > 0 && pState->paScreenInformation[0].cy > 0) 129 205 { 130 pState->paSizeHints = (long *)RTMemRealloc(pState->paSizeHints, 131 (iDisplay + 1) 132 * sizeof(*pState->paSizeHints)); 133 if (!pState->paSizeHints) 134 VBClFatalError(("Failed to re-allocate size hint memory.\n")); 135 for (i = pState->cSizeHints; i < iDisplay + 1; ++i) 136 pState->paSizeHints[i] = 0; 137 pState->cSizeHints = iDisplay + 1; 206 RTStrPrintf(szCommand, sizeof(szCommand), "%s -s %ux%u", 207 pState->pcszXrandr, pState->paScreenInformation[0].cx, pState->paScreenInformation[0].cy); 208 system(szCommand); 209 pState->paScreenInformation[0].fUpdateSize = false; 138 210 } 139 if (!fEnabled || (cx != 0 && cy != 0)) 211 else if (pState->fHaveRandR12 && fUpdateInformation) 212 for (i = 0; i < pState->cScreensTracked; ++i) 213 { 214 if (pState->paScreenInformation[i].fUpdateSize) 215 { 216 RTStrPrintf(szCommand, sizeof(szCommand), "%s --output VGA-%u --preferred", pState->pcszXrandr, i); 217 system(szCommand); 218 } 219 if (pState->paScreenInformation[i].fUpdatePosition) 220 { 221 RTStrPrintf(szCommand, sizeof(szCommand), "%s --output VGA-%u --auto --pos %ux%u", 222 pState->pcszXrandr, i, pState->paScreenInformation[i].x, pState->paScreenInformation[i].y); 223 system(szCommand); 224 } 225 pState->paScreenInformation[i].fUpdateSize = pState->paScreenInformation[i].fUpdatePosition = false; 226 } 227 else 140 228 { 141 pState->paSizeHints[iDisplay] = (cx & 0x8fff) << 16 | (cy & 0x8fff); 142 XChangeProperty(pState->pDisplay, DefaultRootWindow(pState->pDisplay), 143 XInternAtom(pState->pDisplay, "VBOX_SIZE_HINTS", 0), 144 XA_INTEGER, 32, PropModeReplace, 145 (unsigned char *)pState->paSizeHints, 146 pState->cSizeHints); 147 XFlush(pState->pDisplay); 148 } 149 if (!pState->fHaveRandR12) 150 { 151 RTStrPrintf(szCommand, sizeof(szCommand), 152 "%s -s %ux%u", pState->pcszXrandr, cx, cy); 229 RTStrPrintf(szCommand, sizeof(szCommand), "%s", pState->pcszXrandr); 153 230 system(szCommand); 154 231 } 232 } 233 234 static void updateMouseCapabilities(struct DISPLAYSTATE *pState) 235 { 236 uint32_t fFeatures = 0; 237 int rc; 238 unsigned i; 239 240 rc = VbglR3GetMouseStatus(&fFeatures, NULL, NULL); 241 242 if (rc != VINF_SUCCESS) 243 VBClFatalError(("Failed to get mouse status, rc=%Rrc\n", rc)); 244 XChangeProperty(pState->pDisplay, DefaultRootWindow(pState->pDisplay), 245 XInternAtom(pState->pDisplay, "VBOX_MOUSE_CAPABILITIES", 0), XA_INTEGER, 32, PropModeReplace, 246 (unsigned char *)&fFeatures, 1); 247 XFlush(pState->pDisplay); 248 if (pState->fHaveRandR12) 249 for (i = 0; i < pState->cScreensTracked; ++i) 250 pState->paScreenInformation[i].fUpdateSize = true; 155 251 else 156 { 157 if (fChangeOrigin && fEnabled) 158 { 159 /* Extended Display support possible . Secondary monitor 160 * position supported */ 161 RTStrPrintf(szCommand, sizeof(szCommand), 162 "%s --output VGA-%u --auto --pos %ux%u", 163 pState->pcszXrandr, iDisplay, x, y); 164 system(szCommand); 165 } 166 if ((!fChangeOrigin || fEnabled) && cx != 0 && cy != 0) 167 { 168 RTStrPrintf(szCommand, sizeof(szCommand), 169 "%s --output VGA-%u --preferred", 170 pState->pcszXrandr, iDisplay); 171 system(szCommand); 172 } 173 if (!fEnabled) 174 { 175 /* disable the virtual monitor */ 176 RTStrPrintf(szCommand, sizeof(szCommand), 177 "%s --output VGA-%u --off", 178 pState->pcszXrandr, iDisplay); 179 system(szCommand); 180 } 181 } 252 pState->paScreenInformation[0].fUpdateSize = true; 182 253 } 183 254 184 255 /** 185 256 * Display change request monitor thread function. 186 * Before entering the loop, we re-read the last request187 * received, and if the first one received inside the188 * loop is identical we ignore it, because it is probably189 * stale.190 257 */ 191 static void runDisplay(struct x11State*pState)258 static void runDisplay(struct DISPLAYSTATE *pState) 192 259 { 193 260 int status, rc; 194 unsigned i, cScreens ;261 unsigned i, cScreensTracked; 195 262 char szCommand[256]; 196 Cursor hClockCursor = XCreateFontCursor(pState->pDisplay, XC_watch);197 Cursor hArrowCursor = XCreateFontCursor(pState->pDisplay, XC_left_ptr);198 263 199 264 LogRelFlowFunc(("\n")); 200 rc = VbglR3VideoModeGetHighestSavedScreen(&cScreens );265 rc = VbglR3VideoModeGetHighestSavedScreen(&cScreensTracked); 201 266 if (rc != VINF_SUCCESS && rc != VERR_NOT_SUPPORTED) 202 VBClFatalError(("Failed to get the number of saved screen modes, rc=%Rrc\n", 203 rc)); 267 VBClFatalError(("Failed to get the number of saved screen modes, rc=%Rrc\n", rc)); 268 /* Make sure that we have an entry for screen 1 at least. */ 269 updateScreenInformation(pState, 1024, 768, 0, 1, 0, 0, true, false); 204 270 if (rc == VINF_SUCCESS) 205 /* The "8" is to sanity test that VbglR3VideoModeGetHighestSavedScreen() 206 * worked right. */ 207 for (i = 0; i < RT_MAX(cScreens + 1, 8); ++i) 271 /* The "8" is for the sanity test below. */ 272 for (i = 0; i < RT_MAX(cScreensTracked + 1, 8); ++i) 208 273 { 209 274 unsigned cx = 0, cy = 0, cBPP = 0, x = 0, y = 0; … … 212 277 rc = VbglR3RetrieveVideoMode(i, &cx, &cy, &cBPP, &x, &y, 213 278 &fEnabled); 214 /* Sanity test . */215 if (i > cScreens && rc != VERR_NOT_FOUND)279 /* Sanity test for VbglR3VideoModeGetHighestSavedScreen(). */ 280 if (i > cScreensTracked && rc != VERR_NOT_FOUND) 216 281 VBClFatalError(("Internal error retrieving the number of saved screen modes.\n")); 217 282 if (rc == VINF_SUCCESS) 218 setModeX11(pState, cx, cy, cBPP, i, x, y, fEnabled, 219 true); 283 updateScreenInformation(pState, cx, cy, cBPP, i, x, y, fEnabled, true); 220 284 } 221 285 while (true) 222 286 { 223 287 uint32_t fEvents; 288 updateMouseCapabilities(pState); 289 updateSizeHintsProperty(pState); 290 notifyXServer(pState); 224 291 do 225 292 rc = VbglR3WaitEvent( VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST … … 229 296 if (RT_FAILURE(rc)) /* VERR_NO_MEMORY? */ 230 297 VBClFatalError(("event wait failed, rc=%Rrc\n", rc)); 231 if (fEvents & VMMDEV_EVENT_MOUSE_CAPABILITIES_CHANGED) 232 { 233 /* Jiggle the mouse pointer to trigger a switch to a software 234 * cursor if necessary. */ 235 XGrabPointer(pState->pDisplay, 236 DefaultRootWindow(pState->pDisplay), true, 0, 237 GrabModeAsync, GrabModeAsync, None, hClockCursor, 238 CurrentTime); 239 XFlush(pState->pDisplay); 240 XGrabPointer(pState->pDisplay, 241 DefaultRootWindow(pState->pDisplay), true, 0, 242 GrabModeAsync, GrabModeAsync, None, hArrowCursor, 243 CurrentTime); 244 XFlush(pState->pDisplay); 245 XUngrabPointer(pState->pDisplay, CurrentTime); 246 XFlush(pState->pDisplay); 247 } 248 /* And if it is a size hint, set the new size. */ 298 /* If it is a size hint, set the new size. */ 249 299 if (fEvents & VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST) 250 300 { 251 301 uint32_t cx = 0, cy = 0, cBPP = 0, iDisplay = 0, x = 0, y = 0; 252 bool fEnabled = true, f ChangeOrigin = true;302 bool fEnabled = true, fUpdatePosition = true; 253 303 VMMDevSeamlessMode Mode; 254 304 255 305 rc = VbglR3GetDisplayChangeRequest(&cx, &cy, &cBPP, &iDisplay, 256 306 &x, &y, &fEnabled, 257 &fChangeOrigin, true); 258 /* Extended display version not supported on host */ 307 &fUpdatePosition, true); 259 308 if (rc != VINF_SUCCESS) 260 309 VBClFatalError(("Failed to get display change request, rc=%Rrc\n", … … 262 311 else 263 312 LogRelFlowFunc(("Got size hint from host cx=%d, cy=%d, bpp=%d, iDisplay=%d, x=%d, y=%d fEnabled=%d\n", 264 cx, cy, cBPP, iDisplay, x, y, 265 fEnabled)); 313 cx, cy, cBPP, iDisplay, x, y, fEnabled)); 266 314 if (iDisplay > INT32_MAX) 267 315 VBClFatalError(("Received a size hint for too high display number %u\n", 268 316 (unsigned) iDisplay)); 317 updateScreenInformation(pState, cx, cy, cBPP, i, x, y, fEnabled, fUpdatePosition); 269 318 rc = VbglR3SeamlessGetLastEvent(&Mode); 270 319 if (RT_FAILURE(rc)) … … 277 326 VBClFatalError(("Failed to save size hint, rc=%Rrc\n", rc)); 278 327 } 279 setModeX11(pState, cx, cy, cBPP, iDisplay, x, y, fEnabled,280 fChangeOrigin);281 328 } 282 329 } 283 330 } 284 331 285 /** Display magic number, start of a UUID. */286 #define DISPLAYSERVICE_MAGIC 0xf0029993287 288 /** VBoxClient service class wrapping the logic for the display service while289 * the main VBoxClient code provides the daemon logic needed by all services.290 */291 struct DISPLAYSERVICE292 {293 /** The service interface. */294 struct VBCLSERVICE *pInterface;295 /** Magic number for sanity checks. */296 uint32_t magic;297 /** State related to the X server. */298 struct x11State mState;299 /** Are we initialised yet? */300 bool mfInit;301 };302 303 332 static const char *getPidFilePath() 304 333 { … … 306 335 } 307 336 308 static struct DISPLAYSERVICE *getClassFromInterface(struct VBCLSERVICE ** 309 ppInterface) 310 { 311 struct DISPLAYSERVICE *pSelf = (struct DISPLAYSERVICE *)ppInterface; 312 if (pSelf->magic != DISPLAYSERVICE_MAGIC) 337 static struct DISPLAYSTATE *getStateFromInterface(struct VBCLSERVICE **ppInterface) 338 { 339 struct DISPLAYSTATE *pSelf = (struct DISPLAYSTATE *)ppInterface; 340 if (pSelf->magic != DISPLAYSTATE_MAGIC) 313 341 VBClFatalError(("Bad display service object!\n")); 314 342 return pSelf; … … 317 345 static int init(struct VBCLSERVICE **ppInterface) 318 346 { 319 struct DISPLAYS ERVICE *pSelf = getClassFromInterface(ppInterface);347 struct DISPLAYSTATE *pSelf = getStateFromInterface(ppInterface); 320 348 int rc; 321 349 322 350 if (pSelf->mfInit) 323 351 return VERR_WRONG_ORDER; 324 rc = init X11(&pSelf->mState);352 rc = initDisplay(pSelf); 325 353 if (RT_FAILURE(rc)) 326 354 return rc; … … 333 361 static int run(struct VBCLSERVICE **ppInterface, bool fDaemonised) 334 362 { 335 struct DISPLAYS ERVICE *pSelf = getClassFromInterface(ppInterface);363 struct DISPLAYSTATE *pSelf = getStateFromInterface(ppInterface); 336 364 int rc; 337 365 … … 341 369 if (RT_FAILURE(rc)) 342 370 VBClFatalError(("Failed to start the VT monitor thread: %Rrc\n", rc)); 343 runDisplay( &pSelf->mState);371 runDisplay(pSelf); 344 372 return VERR_INTERNAL_ERROR; /* "Should never reach here." */ 345 373 } … … 347 375 static int pause(struct VBCLSERVICE **ppInterface) 348 376 { 349 struct DISPLAYS ERVICE *pSelf = getClassFromInterface(ppInterface);377 struct DISPLAYSTATE *pSelf = getStateFromInterface(ppInterface); 350 378 351 379 if (!pSelf->mfInit) … … 356 384 static int resume(struct VBCLSERVICE **ppInterface) 357 385 { 358 struct DISPLAYS ERVICE *pSelf = getClassFromInterface(ppInterface);386 struct DISPLAYSTATE *pSelf = getStateFromInterface(ppInterface); 359 387 360 388 if (!pSelf->mfInit) … … 381 409 struct VBCLSERVICE **VBClGetDisplayService() 382 410 { 383 struct DISPLAYSERVICE *pService = 384 (struct DISPLAYSERVICE *)RTMemAlloc(sizeof(*pService)); 411 struct DISPLAYSTATE *pService = (struct DISPLAYSTATE *)RTMemAlloc(sizeof(*pService)); 385 412 386 413 if (!pService) 387 414 VBClFatalError(("Out of memory\n")); 388 415 pService->pInterface = &vbclDisplayInterface; 389 pService->magic = DISPLAYS ERVICE_MAGIC;416 pService->magic = DISPLAYSTATE_MAGIC; 390 417 pService->mfInit = false; 391 418 return &pService->pInterface; -
trunk/src/VBox/Additions/x11/vboxvideo/getmode.c
r53812 r53966 17 17 18 18 #include "vboxvideo.h" 19 #include <VBox/VMMDev.h> 19 20 20 21 #define NEED_XF86_TYPES … … 249 250 } 250 251 251 # define SIZE_HINTS_PROPERTY "VBOX_SIZE_HINTS" 252 static void updateUseHardwareCursor(VBOXPtr pVBox, uint32_t fCursorCapabilities) 253 { 254 bool fGuestCanReportAbsolutePosition = false; 255 bool fHostWishesToReportAbsolutePosition = false; 256 257 if ( (fCursorCapabilities & VMMDEV_MOUSE_GUEST_CAN_ABSOLUTE) 258 #if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 5 259 /* As of this version (server 1.6) all major Linux releases 260 * are known to handle USB tablets correctly. */ 261 || (fCursorCapabilities & VMMDEV_MOUSE_HOST_HAS_ABS_DEV) 262 #endif 263 ) 264 fGuestCanReportAbsolutePosition = true; 265 if ( !(fCursorCapabilities & VMMDEV_MOUSE_HOST_CANNOT_HWPOINTER) 266 && (fCursorCapabilities & VMMDEV_MOUSE_HOST_WANTS_ABSOLUTE)) 267 fHostWishesToReportAbsolutePosition = true; 268 pVBox->fUseHardwareCursor = fGuestCanReportAbsolutePosition && fHostWishesToReportAbsolutePosition; 269 } 270 271 # define SIZE_HINTS_PROPERTY "VBOX_SIZE_HINTS" 272 # define MOUSE_CAPABILITIES_PROPERTY "VBOX_MOUSE_CAPABILITIES" 252 273 253 274 /** Read in information about the most recent size hints requested for the 254 275 * guest screens. A client application sets the hint information as a root 255 276 * window property. */ 277 /* TESTING: dynamic resizing and absolute pointer toggling work on old guest X servers and recent ones on Linux at the log-in screen. */ 278 /** @note we try to maximise code coverage by typically using all code paths (HGSMI and properties) in a single X session. */ 256 279 void VBoxUpdateSizeHints(ScrnInfoPtr pScrn) 257 280 { 258 281 VBOXPtr pVBox = VBOXGetRec(pScrn); 259 size_t cModes ;260 int32_t *paMode s;282 size_t cModesFromProperty, cDummy; 283 int32_t *paModeHints, *pfCursorCapabilities; 261 284 unsigned i; 262 285 uint32_t fCursorCapabilities; 286 bool fOldUseHardwareCursor = pVBox->fUseHardwareCursor; 287 288 if (vbvxGetIntegerPropery(pScrn, SIZE_HINTS_PROPERTY, &cModesFromProperty, &paModeHints) != VINF_SUCCESS) 289 paModeHints = NULL; 290 if ( vbvxGetIntegerPropery(pScrn, MOUSE_CAPABILITIES_PROPERTY, &cDummy, &pfCursorCapabilities) != VINF_SUCCESS 291 || cDummy != 1) 292 pfCursorCapabilities = NULL; 263 293 #ifdef VBOXVIDEO_13 264 if ( RT_SUCCESS(VBoxHGSMIGetModeHints(&pVBox->guestCtx, pVBox->cScreens,265 pVBox->paVBVAModeHints)))294 if (!pVBox->fHaveReadHGSMIModeHintData && RT_SUCCESS(VBoxHGSMIGetModeHints(&pVBox->guestCtx, pVBox->cScreens, 295 pVBox->paVBVAModeHints))) 266 296 { 267 297 for (i = 0; i < pVBox->cScreens; ++i) … … 269 299 if (pVBox->paVBVAModeHints[i].magic == VBVAMODEHINT_MAGIC) 270 300 { 271 pVBox->pScreens[i].aPreferredSize.cx = 272 pVBox->paVBVAModeHints[i].cx;273 pVBox->pScreens[i].a PreferredSize.cy =274 pVBox->paVBVAModeHints[i].cy;275 pVBox->pScreens[i].afConnected =276 pVBox->p aVBVAModeHints[i].fEnabled;301 pVBox->pScreens[i].aPreferredSize.cx = pVBox->paVBVAModeHints[i].cx; 302 pVBox->pScreens[i].aPreferredSize.cy = pVBox->paVBVAModeHints[i].cy; 303 pVBox->pScreens[i].afConnected = pVBox->paVBVAModeHints[i].fEnabled; 304 /* Do not re-read this if we have data from HGSMI. */ 305 if (paModeHints != NULL && i < cModesFromProperty) 306 pVBox->pScreens[i].lastModeHintFromProperty = paModeHints[i]; 277 307 } 278 308 } 279 return; 280 } 309 } 310 if (!pVBox->fHaveReadHGSMIModeHintData) 311 { 312 if (RT_SUCCESS(VBoxQueryConfHGSMI(&pVBox->guestCtx, VBOX_VBVA_CONF32_CURSOR_CAPABILITIES, &fCursorCapabilities))) 313 updateUseHardwareCursor(pVBox, fCursorCapabilities); 314 else 315 pVBox->fUseHardwareCursor = false; 316 /* Do not re-read this if we have data from HGSMI. */ 317 if (pfCursorCapabilities != NULL) 318 pVBox->fLastCursorCapabilitiesFromProperty = *pfCursorCapabilities; 319 } 320 pVBox->fHaveReadHGSMIModeHintData = true; 281 321 #endif 282 if (vbvxGetIntegerPropery(pScrn, SIZE_HINTS_PROPERTY, &cModes, &paModes) != VINF_SUCCESS) 283 return; 284 for (i = 0; i < cModes && i < pVBox->cScreens; ++i) 285 { 286 if (paModes[i] != 0) 322 if (paModeHints != NULL) 323 for (i = 0; i < cModesFromProperty && i < pVBox->cScreens; ++i) 287 324 { 288 pVBox->pScreens[i].aPreferredSize.cx = 289 paModes[i] >> 16; 290 pVBox->pScreens[i].aPreferredSize.cy = 291 paModes[i] & 0x8fff; 325 if (paModeHints[i] != 0 && paModeHints[i] != pVBox->pScreens[i].lastModeHintFromProperty) 326 { 327 if (paModeHints[i] == -1) 328 pVBox->pScreens[i].afConnected = false; 329 else 330 { 331 pVBox->pScreens[i].aPreferredSize.cx = paModeHints[i] >> 16; 332 pVBox->pScreens[i].aPreferredSize.cy = paModeHints[i] & 0x8fff; 333 pVBox->pScreens[i].afConnected = true; 334 } 335 pVBox->pScreens[i].lastModeHintFromProperty = paModeHints[i]; 336 } 292 337 } 293 } 338 if (pfCursorCapabilities != NULL && *pfCursorCapabilities != pVBox->fLastCursorCapabilitiesFromProperty) 339 { 340 updateUseHardwareCursor(pVBox, (uint32_t)*pfCursorCapabilities); 341 pVBox->fLastCursorCapabilitiesFromProperty = *pfCursorCapabilities; 342 } 343 pVBox->fForceModeSet = (pVBox->fUseHardwareCursor != fOldUseHardwareCursor); 294 344 } 295 345 … … 302 352 static int (*g_pfnVBoxRandRSwappedProc)(ClientPtr) = NULL; 303 353 354 /* TESTING: dynamic resizing and toggling cursor integration work with older guest X servers (1.2 and older). */ 304 355 static void vboxRandRDispatchCore(ClientPtr pClient) 305 356 { … … 318 369 pScrn = xf86Screens[pWin->drawable.pScreen->myNum]; 319 370 pVBox = VBOXGetRec(pScrn); 371 TRACE_LOG("pVBox->fForceModeSet=%u, pVBox->fUseHardwareCursor=%u\n", (unsigned)pVBox->fForceModeSet, 372 pVBox->fUseHardwareCursor); 320 373 VBoxUpdateSizeHints(pScrn); 321 374 pMode = pScrn->modes; 322 375 if (pScrn->currentMode == pMode) 323 pMode = pMode->next; 376 { 377 if (pVBox->fForceModeSet) /* Swap modes so that the new mode is before the current one. */ 378 { 379 pScrn->currentMode = pMode->next; 380 pMode->next->HDisplay = pMode->HDisplay; 381 pMode->next->VDisplay = pMode->VDisplay; 382 } 383 else 384 pMode = pMode->next; 385 } 324 386 pMode->HDisplay = pVBox->pScreens[0].aPreferredSize.cx; 325 387 pMode->VDisplay = pVBox->pScreens[0].aPreferredSize.cy; 388 pVBox->fForceModeSet = false; 326 389 } 327 390 … … 413 476 #ifdef VBOXVIDEO_13 414 477 # ifdef RT_OS_LINUX 478 /* TESTING: dynamic resizing works on recent Linux guest X servers at the log-in screen. */ 479 /** @note to maximise code coverage we only read data from HGSMI once, and only when responding to an ACPI event. */ 415 480 static void acpiEventHandler(int fd, void *pvData) 416 481 { 482 ScreenPtr pScreen = (ScreenPtr)pvData; 483 VBOXPtr pVBox = VBOXGetRec(xf86Screens[pScreen->myNum]); 417 484 struct input_event event; 418 485 ssize_t rc; 419 486 420 RRGetInfo((ScreenPtr)pvData 487 pVBox->fHaveReadHGSMIModeHintData = false; 488 RRGetInfo(pScreen 421 489 # if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 5 422 490 , TRUE 423 491 # endif 424 492 ); 493 VBVXASSERT(pVBox->fHaveReadHGSMIModeHintData == true, ("fHaveReadHGSMIModeHintData not set.\n")); 425 494 do 426 495 rc = read(fd, &event, sizeof(event)); 427 496 while (rc > 0 || (rc == -1 && errno == EINTR)); 428 if (rc == -1 && errno != EAGAIN) /* Why not just return 0? */429 FatalError("Reading ACPI input event failed.\n");497 /* Why do they return EAGAIN instead of zero bytes read like everyone else does? */ 498 VBVXASSERT(rc != -1 || errno == EAGAIN, ("Reading ACPI input event failed.\n")); 430 499 } 431 500 -
trunk/src/VBox/Additions/x11/vboxvideo/pointer.c
r53428 r53966 15 15 */ 16 16 17 #include <VBox/VMMDev.h>18 17 #include <VBox/VBoxGuestLib.h> 19 18 … … 112 111 113 112 /************************************************************************** 114 * Helper functions and macros *115 **************************************************************************/116 117 /* This is called by the X server every time it loads a new cursor to see118 * whether our "cursor hardware" can handle the cursor. This provides us with119 * a mechanism (the only one!) to switch back from a software to a hardware120 * cursor. */121 static Bool122 vbox_host_uses_hwcursor(ScrnInfoPtr pScrn)123 {124 Bool rc = TRUE;125 uint32_t fFeatures = 0;126 VBOXPtr pVBox = pScrn->driverPrivate;127 128 /* We may want to force the use of a software cursor. Currently this is129 * needed if the guest uses a large virtual resolution, as in this case130 * the host and guest tend to disagree about the pointer location. */131 if (pVBox->forceSWCursor)132 rc = FALSE;133 /* Query information about mouse integration from the host. */134 if (rc) {135 int vrc = VbglR3GetMouseStatus(&fFeatures, NULL, NULL);136 if (RT_FAILURE(vrc))137 rc = FALSE;138 }139 /* If we got the information from the host then make sure the host wants140 * to draw the pointer. */141 if (rc)142 {143 if ( (fFeatures & VMMDEV_MOUSE_GUEST_CAN_ABSOLUTE)144 #if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 5145 /* As of this version (server 1.6) all major Linux releases146 * are known to handle USB tablets correctly. */147 || (fFeatures & VMMDEV_MOUSE_HOST_HAS_ABS_DEV)148 #endif149 )150 /* Assume this will never be unloaded as long as the X session is151 * running. */152 pVBox->guestCanAbsolute = TRUE;153 if ( (fFeatures & VMMDEV_MOUSE_HOST_CANNOT_HWPOINTER)154 || !pVBox->guestCanAbsolute155 || !(fFeatures & VMMDEV_MOUSE_HOST_WANTS_ABSOLUTE)156 )157 rc = FALSE;158 }159 return rc;160 }161 162 /**************************************************************************163 113 * Main functions * 164 114 **************************************************************************/ … … 174 124 } 175 125 176 Bool177 vbox_init(int scrnIndex, VBOXPtr pVBox)178 {179 Bool rc = TRUE;180 int vrc;181 uint32_t fMouseFeatures = 0;182 183 TRACE_ENTRY();184 vrc = VbglR3Init();185 if (RT_FAILURE(vrc))186 {187 xf86DrvMsg(scrnIndex, X_ERROR,188 "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",189 vrc);190 rc = FALSE;191 }192 pVBox->useDevice = rc;193 return rc;194 }195 196 126 static void 197 127 vbox_vmm_hide_cursor(ScrnInfoPtr pScrn, VBOXPtr pVBox) … … 200 130 201 131 rc = VBoxHGSMIUpdatePointerShape(&pVBox->guestCtx, 0, 0, 0, 0, 0, NULL, 0); 202 if (RT_FAILURE(rc)) 203 { 204 xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Could not hide the virtual mouse pointer, VBox error %d.\n", rc); 205 /* Play safe, and disable the hardware cursor until the next mode 206 * switch, since obviously something happened that we didn't 207 * anticipate. */ 208 pVBox->forceSWCursor = TRUE; 209 } 132 VBVXASSERT(rc == VINF_SUCCESS, ("Could not hide the virtual mouse pointer, VBox error %d.\n", rc)); 210 133 } 211 134 … … 215 138 int rc; 216 139 217 if (! vbox_host_uses_hwcursor(pScrn))140 if (!pVBox->fUseHardwareCursor) 218 141 return; 219 142 rc = VBoxHGSMIUpdatePointerShape(&pVBox->guestCtx, VBOX_MOUSE_POINTER_VISIBLE, 220 143 0, 0, 0, 0, NULL, 0); 221 if (RT_FAILURE(rc)) { 222 xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Could not unhide the virtual mouse pointer.\n"); 223 /* Play safe, and disable the hardware cursor until the next mode 224 * switch, since obviously something happened that we didn't 225 * anticipate. */ 226 pVBox->forceSWCursor = TRUE; 227 } 144 VBVXASSERT(rc == VINF_SUCCESS, ("Could not unhide the virtual mouse pointer.\n")); 228 145 } 229 146 … … 243 160 pImage->cHotX, pImage->cHotY, pImage->cWidth, pImage->cHeight, 244 161 pImage->pPixels, pImage->cbLength); 245 if (RT_FAILURE(rc)) { 246 xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Unable to set the virtual mouse pointer image.\n"); 247 /* Play safe, and disable the hardware cursor until the next mode 248 * switch, since obviously something happened that we didn't 249 * anticipate. */ 250 pVBox->forceSWCursor = TRUE; 251 } 162 VBVXASSERT(rc == VINF_SUCCESS, ("Unable to set the virtual mouse pointer image.\n")); 252 163 } 253 164 … … 265 176 vbox_set_cursor_position(ScrnInfoPtr pScrn, int x, int y) 266 177 { 267 /* Nothing to do here, as we are telling the guest where the mouse is, 268 * not vice versa. */ 269 NOREF(pScrn); 270 NOREF(x); 271 NOREF(y); 178 VBOXPtr pVBox = pScrn->driverPrivate; 179 180 /* This currently does nothing. */ 181 VBoxHGSMICursorPosition(&pVBox->guestCtx, true, x, y, NULL, NULL); 272 182 } 273 183 … … 300 210 { 301 211 ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; 302 return vbox_host_uses_hwcursor(pScrn); 212 VBOXPtr pVBox = pScrn->driverPrivate; 213 return pVBox->fUseHardwareCursor; 303 214 } 304 215 … … 433 344 { 434 345 ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; 435 Bool rc = TRUE; 436 437 if (!vbox_host_uses_hwcursor(pScrn)) 438 rc = FALSE; 439 if ( rc 440 && ( (pCurs->bits->height > VBOX_MAX_CURSOR_HEIGHT) 441 || (pCurs->bits->width > VBOX_MAX_CURSOR_WIDTH) 442 || (pScrn->bitsPerPixel <= 8) 443 ) 444 ) 445 rc = FALSE; 446 return rc; 346 VBOXPtr pVBox = pScrn->driverPrivate; 347 348 if (!pVBox->fUseHardwareCursor) 349 return FALSE; 350 if ( (pCurs->bits->height > VBOX_MAX_CURSOR_HEIGHT) 351 || (pCurs->bits->width > VBOX_MAX_CURSOR_WIDTH) 352 || (pScrn->bitsPerPixel <= 8)) 353 return FALSE; 354 return TRUE; 447 355 } 448 356 … … 565 473 #endif 566 474 567 /* Hide the host cursor before we initialise if we wish to use a568 * software cursor. */569 if (pVBox->forceSWCursor)570 vbox_vmm_hide_cursor(pScrn, pVBox);571 475 rc = xf86InitCursor(pScreen, pCurs); 572 476 } -
trunk/src/VBox/Additions/x11/vboxvideo/setmode.c
r53544 r53966 102 102 bool fEnabled; 103 103 uint16_t fFlags; 104 int rc; 104 105 105 106 TRACE_LOG("cDisplay=%u, cWidth=%u, cHeight=%u, x=%d, y=%d, displayWidth=%d\n", … … 132 133 offStart, pVBox->cbLine, cwReal, cHeight, 133 134 fEnabled ? vboxBPP(pScrn) : 0, fFlags); 135 if (cDisplay == 0) 136 { 137 rc = VBoxHGSMIUpdateInputMapping(&pVBox->guestCtx, 0 - pVBox->pScreens[0].aScreenLocation.x, 138 0 - pVBox->pScreens[0].aScreenLocation.y, pScrn->virtualX, pScrn->virtualY); 139 if (RT_FAILURE(rc)) 140 FatalError("Failed to update the input mapping.\n"); 141 } 134 142 return TRUE; 135 143 } … … 145 153 uint64_t cbLine = vboxLineLength(pScrn, width); 146 154 int displayWidth = vboxDisplayPitch(pScrn, cbLine); 155 int rc; 147 156 148 157 TRACE_LOG("width=%d, height=%d\n", width, height); … … 177 186 #ifdef VBOXVIDEO_13 178 187 /* Write the new values to the hardware */ 188 /** @todo why is this only for VBOXVIDEO_13? */ 179 189 { 180 190 unsigned i; … … 185 195 pVBox->pScreens[i].aScreenLocation.y); 186 196 } 197 #else 198 rc = VBoxHGSMIUpdateInputMapping(&pVBox->guestCtx, 0 - pVBox->pScreens[0].aScreenLocation.x, 199 0 - pVBox->pScreens[0].aScreenLocation.y, pScrn->virtualX, pScrn->virtualY); 200 if (RT_FAILURE(rc)) 201 FatalError("Failed to update the input mapping.\n"); 187 202 #endif 188 203 #ifdef RT_OS_SOLARIS -
trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo.c
r53812 r53966 455 455 } 456 456 457 static DisplayModePtr 458 vbox_output_add_mode (VBOXPtr pVBox, DisplayModePtr *pModes, 459 const char *pszName, int x, int y, 460 Bool isPreferred, Bool isUserDef) 457 static DisplayModePtr vbox_output_add_mode(VBOXPtr pVBox, DisplayModePtr *pModes, const char *pszName, int x, int y, 458 Bool isPreferred, Bool fDifferentRefresh, Bool isUserDef) 461 459 { 462 460 TRACE_LOG("pszName=%s, x=%d, y=%d\n", pszName ? pszName : "(null)", x, y); 463 461 DisplayModePtr pMode = xnfcalloc(1, sizeof(DisplayModeRec)); 462 int cRefresh = fDifferentRefresh ? 70 : 60; 464 463 465 464 pMode->status = MODE_OK; … … 482 481 pMode->VSyncEnd = pMode->VDisplay + 4; 483 482 pMode->VTotal = pMode->VDisplay + 6; 484 pMode->Clock = pMode->HTotal * pMode->VTotal * 60/ 1000; /* kHz */483 pMode->Clock = pMode->HTotal * pMode->VTotal * cRefresh / 1000; /* kHz */ 485 484 if (NULL == pszName) { 486 485 xf86SetModeDefaultName(pMode); … … 504 503 iScreen = (uintptr_t)output->driver_private; 505 504 VBoxUpdateSizeHints(pScrn); 506 pMode = vbox_output_add_mode(pVBox, &pModes, NULL, 507 pVBox->pScreens[iScreen].aPreferredSize.cx, 508 pVBox->pScreens[iScreen].aPreferredSize.cy, TRUE, 509 FALSE); 505 pMode = vbox_output_add_mode(pVBox, &pModes, NULL, pVBox->pScreens[iScreen].aPreferredSize.cx, 506 pVBox->pScreens[iScreen].aPreferredSize.cy, TRUE, pVBox->fUseHardwareCursor, FALSE); 510 507 VBOXEDIDSet(output, pMode); 511 508 /* Add standard modes supported by the host */ … … 515 512 if (cIndex == 0) 516 513 break; 517 vbox_output_add_mode(pVBox, &pModes, NULL, x, y, FALSE, FALSE );514 vbox_output_add_mode(pVBox, &pModes, NULL, x, y, FALSE, FALSE, FALSE); 518 515 } 519 516 … … 523 520 { 524 521 if (2 == sscanf(pScrn->display->modes[i], "%ux%u", &x, &y)) 525 vbox_output_add_mode(pVBox, &pModes, pScrn->display->modes[i], x, y, 526 FALSE, TRUE); 522 vbox_output_add_mode(pVBox, &pModes, pScrn->display->modes[i], x, y, FALSE, FALSE, TRUE); 527 523 } 528 524 TRACE_EXIT(); … … 798 794 return FALSE; 799 795 800 /* Initialise the guest library */801 vbox_init(pScrn->scrnIndex, pVBox);802 803 796 /* Entity information seems to mean bus information. */ 804 797 pVBox->pEnt = xf86GetEntityInfo(pScrn->entityList[0]); -
trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo.h
r53777 r53966 165 165 /** Has this screen been enabled by the host? */ 166 166 Bool afConnected; 167 /** The last mode hint data read from the X11 property. */ 168 int32_t lastModeHintFromProperty; 167 169 }; 168 170 … … 194 196 /** @todo we never actually free this */ 195 197 xf86CursorInfoPtr pCurs; 196 Bool useDevice; 197 Bool forceSWCursor; 198 /** Do we know that the guest can handle absolute co-ordinates? */ 199 Bool guestCanAbsolute; 198 /** Do we currently want to use the host cursor? */ 199 Bool fUseHardwareCursor; 200 /** Do we want to force a reset of the current mode because the host cursor support changed? Only used by old servers. */ 201 Bool fForceModeSet; 202 /** The last cursor capabilities data read from the X11 property. */ 203 int32_t fLastCursorCapabilitiesFromProperty; 200 204 /** Number of screens attached */ 201 205 uint32_t cScreens; … … 212 216 /** Input handler handle for ACPI hot-plug listener. */ 213 217 void *hACPIEventHandler; 218 /** Have we read all available HGSMI mode hint data? */ 219 bool fHaveReadHGSMIModeHintData; 214 220 # endif 215 221 #else … … 242 248 243 249 /* setmode.c */ 244 extern Bool vbox_init(int scrnIndex, VBOXPtr pVBox);245 250 extern Bool vbox_cursor_init (ScreenPtr pScreen); 246 251 extern void vbox_open (ScrnInfoPtr pScrn, ScreenPtr pScreen, VBOXPtr pVBox); 247 252 extern void vbox_close (ScrnInfoPtr pScrn, VBOXPtr pVBox); 248 extern Bool vbox_device_available(VBOXPtr pVBox);249 253 250 254 extern Bool vboxEnableVbva(ScrnInfoPtr pScrn);
Note:
See TracChangeset
for help on using the changeset viewer.

