- Timestamp:
- Nov 24, 2009 11:28:44 AM (15 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/DisplayImpl.cpp
r24539 r24890 103 103 mLastHeight = 0; 104 104 105 #ifdef VBOX_WITH_OLD_VBVA_LOCK 106 int rc = RTCritSectInit (&mVBVALock); 107 AssertRC (rc); 108 #endif /* VBOX_WITH_OLD_VBVA_LOCK */ 109 105 110 return S_OK; 106 111 } … … 109 114 { 110 115 uninit(); 116 117 #ifdef VBOX_WITH_OLD_VBVA_LOCK 118 if (RTCritSectIsInitialized (&mVBVALock)) 119 { 120 RTCritSectDelete (&mVBVALock); 121 memset (&mVBVALock, 0, sizeof (mVBVALock)); 122 } 123 #endif /* VBOX_WITH_OLD_VBVA_LOCK */ 111 124 } 112 125 … … 965 978 * @thread EMT 966 979 */ 980 #ifdef VBOX_WITH_OLD_VBVA_LOCK 981 /* 982 * Always runs under VBVA or DevVGA lock. 983 * Safe to use VBVA vars and take the framebuffer lock. 984 */ 985 #endif /* VBOX_WITH_OLD_VBVA_LOCK */ 967 986 void Display::handleDisplayUpdate (int x, int y, int w, int h) 968 987 { … … 1165 1184 * @thread EMT 1166 1185 */ 1186 #ifdef VBOX_WITH_OLD_VBVA_LOCK 1167 1187 int Display::VideoAccelEnable (bool fEnable, VBVAMEMORY *pVbvaMemory) 1188 { 1189 int rc; 1190 RTCritSectEnter(&mVBVALock); 1191 rc = videoAccelEnable (fEnable, pVbvaMemory); 1192 RTCritSectLeave(&mVBVALock); 1193 return rc; 1194 } 1195 #endif /* VBOX_WITH_OLD_VBVA_LOCK */ 1196 1197 #ifdef VBOX_WITH_OLD_VBVA_LOCK 1198 int Display::videoAccelEnable (bool fEnable, VBVAMEMORY *pVbvaMemory) 1199 #else 1200 int Display::VideoAccelEnable (bool fEnable, VBVAMEMORY *pVbvaMemory) 1201 #endif /* !VBOX_WITH_OLD_VBVA_LOCK */ 1168 1202 { 1169 1203 int rc = VINF_SUCCESS; … … 1218 1252 { 1219 1253 /* Process any pending orders and empty the VBVA ring buffer. */ 1254 #ifdef VBOX_WITH_OLD_VBVA_LOCK 1255 videoAccelFlush (); 1256 #else 1220 1257 VideoAccelFlush (); 1258 #endif /* !VBOX_WITH_OLD_VBVA_LOCK */ 1221 1259 } 1222 1260 … … 1595 1633 * @thread EMT 1596 1634 */ 1635 #ifdef VBOX_WITH_OLD_VBVA_LOCK 1597 1636 void Display::VideoAccelFlush (void) 1637 { 1638 RTCritSectEnter(&mVBVALock); 1639 videoAccelFlush(); 1640 RTCritSectLeave(&mVBVALock); 1641 } 1642 #endif /* VBOX_WITH_OLD_VBVA_LOCK */ 1643 1644 #ifdef VBOX_WITH_OLD_VBVA_LOCK 1645 /* Under VBVA lock. DevVGA is not taken. */ 1646 void Display::videoAccelFlush (void) 1647 #else 1648 void Display::VideoAccelFlush (void) 1649 #endif /* !VBOX_WITH_OLD_VBVA_LOCK */ 1598 1650 { 1599 1651 #ifdef DEBUG_sunlover_2 … … 1623 1675 /* Process the ring buffer */ 1624 1676 unsigned uScreenId; 1677 #ifndef VBOX_WITH_OLD_VBVA_LOCK 1625 1678 for (uScreenId = 0; uScreenId < mcMonitors; uScreenId++) 1626 1679 { … … 1630 1683 } 1631 1684 } 1685 #endif /* !VBOX_WITH_OLD_VBVA_LOCK */ 1632 1686 1633 1687 /* Initialize dirty rectangles accumulator. */ … … 1647 1701 1648 1702 /* Disable VBVA on those processing errors. */ 1703 #ifdef VBOX_WITH_OLD_VBVA_LOCK 1704 videoAccelEnable (false, NULL); 1705 #else 1649 1706 VideoAccelEnable (false, NULL); 1707 #endif /* !VBOX_WITH_OLD_VBVA_LOCK */ 1650 1708 1651 1709 break; … … 1710 1768 for (uScreenId = 0; uScreenId < mcMonitors; uScreenId++) 1711 1769 { 1770 #ifndef VBOX_WITH_OLD_VBVA_LOCK 1712 1771 if (!maFramebuffers[uScreenId].pFramebuffer.isNull()) 1713 1772 { 1714 1773 maFramebuffers[uScreenId].pFramebuffer->Unlock (); 1715 1774 } 1775 #endif /* !VBOX_WITH_OLD_VBVA_LOCK */ 1716 1776 1717 1777 if (maFramebuffers[uScreenId].u32ResizeStatus == ResizeStatus_Void) … … 2599 2659 2600 2660 /* Disable VBVA mode in any case. The guest driver reenables VBVA mode if necessary. */ 2661 #ifdef VBOX_WITH_OLD_VBVA_LOCK 2662 /* This is called under DevVGA lock. Postpone disabling VBVA. */ 2663 /* @todo vbva */ 2664 #else 2601 2665 pDrv->pDisplay->VideoAccelEnable (false, NULL); 2666 #endif /* !VBOX_WITH_OLD_VBVA_LOCK */ 2602 2667 } 2603 2668 -
trunk/src/VBox/Main/Makefile.kmk
r24694 r24890 552 552 $(if $(VBOX_WITH_EHCI),VBOX_WITH_EHCI,) 553 553 endif 554 ifdef VBOX_WITH_OLD_VBVA_LOCK 555 VBoxC_DEFS += VBOX_WITH_OLD_VBVA_LOCK 556 endif 554 557 ifdef VBOX_WITH_HGSMI 555 558 VBoxC_DEFS += VBOX_WITH_HGSMI -
trunk/src/VBox/Main/include/DisplayImpl.h
r24457 r24890 339 339 340 340 void handleResizeCompletedEMT (void); 341 342 #ifdef VBOX_WITH_OLD_VBVA_LOCK 343 RTCRITSECT mVBVALock; 344 345 /* Functions run under VBVA lock. */ 346 int videoAccelEnable (bool fEnable, VBVAMEMORY *pVbvaMemory); 347 void videoAccelFlush (void); 348 #endif /* VBOX_WITH_OLD_VBVA_LOCK */ 341 349 }; 342 350
Note:
See TracChangeset
for help on using the changeset viewer.