Changeset 35305 in vbox
- Timestamp:
- Dec 22, 2010 4:37:14 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
Config.kmk (modified) (1 diff)
-
src/VBox/Main/DisplayImpl.cpp (modified) (36 diffs)
-
src/VBox/Main/Makefile.kmk (modified) (1 diff)
-
src/VBox/Main/include/DisplayImpl.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Config.kmk
r35303 r35305 357 357 VBOX_WITH_VDMA = 1 358 358 VBOX_WITH_CRHGSMI = 1 359 # Enable VBVA lock360 VBOX_WITH_OLD_VBVA_LOCK = 1361 359 # Disable the Intel PXE ROM (uses Etherboot). 362 360 VBOX_WITH_INTEL_PXE = -
trunk/src/VBox/Main/DisplayImpl.cpp
r35304 r35305 116 116 mLastHeight = 0; 117 117 118 #ifdef VBOX_WITH_OLD_VBVA_LOCK119 118 int rc = RTCritSectInit(&mVBVALock); 120 119 AssertRC(rc); 121 120 mfu32PendingVideoAccelDisable = false; 122 #endif /* VBOX_WITH_OLD_VBVA_LOCK */123 121 124 122 #ifdef VBOX_WITH_HGSMI … … 133 131 uninit(); 134 132 135 #ifdef VBOX_WITH_OLD_VBVA_LOCK136 133 if (RTCritSectIsInitialized (&mVBVALock)) 137 134 { … … 139 136 memset (&mVBVALock, 0, sizeof (mVBVALock)); 140 137 } 141 #endif /* VBOX_WITH_OLD_VBVA_LOCK */142 138 } 143 139 … … 232 228 233 229 /* SSM code is executed on EMT(0), therefore no need to use VMR3ReqCallWait. */ 234 #ifdef VBOX_WITH_OLD_VBVA_LOCK235 230 int rc = Display::displayTakeScreenshotEMT(that, VBOX_VIDEO_PRIMARY_SCREEN, &pu8Data, &cbData, &cx, &cy); 236 #else237 int rc = that->mpDrv->pUpPort->pfnTakeScreenshot (that->mpDrv->pUpPort, &pu8Data, &cbData, &cx, &cy);238 #endif /* !VBOX_WITH_OLD_VBVA_LOCK */239 231 240 232 /* … … 892 884 void Display::handleDisplayUpdate (unsigned uScreenId, int x, int y, int w, int h) 893 885 { 894 #ifdef VBOX_WITH_OLD_VBVA_LOCK895 886 /* 896 887 * Always runs under either VBVA lock or, for HGSMI, DevVGA lock. 897 888 * Safe to use VBVA vars and take the framebuffer lock. 898 889 */ 899 #endif /* VBOX_WITH_OLD_VBVA_LOCK */900 890 901 891 #ifdef DEBUG_sunlover … … 1299 1289 } 1300 1290 1301 #ifdef VBOX_WITH_OLD_VBVA_LOCK1302 1291 int Display::vbvaLock(void) 1303 1292 { … … 1309 1298 RTCritSectLeave(&mVBVALock); 1310 1299 } 1311 #endif /* VBOX_WITH_OLD_VBVA_LOCK */1312 1300 1313 1301 /** 1314 1302 * @thread EMT 1315 1303 */ 1316 #ifdef VBOX_WITH_OLD_VBVA_LOCK1317 1304 int Display::VideoAccelEnable (bool fEnable, VBVAMEMORY *pVbvaMemory) 1318 1305 { … … 1323 1310 return rc; 1324 1311 } 1325 #endif /* VBOX_WITH_OLD_VBVA_LOCK */ 1326 1327 #ifdef VBOX_WITH_OLD_VBVA_LOCK 1312 1328 1313 int Display::videoAccelEnable (bool fEnable, VBVAMEMORY *pVbvaMemory) 1329 #else1330 int Display::VideoAccelEnable (bool fEnable, VBVAMEMORY *pVbvaMemory)1331 #endif /* !VBOX_WITH_OLD_VBVA_LOCK */1332 1314 { 1333 1315 int rc = VINF_SUCCESS; … … 1378 1360 { 1379 1361 /* Process any pending orders and empty the VBVA ring buffer. */ 1380 #ifdef VBOX_WITH_OLD_VBVA_LOCK1381 1362 videoAccelFlush (); 1382 #else1383 VideoAccelFlush ();1384 #endif /* !VBOX_WITH_OLD_VBVA_LOCK */1385 1363 } 1386 1364 … … 1423 1401 mpVbvaMemory->indexRecordFree = 0; 1424 1402 1425 #ifdef VBOX_WITH_OLD_VBVA_LOCK1426 1403 mfu32PendingVideoAccelDisable = false; 1427 #endif /* VBOX_WITH_OLD_VBVA_LOCK */1428 1404 1429 1405 LogRel(("VBVA: Enabled.\n")); … … 1445 1421 LogFlowFunc(("fEnable = %d\n", fEnable)); 1446 1422 1447 #ifdef VBOX_WITH_OLD_VBVA_LOCK1448 1423 vbvaLock(); 1449 #endif /* VBOX_WITH_OLD_VBVA_LOCK */1450 1424 1451 1425 int c = fEnable? … … 1499 1473 Assert (mfVideoAccelVRDP == true); 1500 1474 } 1501 #ifdef VBOX_WITH_OLD_VBVA_LOCK1502 1475 vbvaUnlock(); 1503 #endif /* VBOX_WITH_OLD_VBVA_LOCK */1504 1476 } 1505 1477 … … 1775 1747 * @thread EMT 1776 1748 */ 1777 #ifdef VBOX_WITH_OLD_VBVA_LOCK1778 1749 void Display::VideoAccelFlush (void) 1779 1750 { … … 1782 1753 vbvaUnlock(); 1783 1754 } 1784 #endif /* VBOX_WITH_OLD_VBVA_LOCK */ 1785 1786 #ifdef VBOX_WITH_OLD_VBVA_LOCK 1755 1787 1756 /* Under VBVA lock. DevVGA is not taken. */ 1788 1757 void Display::videoAccelFlush (void) 1789 #else1790 void Display::VideoAccelFlush (void)1791 #endif /* !VBOX_WITH_OLD_VBVA_LOCK */1792 1758 { 1793 1759 #ifdef DEBUG_sunlover_2 … … 1817 1783 /* Process the ring buffer */ 1818 1784 unsigned uScreenId; 1819 #ifndef VBOX_WITH_OLD_VBVA_LOCK1820 for (uScreenId = 0; uScreenId < mcMonitors; uScreenId++)1821 {1822 if (!maFramebuffers[uScreenId].pFramebuffer.isNull())1823 {1824 maFramebuffers[uScreenId].pFramebuffer->Lock ();1825 }1826 }1827 #endif /* !VBOX_WITH_OLD_VBVA_LOCK */1828 1785 1829 1786 /* Initialize dirty rectangles accumulator. */ … … 1843 1800 1844 1801 /* Disable VBVA on those processing errors. */ 1845 #ifdef VBOX_WITH_OLD_VBVA_LOCK1846 1802 videoAccelEnable (false, NULL); 1847 #else1848 VideoAccelEnable (false, NULL);1849 #endif /* !VBOX_WITH_OLD_VBVA_LOCK */1850 1803 1851 1804 break; … … 1910 1863 for (uScreenId = 0; uScreenId < mcMonitors; uScreenId++) 1911 1864 { 1912 #ifndef VBOX_WITH_OLD_VBVA_LOCK1913 if (!maFramebuffers[uScreenId].pFramebuffer.isNull())1914 {1915 maFramebuffers[uScreenId].pFramebuffer->Unlock ();1916 }1917 #endif /* !VBOX_WITH_OLD_VBVA_LOCK */1918 1919 1865 if (maFramebuffers[uScreenId].u32ResizeStatus == ResizeStatus_Void) 1920 1866 { … … 1925 1871 } 1926 1872 1927 #ifdef VBOX_WITH_OLD_VBVA_LOCK1928 1873 int Display::videoAccelRefreshProcess(void) 1929 1874 { … … 1977 1922 return rc; 1978 1923 } 1979 #endif /* VBOX_WITH_OLD_VBVA_LOCK */1980 1924 1981 1925 … … 2194 2138 } 2195 2139 2196 #ifdef VBOX_WITH_OLD_VBVA_LOCK2197 2140 int Display::displayTakeScreenshotEMT(Display *pDisplay, ULONG aScreenId, uint8_t **ppu8Data, size_t *pcbData, uint32_t *pu32Width, uint32_t *pu32Height) 2198 2141 { … … 2276 2219 return rc; 2277 2220 } 2278 #endif /* VBOX_WITH_OLD_VBVA_LOCK */ 2279 2280 #ifdef VBOX_WITH_OLD_VBVA_LOCK 2221 2281 2222 static int displayTakeScreenshot(PVM pVM, Display *pDisplay, struct DRVMAINDISPLAY *pDrv, ULONG aScreenId, BYTE *address, ULONG width, ULONG height) 2282 #else2283 static int displayTakeScreenshot(PVM pVM, struct DRVMAINDISPLAY *pDrv, BYTE *address, ULONG width, ULONG height)2284 #endif /* !VBOX_WITH_OLD_VBVA_LOCK */2285 2223 { 2286 2224 uint8_t *pu8Data = NULL; … … 2290 2228 int vrc = VINF_SUCCESS; 2291 2229 2292 #ifdef VBOX_WITH_OLD_VBVA_LOCK2293 2230 int cRetries = 5; 2294 2231 … … 2304 2241 RTThreadSleep(10); 2305 2242 } 2306 #else2307 /* @todo pfnTakeScreenshot is probably callable from any thread, because it uses the VGA device lock. */2308 vrc = VMR3ReqCallWait(pVM, VMCPUID_ANY, (PFNRT)pDrv->pUpPort->pfnTakeScreenshot, 5,2309 pDrv->pUpPort, &pu8Data, &cbData, &cx, &cy);2310 #endif /* !VBOX_WITH_OLD_VBVA_LOCK */2311 2243 2312 2244 if (RT_SUCCESS(vrc) && pu8Data) … … 2381 2313 alock.leave(); 2382 2314 2383 #ifdef VBOX_WITH_OLD_VBVA_LOCK2384 2315 int vrc = displayTakeScreenshot(pVM, this, mpDrv, aScreenId, address, width, height); 2385 #else2386 int vrc = displayTakeScreenshot(pVM, mpDrv, address, width, height);2387 #endif /* !VBOX_WITH_OLD_VBVA_LOCK */2388 2316 2389 2317 if (vrc == VERR_NOT_IMPLEMENTED) … … 2440 2368 return E_OUTOFMEMORY; 2441 2369 2442 #ifdef VBOX_WITH_OLD_VBVA_LOCK2443 2370 int vrc = displayTakeScreenshot(pVM, this, mpDrv, aScreenId, pu8Data, width, height); 2444 #else2445 int vrc = displayTakeScreenshot(pVM, mpDrv, pu8Data, width, height);2446 #endif /* !VBOX_WITH_OLD_VBVA_LOCK */2447 2371 2448 2372 if (RT_SUCCESS(vrc)) … … 2517 2441 return E_OUTOFMEMORY; 2518 2442 2519 #ifdef VBOX_WITH_OLD_VBVA_LOCK2520 2443 int vrc = displayTakeScreenshot(pVM, this, mpDrv, aScreenId, pu8Data, width, height); 2521 #else2522 int vrc = displayTakeScreenshot(pVM, mpDrv, pu8Data, width, height);2523 #endif /* !VBOX_WITH_OLD_VBVA_LOCK */2524 2444 2525 2445 if (RT_SUCCESS(vrc)) … … 2553 2473 2554 2474 2555 #ifdef VBOX_WITH_OLD_VBVA_LOCK2556 2475 int Display::drawToScreenEMT(Display *pDisplay, ULONG aScreenId, BYTE *address, ULONG x, ULONG y, ULONG width, ULONG height) 2557 2476 { … … 2647 2566 return rc; 2648 2567 } 2649 #endif /* VBOX_WITH_OLD_VBVA_LOCK */2650 2568 2651 2569 STDMETHODIMP Display::DrawToScreen (ULONG aScreenId, BYTE *address, ULONG x, ULONG y, … … 2680 2598 * dirty conversion work. 2681 2599 */ 2682 #ifdef VBOX_WITH_OLD_VBVA_LOCK2683 2600 int rcVBox = VMR3ReqCallWait(pVM, VMCPUID_ANY, (PFNRT)Display::drawToScreenEMT, 7, 2684 2601 this, aScreenId, address, x, y, width, height); 2685 #else2686 int rcVBox = VMR3ReqCallWait(pVM, VMCPUID_ANY, (PFNRT)mpDrv->pUpPort->pfnDisplayBlt, 6,2687 mpDrv->pUpPort, address, x, y, width, height);2688 #endif /* !VBOX_WITH_OLD_VBVA_LOCK */2689 2602 2690 2603 /* … … 2713 2626 } 2714 2627 2715 #ifdef VBOX_WITH_OLD_VBVA_LOCK2716 2628 void Display::InvalidateAndUpdateEMT(Display *pDisplay) 2717 2629 { … … 2778 2690 pDisplay->vbvaUnlock(); 2779 2691 } 2780 #endif /* VBOX_WITH_OLD_VBVA_LOCK */2781 2692 2782 2693 /** … … 2808 2719 2809 2720 /* pdm.h says that this has to be called from the EMT thread */ 2810 #ifdef VBOX_WITH_OLD_VBVA_LOCK2811 2721 int rcVBox = VMR3ReqCallVoidWait(pVM, VMCPUID_ANY, (PFNRT)Display::InvalidateAndUpdateEMT, 2812 2722 1, this); 2813 #else2814 int rcVBox = VMR3ReqCallVoidWait(pVM, VMCPUID_ANY,2815 (PFNRT)mpDrv->pUpPort->pfnUpdateDisplayAll, 1, mpDrv->pUpPort);2816 #endif /* !VBOX_WITH_OLD_VBVA_LOCK */2817 2723 alock.enter (); 2818 2724 … … 3111 3017 /* Repaint the display because VM continued to run during the framebuffer resize. */ 3112 3018 if (!pFBInfo->pFramebuffer.isNull()) 3113 #ifdef VBOX_WITH_OLD_VBVA_LOCK3114 3019 { 3115 3020 pDisplay->vbvaLock(); 3116 #endif /* VBOX_WITH_OLD_VBVA_LOCK */3117 3021 pDrv->pUpPort->pfnUpdateDisplayAll(pDrv->pUpPort); 3118 #ifdef VBOX_WITH_OLD_VBVA_LOCK3119 3022 pDisplay->vbvaUnlock(); 3120 3023 } 3121 #endif /* VBOX_WITH_OLD_VBVA_LOCK */3122 3024 } 3123 3025 } … … 3133 3035 if (!fNoUpdate) 3134 3036 { 3135 #ifdef VBOX_WITH_OLD_VBVA_LOCK3136 3037 int rc = pDisplay->videoAccelRefreshProcess(); 3137 3038 … … 3168 3069 } 3169 3070 } 3170 #else3171 if (pDisplay->mfPendingVideoAccelEnable)3172 {3173 /* Acceleration was enabled while machine was not yet running3174 * due to restoring from saved state. Update entire display and3175 * actually enable acceleration.3176 */3177 Assert(pDisplay->mpPendingVbvaMemory);3178 3179 /* Acceleration can not be yet enabled.*/3180 Assert(pDisplay->mpVbvaMemory == NULL);3181 Assert(!pDisplay->mfVideoAccelEnabled);3182 3183 if (pDisplay->mfMachineRunning)3184 {3185 pDisplay->VideoAccelEnable (pDisplay->mfPendingVideoAccelEnable,3186 pDisplay->mpPendingVbvaMemory);3187 3188 /* Reset the pending state. */3189 pDisplay->mfPendingVideoAccelEnable = false;3190 pDisplay->mpPendingVbvaMemory = NULL;3191 }3192 }3193 else3194 {3195 Assert(pDisplay->mpPendingVbvaMemory == NULL);3196 3197 if (pDisplay->mfVideoAccelEnabled)3198 {3199 Assert(pDisplay->mpVbvaMemory);3200 pDisplay->VideoAccelFlush ();3201 }3202 else3203 {3204 DISPLAYFBINFO *pFBInfo = &pDisplay->maFramebuffers[VBOX_VIDEO_PRIMARY_SCREEN];3205 if (!pFBInfo->pFramebuffer.isNull())3206 {3207 Assert(pDrv->IConnector.pu8Data);3208 Assert(pFBInfo->u32ResizeStatus == ResizeStatus_Void);3209 pDrv->pUpPort->pfnUpdateDisplay(pDrv->pUpPort);3210 }3211 }3212 3213 /* Inform the VRDP server that the current display update sequence is3214 * completed. At this moment the framebuffer memory contains a definite3215 * image, that is synchronized with the orders already sent to VRDP client.3216 * The server can now process redraw requests from clients or initial3217 * fullscreen updates for new clients.3218 */3219 for (uScreenId = 0; uScreenId < pDisplay->mcMonitors; uScreenId++)3220 {3221 DISPLAYFBINFO *pFBInfo = &pDisplay->maFramebuffers[uScreenId];3222 3223 if (!pFBInfo->pFramebuffer.isNull() && pFBInfo->u32ResizeStatus == ResizeStatus_Void)3224 {3225 Assert (pDisplay->mParent && pDisplay->mParent->consoleVRDPServer());3226 pDisplay->mParent->consoleVRDPServer()->SendUpdate (uScreenId, NULL, 0);3227 }3228 }3229 }3230 #endif /* !VBOX_WITH_OLD_VBVA_LOCK */3231 3071 } 3232 3072 … … 3268 3108 3269 3109 /* Disable VBVA mode in any case. The guest driver reenables VBVA mode if necessary. */ 3270 #ifdef VBOX_WITH_OLD_VBVA_LOCK 3271 /* This is called under DevVGA lock. Postpone disabling VBVA, do it in the refresh timer. */ 3110 /* The LFBModeChange function is called under DevVGA lock. Postpone disabling VBVA, do it in the refresh timer. */ 3272 3111 ASMAtomicWriteU32(&pDrv->pDisplay->mfu32PendingVideoAccelDisable, true); 3273 #else3274 pDrv->pDisplay->VideoAccelEnable (false, NULL);3275 #endif /* !VBOX_WITH_OLD_VBVA_LOCK */3276 3112 } 3277 3113 -
trunk/src/VBox/Main/Makefile.kmk
r35304 r35305 582 582 $(if $(VBOX_WITH_LIVE_MIGRATION),VBOX_WITH_LIVE_MIGRATION,) \ 583 583 $(if $(VBOX_WITH_VUSB),VBOX_WITH_VUSB,) \ 584 $(if $(VBOX_WITH_OLD_VBVA_LOCK),VBOX_WITH_OLD_VBVA_LOCK,) \585 584 $(if $(VBOX_WITH_HGSMI),VBOX_WITH_HGSMI,) \ 586 585 $(if $(VBOX_WITH_VIDEOHWACCEL),VBOX_WITH_VIDEOHWACCEL,) \ -
trunk/src/VBox/Main/include/DisplayImpl.h
r35304 r35305 272 272 void handleResizeCompletedEMT (void); 273 273 274 #ifdef VBOX_WITH_OLD_VBVA_LOCK275 274 RTCRITSECT mVBVALock; 276 275 volatile uint32_t mfu32PendingVideoAccelDisable; … … 291 290 int videoAccelEnable (bool fEnable, VBVAMEMORY *pVbvaMemory); 292 291 void videoAccelFlush (void); 293 #endif /* VBOX_WITH_OLD_VBVA_LOCK */294 292 295 293 #ifdef VBOX_WITH_HGSMI
Note:
See TracChangeset
for help on using the changeset viewer.

