Changeset 77151 in vbox for trunk/src/VBox
- Timestamp:
- Feb 4, 2019 4:06:24 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 128625
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA.cpp
r76985 r77151 3185 3185 } 3186 3186 3187 /** Send cursor position and visibility information from the FIFO to the 3188 * front-end. We handle global, not per-screen visibility information by 3189 * sending pfnVBVAMousePointerShape without shape data. */ 3190 static void vmsvgaFIFOUpdateCursor(PVGASTATE pVGAState, uint32_t RT_UNTRUSTED_VOLATILE_GUEST *pFIFO, uint32_t *pcLastX, uint32_t *pcLastY, uint32_t *pfLastVisible) 3191 { 3192 uint32_t uScreenId = pFIFO[SVGA_FIFO_CURSOR_SCREEN_ID]; 3193 uint32_t fFlags = VBVA_CURSOR_VALID_DATA; 3194 uint32_t fVisible; 3195 3196 /* Potentially race-prone, but not our design and Linux ignores it anyway. 3197 */ 3198 pFIFO[SVGA_FIFO_CURSOR_LAST_UPDATED] = pFIFO[SVGA_FIFO_CURSOR_COUNT]; 3199 fVisible = pFIFO[SVGA_FIFO_CURSOR_ON]; 3200 /* Check if anything has changed, as calling into pDrv is not light-weight. */ 3201 if ( *pcLastX == pFIFO[SVGA_FIFO_CURSOR_X] 3202 && *pcLastY == pFIFO[SVGA_FIFO_CURSOR_Y] 3203 && (uScreenId != SVGA_ID_INVALID || *pfLastVisible == fVisible)) 3204 return; 3205 *pcLastX = pFIFO[SVGA_FIFO_CURSOR_X]; 3206 *pcLastY = pFIFO[SVGA_FIFO_CURSOR_Y]; 3207 if (uScreenId != SVGA_ID_INVALID) 3208 fFlags |= VBVA_CURSOR_SCREEN_RELATIVE; 3209 if (uScreenId == SVGA_ID_INVALID && *pfLastVisible != fVisible) { 3210 *pfLastVisible = fVisible; 3211 pVGAState->pDrv->pfnVBVAMousePointerShape(pVGAState->pDrv, RT_BOOL(fVisible), false, 0, 0, 0, 0, NULL); 3212 } 3213 pVGAState->pDrv->pfnVBVAReportCursorPosition(pVGAState->pDrv, fFlags, uScreenId, *pcLastX, *pcLastY); 3214 } 3215 3187 3216 /* The async FIFO handling thread. */ 3188 3217 static DECLCALLBACK(int) vmsvgaFIFOLoop(PPDMDEVINS pDevIns, PPDMTHREAD pThread) … … 3245 3274 bool fBadOrDisabledFifo = false; 3246 3275 uint32_t RT_UNTRUSTED_VOLATILE_GUEST * const pFIFO = pThis->svga.pFIFOR3; 3276 uint32_t cCursorCount = pFIFO[SVGA_FIFO_CURSOR_COUNT]; 3277 uint32_t cLastCursorX = 0; 3278 uint32_t cLastCursorY = 0; 3279 uint32_t fLastCursorVisible = 0; 3280 /* Update cursor information before entering the loop to avoid having to 3281 * think about the initial value of COUNT or to put it in the saved state. 3282 */ 3283 vmsvgaFIFOUpdateCursor(pThis, pFIFO, &cLastCursorX, &cLastCursorY, &fLastCursorVisible); 3247 3284 while (pThread->enmState == PDMTHREADSTATE_RUNNING) 3248 3285 { … … 3275 3312 if (rc == VERR_TIMEOUT) 3276 3313 { 3277 if (pFIFO[SVGA_FIFO_NEXT_CMD] == pFIFO[SVGA_FIFO_STOP]) 3314 if ( pFIFO[SVGA_FIFO_NEXT_CMD] == pFIFO[SVGA_FIFO_STOP] 3315 && cCursorCount == pFIFO[SVGA_FIFO_CURSOR_COUNT]) 3278 3316 { 3279 3317 cMsSleep = RT_MIN(cMsSleep + cMsIncSleep, cMsMaxSleep); … … 3300 3338 continue; 3301 3339 } 3340 3341 /* Update the cursor position. */ 3342 cCursorCount = pFIFO[SVGA_FIFO_CURSOR_COUNT]; 3343 vmsvgaFIFOUpdateCursor(pThis, pFIFO, &cLastCursorX, &cLastCursorY, &fLastCursorVisible); 3302 3344 3303 3345 /*
Note:
See TracChangeset
for help on using the changeset viewer.