Changeset 77869 in vbox
- Timestamp:
- Mar 25, 2019 11:15:32 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA.cpp
r77867 r77869 3335 3335 uint32_t RT_UNTRUSTED_VOLATILE_GUEST * const pFIFO = pThis->svga.pFIFOR3; 3336 3336 AssertReturnVoid(pThis->svga.pFIFOR3); 3337 if ( vmsvgaFIFOHasWork(pFIFO, pThis->svga.uLastCursorUpdateCount)3337 if ( vmsvgaFIFOHasWork(pFIFO, ASMAtomicReadU32(&pThis->svga.uLastCursorUpdateCount)) 3338 3338 && pThis->svga.fFIFOThreadSleeping) 3339 3339 { … … 3404 3404 /* 3405 3405 * Cursor update state (SVGA_FIFO_CAP_CURSOR_BYPASS_3). 3406 * Initialize with values that will trigger an update as soon as maybe. 3406 * 3407 * Initialize with values that will detect an update from the guest. 3408 * Make sure that if the guest never updates the cursor position, then the device does not report it. 3409 * The guest has to change the value of uLastCursorUpdateCount, when the cursor position is actually updated. 3410 * xLastCursor, yLastCursor and fLastCursorVisible are set to report the first update. 3407 3411 */ 3408 3412 uint32_t RT_UNTRUSTED_VOLATILE_GUEST * const pFIFO = pThis->svga.pFIFOR3; 3409 uint32_t uLastCursorCount = pThis->svga.uLastCursorUpdateCount = ~pFIFO[SVGA_FIFO_CURSOR_COUNT];3413 pThis->svga.uLastCursorUpdateCount = pFIFO[SVGA_FIFO_CURSOR_COUNT]; 3410 3414 uint32_t xLastCursor = ~pFIFO[SVGA_FIFO_CURSOR_X]; 3411 3415 uint32_t yLastCursor = ~pFIFO[SVGA_FIFO_CURSOR_Y]; … … 3432 3436 */ 3433 3437 if ( fBadOrDisabledFifo 3434 || !vmsvgaFIFOHasWork(pFIFO, uLastCursorCount))3438 || !vmsvgaFIFOHasWork(pFIFO, pThis->svga.uLastCursorUpdateCount)) 3435 3439 { 3436 3440 ASMAtomicWriteBool(&pThis->svga.fFIFOThreadSleeping, true); … … 3445 3449 # endif 3446 3450 if ( !fBadOrDisabledFifo 3447 && vmsvgaFIFOHasWork(pFIFO, uLastCursorCount))3451 && vmsvgaFIFOHasWork(pFIFO, pThis->svga.uLastCursorUpdateCount)) 3448 3452 rc = VINF_SUCCESS; 3449 3453 else … … 3467 3471 if (rc == VERR_TIMEOUT) 3468 3472 { 3469 if (!vmsvgaFIFOHasWork(pFIFO, uLastCursorCount))3473 if (!vmsvgaFIFOHasWork(pFIFO, pThis->svga.uLastCursorUpdateCount)) 3470 3474 { 3471 3475 cMsSleep = RT_MIN(cMsSleep + cMsIncSleep, cMsMaxSleep); … … 3476 3480 Log(("vmsvgaFIFOLoop: timeout\n")); 3477 3481 } 3478 else if (vmsvgaFIFOHasWork(pFIFO, uLastCursorCount))3482 else if (vmsvgaFIFOHasWork(pFIFO, pThis->svga.uLastCursorUpdateCount)) 3479 3483 STAM_REL_COUNTER_INC(&pSVGAState->StatFifoTodoWoken); 3480 3484 cMsSleep = cMsMinSleep; … … 3544 3548 { 3545 3549 uint32_t const uCursorUpdateCount = pFIFO[SVGA_FIFO_CURSOR_COUNT]; 3546 if (uCursorUpdateCount == uLastCursorCount)3550 if (uCursorUpdateCount == pThis->svga.uLastCursorUpdateCount) 3547 3551 { /* halfways likely */ } 3548 3552 else 3549 3553 { 3550 u LastCursorCount = vmsvgaFIFOUpdateCursor(pThis, pSVGAState, pFIFO, offFifoMin, uCursorUpdateCount,3551 &xLastCursor, &yLastCursor, &fLastCursorVisible);3554 uint32_t const uLastCursorCount = vmsvgaFIFOUpdateCursor(pThis, pSVGAState, pFIFO, offFifoMin, uCursorUpdateCount, 3555 &xLastCursor, &yLastCursor, &fLastCursorVisible); 3552 3556 ASMAtomicWriteU32(&pThis->svga.uLastCursorUpdateCount, uLastCursorCount); 3553 3557 }
Note:
See TracChangeset
for help on using the changeset viewer.